Class ConnectorBase

    • Field Detail

      • connectorInstanceId

        protected java.lang.String connectorInstanceId
      • connectionBean

        protected Connection connectionBean
      • securedProperties

        protected java.util.Map<java.lang.String,​java.lang.String> securedProperties
    • Constructor Detail

      • ConnectorBase

        public ConnectorBase()
        Typical Constructor: Connectors should always have a constructor requiring no parameters and perform initialization in the initialize method.
    • Method Detail

      • initialize

        public void initialize​(java.lang.String connectorInstanceId,
                               ConnectionProperties connectionProperties)
        Call made by the ConnectorProvider to initialize the Connector with the base services.
        Specified by:
        initialize in class Connector
        Parameters:
        connectorInstanceId - unique id for the connector instance useful for messages etc
        connectionProperties - POJO for the configuration used to create the connector.
      • getConnectorInstanceId

        public java.lang.String getConnectorInstanceId()
        Returns the unique connector instance id that assigned to the connector instance when it was created. It is useful for error and audit messages.
        Specified by:
        getConnectorInstanceId in class Connector
        Returns:
        guid for the connector instance
      • getConnection

        public ConnectionProperties getConnection()
        Returns the connection object that was used to create the connector instance. Its contents are never refreshed during the lifetime of the connector instance, even if the connection information is updated or removed from the originating metadata repository.
        Specified by:
        getConnection in class Connector
        Returns:
        connection properties object
      • initializeConnectedAssetProperties

        public void initializeConnectedAssetProperties​(ConnectedAssetProperties connectedAssetProperties)
        Set up the connected asset properties object. This provides the known metadata properties stored in one or more metadata repositories. The properties are populated whenever getConnectedAssetProperties() is called.
        Specified by:
        initializeConnectedAssetProperties in class Connector
        Parameters:
        connectedAssetProperties - properties of the connected asset
      • getConnectedAssetProperties

        public ConnectedAssetProperties getConnectedAssetProperties​(java.lang.String userId)
                                                             throws PropertyServerException,
                                                                    UserNotAuthorizedException
        Returns the properties that contain the metadata for the asset. The asset metadata is retrieved from the metadata repository and cached in the ConnectedAssetProperties object each time the getConnectedAssetProperties method is requested by the caller. Once the ConnectedAssetProperties object has the metadata cached, it can be used to access the asset property values many times without a return to the metadata repository. The cache of metadata can be refreshed simply by calling this getConnectedAssetProperties() method again.
        Specified by:
        getConnectedAssetProperties in class Connector
        Parameters:
        userId - userId of requesting user
        Returns:
        ConnectedAssetProperties connected asset properties
        Throws:
        PropertyServerException - indicates a problem retrieving properties from a metadata repository
        UserNotAuthorizedException - indicates that the user is not authorized to access the asset properties.
      • isActive

        public boolean isActive()
        Return a flag indicating whether the connector is active. This means it has been started and not yet disconnected.
        Returns:
        isActive flag
      • hashCode

        public int hashCode()
        Provide a common implementation of hashCode for all OCF Connector objects. The UUID is unique and is randomly assigned and so its hashCode is as good as anything to describe the hash code of the connector object.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        random UUID as hashcode
      • equals

        public boolean equals​(java.lang.Object object)
        Provide a common implementation of equals for all OCF Connector Provider objects. The UUID is unique and is randomly assigned and so its hashCode is as good as anything to evaluate the equality of the connector provider object.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        object - object to test
        Returns:
        boolean flag
      • toString

        public java.lang.String toString()
        Standard toString method.
        Overrides:
        toString in class java.lang.Object
        Returns:
        print out of variables in a JSON-style