Package com.mks.api

Interface IntegrationPoint

  • All Superinterfaces:
    IntegrationVersionRequest

    public interface IntegrationPoint
    extends IntegrationVersionRequest
    Interface used to model the point of entry for an integration. The IntegrationPoint is an abstract model used to define what you want to connect to (Windchill RV&S Client or Windchill RV&S Server) and execute commands against.

    An IntegrationPoint can be obtained from the IntegrationPointFactory.

    • Method Detail

      • getHostname

        java.lang.String getHostname()
        Retrieves the host name property for the IntegrationPoint.
        Returns:
        The host name for the IntegrationPoint.
      • getPort

        int getPort()
        Retrieves the port property for the IntegrationPoint. If the IntegrationPoint was created using one of the IntegrationPointFactory.createLocalIntegrationPoint() methods, then this method will return 0 until a CmdRunner has been created from a Session created by the IntegrationPoint and a command has been executed by the CmdRunner.
        Returns:
        The port to connect to for the IntegrationPoint.
        See Also:
        IntegrationPointFactory.createLocalIntegrationPoint(int, int)
      • isClientIntegrationPoint

        boolean isClientIntegrationPoint()
        Indicates whether the integration point is to an IntegrityClient daemon. At present, the integration point does not physically identify itself, so the implementation of this method is based on heuristics. The assumption is that any integration point where the port needs to be pre-specified is more likely to NOT be an IntegrityClient than not.
        Returns:
        true if the IntegrationPoint believes it is connected to an IntegrityClient; false otherwise.
      • isSecure

        boolean isSecure()
        Checks to see if secure communication will be used to connect to the IntegrationPoint.
        Returns:
        true if the IntegrationPoint will use a secure communication protocol for communication; false otherwise.
      • createSession

        @Deprecated
        Session createSession()
                       throws APIException
        Deprecated.
        replaced by createNamedSession(String, VersionNumber). When creating a session for use by an integration, it is expected/recommended that the integration identify itself.
        Creates a new Session object.
        Returns:
        A Session used to run commands on.
        Throws:
        APIException - If isSecure() returns true.
        See Also:
        Session
      • createNamedSession

        Session createNamedSession​(java.lang.String integrationID,
                                   VersionNumber overrideRequestVersion)
                            throws APIException
        Creates a new Session object.
        Parameters:
        integrationID - An identifier for the integration to which this session belongs. A null value is considered to correspond to an unidentified integration session.
        overrideRequestVersion - Used to override the API request version that commands executed under this session will use. May be null, in which case it defaults to the API request version from the IntegrationPoint IntegrationVersionRequest.getAPIRequestVersion()
        Returns:
        A Session used to run commands on.
        Throws:
        APIException - If isSecure() returns true.
        Since:
        10.8
        Only Integrity 10.8 or higher will recognize the integration identifier. This method can safely be used on older releases, but the integration identifier will be not be reflected in Windchill RV&S.
        See Also:
        Session
      • createSession

        @Deprecated
        Session createSession​(java.lang.String username,
                              java.lang.String password)
                       throws APIException
        Deprecated.
        replaced by createNamedSession(String, VersionNumber, String, String). When creating a session for use by an integration, it is expected/recommended that the integration identify itself.
        Creates a new Session object. Use this method when the IntegrationPoint has an authentication policy of AuthenticatedSessionPolicy.
        Parameters:
        username - The username used when authenticating with the IntegrationPoint to create the Session.
        password - The password used when authenticating with the IntegrationPoint to create the Session.
        Returns:
        A Session used to run commands on.
        Throws:
        APIException - If there was a problem creating a Session object.
        See Also:
        Session
      • createNamedSession

        Session createNamedSession​(java.lang.String integrationID,
                                   VersionNumber overrideRequestVersion,
                                   java.lang.String username,
                                   java.lang.String password)
                            throws APIException
        Creates a new Session object. Use this method when the IntegrationPoint has an authentication policy of AuthenticatedSessionPolicy.
        Parameters:
        integrationID - An identifier for the integration to which this session belongs.
        overrideRequestVersion - Used to override the API request version that commands executed under this session will use. May be null, in which case it defaults to the API request version from the IntegrationPoint IntegrationVersionRequest.getAPIRequestVersion()
        username - The username used when authenticating with the IntegrationPoint to create the Session. May be null in which case the session is unauthenticated.
        password - The password used when authenticating with the IntegrationPoint to create the Session. Should only be null if the username parameter is null.
        Returns:
        A Session used to run commands on.
        Throws:
        APIException - If there was a problem creating a Session object.
        Since:
        10.8
        Only Integrity 10.8 or higher will recognize the integration identifier. This method can safely be used on older releases, but the integration identifier will be not be reflected in Windchill RV&S.
        See Also:
        Session
      • createSession

        @Deprecated
        Session createSession​(java.lang.String username,
                              java.lang.String password,
                              int apiMajorVersion,
                              int apiMinorVersion)
                       throws APIException
        Deprecated.
        replaced by createNamedSession(String, VersionNumber, String, String). When creating a session for use by an integration, it is expected/recommended that the integration identify itself.
        Creates a new Session object. Use this method when the IntegrationPoint has an authentication policy of AuthenticatedSessionPolicy. In particular, this method is used when one wishes to establish a session that uses an API request version that is explicitly distinct from the version being using by the IntegrationPoint.
        Parameters:
        username - The username used when authenticating with the IntegrationPoint to create the Session.
        password - The password used when authenticating with the IntegrationPoint to create the Session.
        apiMajorVersion - major version for the API requests
        apiMinorVersion - minor version for the API requests
        Returns:
        A Session used to run commands on.
        Throws:
        APIException - If there was a problem creating a Session object.
        See Also:
        Session
      • getCommonSession

        Session getCommonSession()
                          throws APIException
        Retrieves the common Session. The common Session is a single session that is shared across all instances of the Session (that is, there is only one available). This method will only be successful if the IntegrationPoint is Windchill RV&S Client.
        Returns:
        An annonymous Session used to run commands on.
        Throws:
        APIException - If there was a problem creating a Session object.
        See Also:
        Session
      • getCommonSession

        Session getCommonSession​(java.lang.String username,
                                 java.lang.String password)
                          throws APIException
        Retrieves the common Session. The common Session is a single session that is shared across all instances of the Session, i.e. there is only one available. This method will only be successful if the IntegrationPoint is Windchill RV&S Client. Use this method when the IntegrationPoint has an authentication policy of AuthenticatedSessionPolicy.
        Parameters:
        username - The username associated with the Session.
        password - The password associated with the Session.
        Returns:
        An annonymous Session used to run commands on.
        Throws:
        APIException - If there was a problem creating a Session object.
        See Also:
        Session
      • getSessions

        java.util.Iterator<Session> getSessions()
        Retrieves an Iterator over the Sessions that have been created for the IntegrationPoint.
        Returns:
        A list of Sessions that have been created.
      • getAutoStartIntegrityClient

        boolean getAutoStartIntegrityClient()
        Retrieves the flag indicating if the IntegrationPoint should attempt to automatically start the Windchill RV&S Client. This is only valid for IntegrationPoints that point to Windchill RV&S Client that is local to where the API is being executed from.
        Returns:
        true if the Windchill RV&S Client will be automatically started; false otherwise.
      • setAutoStartIntegrityClient

        void setAutoStartIntegrityClient​(boolean autoStartIC)
        Sets the flag indicating if the IntegrationPoint should attempt to automatically start the Windchill RV&S Client. This is only valid for IntegrationPoints that point to Windchill RV&S Client that is local to where the API is being executed from. The default value is false (that is, do not automatically start the Windchill RV&S Client).
        Parameters:
        autoStartIC - true if the Windchill RV&S Client will be automatically started; false otherwise.
      • release

        void release()
        Releases an IntegrationPoint object after it has completed its purpose.