Class ConnectionHandler<B>


public class ConnectionHandler<B> extends ReferenceableHandler<B>
ConnectionHandler manages Connection objects. These describe the network addresses where services are running. They are used by connection objects to describe the service that the connector should call. They are linked to servers to show their network address where the services that they are hosting are running.
Most OMASs that work with Connection objects use the Open Connector Framework (OCF) Bean since this can be passed to the OCF Connector Broker to create an instance of a connector to the attached asset. Therefore, this handler has a default bean and converter which is the one that works with the OCF bean. The call can either use these values or override with their own bean/converter implementations.
ConnectionHandler runs server-side in the OMAG Server Platform and retrieves Connection entities through the OMRSRepositoryConnector via the generic handler and repository handler.
  • Constructor Details

    • ConnectionHandler

      public ConnectionHandler(OpenMetadataAPIGenericConverter<B> converter, Class<B> beanClass, String serviceName, String serverName, InvalidParameterHandler invalidParameterHandler, RepositoryHandler repositoryHandler, OMRSRepositoryHelper repositoryHelper, String localServerUserId, OpenMetadataServerSecurityVerifier securityVerifier, List<String> supportedZones, List<String> defaultZones, List<String> publishZones, AuditLog auditLog)
      Construct the handler information needed to interact with the repository services
      Parameters:
      converter - specific converter for this bean class
      beanClass - name of bean class that is represented by the generic class B
      serviceName - name of this service
      serverName - name of the local server
      invalidParameterHandler - handler for managing parameter errors
      repositoryHandler - manages calls to the repository services
      repositoryHelper - provides utilities for manipulating the repository services objects
      localServerUserId - userId for this server
      securityVerifier - open metadata security services verifier
      supportedZones - list of zones that the access service is allowed to serve Asset instances from.
      defaultZones - list of zones that the access service should set in all new Asset instances.
      publishZones - list of zones that the access service sets up in published Asset instances.
      auditLog - destination for audit log events.
  • Method Details

    • saveConnection

      public String saveConnection(String userId, String externalSourceGUID, String externalSourceName, String anchorGUID, String assetGUID, String assetGUIDParameterName, String assetTypeName, String parentQualifiedName, Connection connection, boolean forLineage, boolean forDuplicateProcessing, List<String> serviceSupportedZones, Date effectiveTime, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
      Determine if the Connection object is stored in the repository and create it if it is not. If the connection is located, there is no check that the connection values are equal to those in the supplied object.
      Parameters:
      userId - calling userId
      externalSourceGUID - guid of the software capability entity that represented the external source - null for local
      externalSourceName - name of the software capability entity that represented the external source
      anchorGUID - unique identifier of the anchor to add to the connection
      assetGUID - unique identifier of linked asset (or null)
      assetGUIDParameterName - parameter name supplying assetGUID
      assetTypeName - type of asset
      parentQualifiedName - qualified name of associated asset/connection
      connection - object to add
      forLineage - return elements marked with the Memento classification?
      forDuplicateProcessing - do not merge elements marked as duplicates?
      serviceSupportedZones - supported zones for this service
      effectiveTime - the time that the retrieved elements must be effective for (null for any time, new Date() for now)
      methodName - calling method
      Returns:
      unique identifier of the connection in the repository.
      Throws:
      InvalidParameterException - the bean properties are invalid
      UserNotAuthorizedException - user not authorized to issue this request
      PropertyServerException - problem accessing the property server
    • addAssetConnection

      public void addAssetConnection(String userId, String externalSourceGUID, String externalSourceName, String assetGUID, String assetGUIDParameterName, String assetTypeName, String assetQualifiedName, boolean anchorEndpointToAsset, Map<String,Object> configurationProperties, String connectorProviderClassName, String networkAddress, String protocol, String encryptionMethod, Date effectiveFrom, Date effectiveTo, boolean forLineage, boolean forDuplicateProcessing, List<String> serviceSupportedZones, Date effectiveTime, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
      If possible, create a connection for the supplied asset. The new connection is linked to the asset.
      Parameters:
      userId - userId of user making request
      externalSourceGUID - guid of the software capability entity that represented the external source - null for local
      externalSourceName - name of the software capability entity that represented the external source
      assetGUID - unique identifier of the asset
      assetGUIDParameterName - parameter name supplying the asset guid
      assetTypeName - type of asset being created
      assetQualifiedName - fully qualified path name of the asset
      anchorEndpointToAsset - set to true if the network address is unique for the asset and should not be reused. False if this is an endpoint that is relevant for multiple assets.
      configurationProperties - configuration properties for the connection
      connectorProviderClassName - Java class name for the connector provider
      networkAddress - the network address (typically the URL but this depends on the protocol)
      protocol - the name of the protocol to use to connect to the endpoint
      encryptionMethod - encryption method to use when passing data to this endpoint
      effectiveFrom - starting time for this relationship (null for all time)
      effectiveTo - ending time for this relationship (null for all time)
      forLineage - return elements marked with the Memento classification?
      forDuplicateProcessing - do not merge elements marked as duplicates?
      serviceSupportedZones - supported zones for this service
      effectiveTime - the time that the retrieved elements must be effective for
      methodName - calling method
      Throws:
      InvalidParameterException - one of the parameters is null or invalid.
      PropertyServerException - there is a problem adding the connectorType properties to the property server.
      UserNotAuthorizedException - the requesting user is not authorized to issue this request.
    • createConnection

      public void createConnection(String userId, String externalSourceGUID, String externalSourceName, String assetGUID, String assetGUIDParameterName, String qualifiedName, String displayName, String description, Map<String,String> additionalProperties, Map<String,String> securedProperties, Map<String,Object> configurationProperties, String connectorUserId, String clearPassword, String encryptedPassword, String suppliedConnectionTypeName, Map<String,Object> extendedProperties, String connectorTypeGUID, String connectorTypeGUIDParameterName, String endpointGUID, String endpointGUIDParameterName, Date effectiveFrom, Date effectiveTo, boolean forLineage, boolean forDuplicateProcessing, List<String> serviceSupportedZones, Date effectiveTime, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
      Creates a new connection and returns the unique identifier for it.
      Parameters:
      userId - userId of user making request
      externalSourceGUID - guid of the software capability entity that represented the external source - null for local
      externalSourceName - name of the software capability entity that represented the external source
      assetGUID - the unique identifier for the asset entity (null for standalone connections)
      assetGUIDParameterName - the parameter supplying assetGUID
      qualifiedName - unique name
      displayName - new value for the display name.
      description - new description for the connection.
      additionalProperties - additional properties
      securedProperties - protected properties
      configurationProperties - properties passed to configure underlying technologies
      connectorUserId - user identity that the connector should use
      clearPassword - password for the userId in clear text
      encryptedPassword - encrypted password that the connector needs to decrypt before use
      suppliedConnectionTypeName - type name for the connection
      extendedProperties - parameters from a subtype
      connectorTypeGUID - unique identifier of the connector type to used for this connection
      connectorTypeGUIDParameterName - the parameter supplying connectorTypeGUID
      endpointGUID - unique identifier of the endpoint to used for this connection
      endpointGUIDParameterName - the parameter supplying endpointGUID
      effectiveFrom - starting time for this relationship (null for all time)
      effectiveTo - ending time for this relationship (null for all time)
      forLineage - return elements marked with the Memento classification?
      forDuplicateProcessing - do not merge elements marked as duplicates?
      serviceSupportedZones - supported zones for this service
      effectiveTime - the time that the retrieved elements must be effective for
      methodName - calling method
      Throws:
      InvalidParameterException - one of the parameters is null or invalid.
      PropertyServerException - there is a problem adding the connection properties to the property server.
      UserNotAuthorizedException - the requesting user is not authorized to issue this request.
    • updateConnection

      public void updateConnection(String userId, String externalSourceGUID, String externalSourceName, String connectionGUID, String connectionGUIDParameterName, String qualifiedName, String displayName, String description, Map<String,String> additionalProperties, Map<String,String> securedProperties, Map<String,Object> configurationProperties, String connectorUserId, String clearPassword, String encryptedPassword, String typeName, Map<String,Object> extendedProperties, boolean isMergeUpdate, Date effectiveFrom, Date effectiveTo, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
      Updates the properties of an existing connection.
      Parameters:
      userId - userId of user making request.
      externalSourceGUID - guid of the software capability entity that represented the external source - null for local
      externalSourceName - name of the software capability entity that represented the external source
      connectionGUID - unique identifier for the connection
      connectionGUIDParameterName - parameter providing connectionGUID
      qualifiedName - unique name
      displayName - new value for the display name.
      description - new description for the connection.
      additionalProperties - additional properties
      securedProperties - protected properties
      configurationProperties - properties passed to configure underlying technologies
      connectorUserId - user identity that the connector should use
      clearPassword - password for the userId in clear text
      encryptedPassword - encrypted password that the connector needs to decrypt before use
      typeName - name of the type that is a subtype of connection - or null to create standard type
      extendedProperties - additional properties for the subtype
      isMergeUpdate - should the new properties be merged with existing properties (true) or completely replace them (false)?
      effectiveFrom - starting time for this relationship (null for all time)
      effectiveTo - ending time for this relationship (null for all time)
      forLineage - return elements marked with the Memento classification?
      forDuplicateProcessing - do not merge elements marked as duplicates?
      effectiveTime - the time that the retrieved elements must be effective for
      methodName - calling method
      Throws:
      InvalidParameterException - one of the parameters is null or invalid.
      PropertyServerException - there is a problem adding the connection properties to the property server.
      UserNotAuthorizedException - the requesting user is not authorized to issue this request.
    • getConnectionForAsset

      public B getConnectionForAsset(String userId, String assetGUID, String assetGUIDParameterName, List<String> serviceSupportedZones, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
      Retrieve the list of connection objects attached to the requested asset object. This includes the endpoint and connector type.
      Parameters:
      userId - calling user
      assetGUID - unique identifier of the asset object
      assetGUIDParameterName - parameter name supplying assetGUID
      serviceSupportedZones - list of supported zones for the calling service
      forLineage - return elements marked with the Memento classification?
      forDuplicateProcessing - do not merge elements marked as duplicates?
      effectiveTime - the time that the retrieved elements must be effective for
      methodName - calling method
      Returns:
      Connection bean
      Throws:
      InvalidParameterException - the parameters are invalid
      UserNotAuthorizedException - user not authorized to issue this request
      PropertyServerException - problem accessing the property server