Class Connection

  • All Implemented Interfaces:
    Direct Known Subclasses:

    public class Connection
    extends Referenceable
    The connection is an object that contains the properties needed to create and initialise a connector to access a specific data assets. The properties for a connection are defined in model 0201. They include the following options for connector name:
    • guid - Globally unique identifier for the connection.
    • url - URL of the connection definition in the metadata repository. This URL can be stored as a property in another entity to create an explicit link to this connection.
    • qualifiedName - The official (unique) name for the connection. This is often defined by the IT systems management organization and should be used (when available) on audit logs and error messages. The qualifiedName is defined in the 0010 model as part of Referenceable.
    • displayName - A consumable name for the connection. Often a shortened form of the qualifiedName for use on user interfaces and messages. The displayName should be only be used for audit logs and error messages if the qualifiedName is not set.
    Either the guid, qualifiedName or displayName can be used to specify the name for a connection. Other properties for the connection include:
    • type - information about the TypeDef for Connection
    • description - A full description of the connection covering details of the assets it connects to along with usage and version information.
    • additionalProperties - Any additional properties associated with the connection.
    • configurationProperties - properties for configuring the connector.
    • securedProperties - Protected properties for secure log on by connector to back end server. These are protected properties that can only be retrieved by privileged connector code.
    • userId - name or URI or connecting user.
    • encryptedPassword - password for the userId - needs decrypting by connector before use.
    • clearPassword - password for userId - ready to use.
    • connectorType - Properties that describe the connector type for the connector.
    • endpoint - Properties that describe the server endpoint where the connector will retrieve the assets.
    • assetSummary - short description of the connected asset (if any).
    The connection class is simply used to cache the properties for an connection. It is used by other classes to exchange this information between a metadata repository and a consumer.
    See Also:
    Serialized Form
    • Constructor Detail

      • Connection

        public Connection()
        Default constructor sets the Connection properties to null.
      • Connection

        public Connection​(Connection template)
        Copy/clone Constructor to return a copy of a connection object.
        template - Connection to copy
    • Method Detail

      • getConnectionType

        public static ElementType getConnectionType()
        Return the standard type for a connection type.
        ElementType object
      • getDisplayName

        public java.lang.String getDisplayName()
        Returns the stored display name property for the connection. Null means no displayName is available.
      • setDisplayName

        public void setDisplayName​(java.lang.String displayName)
        Set up the display name for UIs and reports.
        displayName - String name
      • setDescription

        public void setDescription​(java.lang.String description)
        Set up description of the element.
        description - String
      • getDescription

        public java.lang.String getDescription()
        Returns the stored description property for the connection. If no description is provided then null is returned.
      • setConnectorType

        public void setConnectorType​(ConnectorType connectorType)
        Set up the connector type properties for this Connection.
        connectorType - ConnectorType properties object
      • getConnectorType

        public ConnectorType getConnectorType()
        Returns a copy of the properties for this connection's connector type. A null means there is no connection type.
        connector type for the connection
      • getUserId

        public java.lang.String getUserId()
        Return the userId to use on this connection.
      • setUserId

        public void setUserId​(java.lang.String userId)
        Set up the userId to use on this connection.
        userId - string
      • getEncryptedPassword

        public java.lang.String getEncryptedPassword()
        Return an encrypted password. The caller is responsible for decrypting it.
      • setEncryptedPassword

        public void setEncryptedPassword​(java.lang.String encryptedPassword)
        Set up an encrypted password.
        encryptedPassword - string
      • getClearPassword

        public java.lang.String getClearPassword()
        Return an unencrypted password.
      • setClearPassword

        public void setClearPassword​(java.lang.String clearPassword)
        Set up an unencrypted password.
        clearPassword - string
      • setEndpoint

        public void setEndpoint​(Endpoint endpoint)
        Set up the endpoint properties for this Connection.
        endpoint - Endpoint properties object
      • getEndpoint

        public Endpoint getEndpoint()
        Returns a copy of the properties for this connection's endpoint. Null means no endpoint information available.
        endpoint for the connection
      • setConfigurationProperties

        public void setConfigurationProperties​(java.util.Map<java.lang.String,​java.lang.Object> configurationProperties)
        Set up the configuration properties for this Connection.
        configurationProperties - properties that contain additional configuration information for the connector.
      • getConfigurationProperties

        public java.util.Map<java.lang.String,​java.lang.Object> getConfigurationProperties()
        Return a copy of the configuration properties. Null means no secured properties are available.
        secured properties typically user credentials for the connection
      • setSecuredProperties

        public void setSecuredProperties​(java.util.Map<java.lang.String,​java.lang.String> securedProperties)
        Set up the secured properties for this Connection.
        securedProperties - properties that contain secret information such as log on information.
      • getSecuredProperties

        public java.util.Map<java.lang.String,​java.lang.String> getSecuredProperties()
        Return a copy of the secured properties. Null means no secured properties are available.
        secured properties typically user credentials for the connection
      • getAssetSummary

        public java.lang.String getAssetSummary()
        Return the description of the asset that this connection is linked to - or null if no asset connected, or the asset summary property in the relationship is not set.
        string description
      • setAssetSummary

        public void setAssetSummary​(java.lang.String assetSummary)
        Set up the description of the asset that this connection is linked to - or null if no asset connected, or the asset summary property in the relationship is not set.
        assetSummary - string description
      • toString

        public java.lang.String toString()
        Standard toString method. Note SecuredProperties and other credential type properties are not displayed. This is deliberate because there is no knowing where the string will be printed.
        toString in class Referenceable
        print out of variables in a JSON-style
      • equals

        public boolean equals​(java.lang.Object objectToCompare)
        Compare the values of the supplied object with those stored in the current object.
        equals in class Referenceable
        objectToCompare - supplied object
        boolean result of comparison
      • hashCode

        public int hashCode()
        Return hash code based on properties.
        hashCode in class Referenceable