Class OMASServiceInstanceHandler


public class OMASServiceInstanceHandler extends AuditableServerServiceInstanceHandler
OMASServiceInstanceHandler retrieves information from the instance map for the access service instances. The instance map is thread-safe. Instances are added and removed by the GovernanceProgramAdmin class.
  • Constructor Details

    • OMASServiceInstanceHandler

      public OMASServiceInstanceHandler(String serviceName)
      Constructor
      Parameters:
      serviceName - a descriptive name for the OMAS
  • Method Details

    • getRepositoryConnector

      public org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryConnector getRepositoryConnector(String userId, String serverName, String serviceOperationName) throws org.odpi.openmetadata.frameworks.openmetadata.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.openmetadata.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.openmetadata.ffdc.PropertyServerException
      Retrieve the repository connector for the access service.
      Parameters:
      userId - calling userId
      serverName - name of the server tied to the request
      serviceOperationName - name of the REST API call (typically the top-level methodName)
      Returns:
      repository connector for exclusive use by the requested instance
      Throws:
      org.odpi.openmetadata.frameworks.openmetadata.ffdc.InvalidParameterException - the server name is not known
      org.odpi.openmetadata.frameworks.openmetadata.ffdc.UserNotAuthorizedException - the user is not authorized to issue the request.
      org.odpi.openmetadata.frameworks.openmetadata.ffdc.PropertyServerException - the service name is not known or the repository connector is not available - indicating a logic error
    • getRepositoryHelper

      public org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryHelper getRepositoryHelper(String userId, String serverName, String serviceOperationName) throws org.odpi.openmetadata.frameworks.openmetadata.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.openmetadata.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.openmetadata.ffdc.PropertyServerException
      Retrieve the repository helper for the access service.
      Parameters:
      userId - calling userId
      serverName - name of the server tied to the request
      serviceOperationName - name of the REST API call (typically the top-level methodName)
      Returns:
      repository connector for exclusive use by the requested instance
      Throws:
      org.odpi.openmetadata.frameworks.openmetadata.ffdc.InvalidParameterException - the server name is not known
      org.odpi.openmetadata.frameworks.openmetadata.ffdc.UserNotAuthorizedException - the user is not authorized to issue the request.
      org.odpi.openmetadata.frameworks.openmetadata.ffdc.PropertyServerException - the service name is not known or the repository connector is not available - indicating a logic error
    • getMetadataCollection

      public org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.OMRSMetadataCollection getMetadataCollection(String userId, String serverName, String serviceOperationName) throws org.odpi.openmetadata.frameworks.openmetadata.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.openmetadata.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.openmetadata.ffdc.PropertyServerException
      Retrieve the metadata collection for the access service.
      Parameters:
      userId - calling userId
      serverName - name of the server tied to the request
      serviceOperationName - name of the REST API call (typically the top-level methodName)
      Returns:
      metadata collection for exclusive use by the requested instance
      Throws:
      org.odpi.openmetadata.frameworks.openmetadata.ffdc.InvalidParameterException - the server name is not known
      org.odpi.openmetadata.frameworks.openmetadata.ffdc.UserNotAuthorizedException - the user is not authorized to issue the request.
      org.odpi.openmetadata.frameworks.openmetadata.ffdc.PropertyServerException - the service name is not known or the metadata collection is not available - indicating a logic error
    • getRepositoryHandler

      public org.odpi.openmetadata.commonservices.repositoryhandler.RepositoryHandler getRepositoryHandler(String userId, String serverName, String serviceOperationName) throws org.odpi.openmetadata.frameworks.openmetadata.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.openmetadata.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.openmetadata.ffdc.PropertyServerException
      Retrieve the repository handler for the access service. Provides an advanced API for the repository services.
      Parameters:
      userId - calling userId
      serverName - name of the server tied to the request
      serviceOperationName - name of the REST API call (typically the top-level methodName)
      Returns:
      repository handler
      Throws:
      org.odpi.openmetadata.frameworks.openmetadata.ffdc.InvalidParameterException - the server name is not known
      org.odpi.openmetadata.frameworks.openmetadata.ffdc.UserNotAuthorizedException - the user is not authorized to issue the request.
      org.odpi.openmetadata.frameworks.openmetadata.ffdc.PropertyServerException - the service name is not known or the metadata collection is not available - indicating a logic error
    • getErrorHandler

      public org.odpi.openmetadata.commonservices.repositoryhandler.RepositoryErrorHandler getErrorHandler(String userId, String serverName, String serviceOperationName) throws org.odpi.openmetadata.frameworks.openmetadata.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.openmetadata.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.openmetadata.ffdc.PropertyServerException
      Retrieve the handler for managing errors from the repository services.
      Parameters:
      userId - calling userId
      serverName - name of the server tied to the request
      serviceOperationName - name of the REST API call (typically the top-level methodName)
      Returns:
      repository error handler
      Throws:
      org.odpi.openmetadata.frameworks.openmetadata.ffdc.InvalidParameterException - the server name is not known
      org.odpi.openmetadata.frameworks.openmetadata.ffdc.UserNotAuthorizedException - the user is not authorized to issue the request.
      org.odpi.openmetadata.frameworks.openmetadata.ffdc.PropertyServerException - the service name is not known or the metadata collection is not available - indicating a logic error
    • getServiceName

      public String getServiceName(String callingServiceURLName)
      Return the service's official name.
      Parameters:
      callingServiceURLName - url fragment that indicates the service name
      Returns:
      String name
    • getSupportedZones

      public List<String> getSupportedZones(String userId, String serverName, String callingServiceURLName, String serviceOperationName) throws org.odpi.openmetadata.frameworks.openmetadata.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.openmetadata.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.openmetadata.ffdc.PropertyServerException
      Get the supportedZones for a specific service. This is used in services that are shared by different access services.
      Parameters:
      userId - calling user
      serverName - name of this server
      callingServiceURLName - url fragment that indicates the service name
      serviceOperationName - name of the REST API call (typically the top-level methodName)
      Returns:
      list of governance zones
      Throws:
      org.odpi.openmetadata.frameworks.openmetadata.ffdc.InvalidParameterException - the server name is not known
      org.odpi.openmetadata.frameworks.openmetadata.ffdc.UserNotAuthorizedException - the user is not authorized to issue the request.
      org.odpi.openmetadata.frameworks.openmetadata.ffdc.PropertyServerException - the service name is not known - indicating a logic error
    • getDefaultZones

      public List<String> getDefaultZones(String userId, String serverName, String callingServiceURLName, String serviceOperationName) throws org.odpi.openmetadata.frameworks.openmetadata.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.openmetadata.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.openmetadata.ffdc.PropertyServerException
      Get the defaultZones for a specific service. This is used in services that are shared by different access services.
      Parameters:
      userId - calling user
      serverName - name of this server
      callingServiceURLName - url fragment that indicates the service name
      serviceOperationName - name of the REST API call (typically the top-level methodName)
      Returns:
      list of governance zones
      Throws:
      org.odpi.openmetadata.frameworks.openmetadata.ffdc.InvalidParameterException - the server name is not known
      org.odpi.openmetadata.frameworks.openmetadata.ffdc.UserNotAuthorizedException - the user is not authorized to issue the request.
      org.odpi.openmetadata.frameworks.openmetadata.ffdc.PropertyServerException - the service name is not known or the metadata collection is not available - indicating a logic error
    • getPublishZones

      public List<String> getPublishZones(String userId, String serverName, String callingServiceURLName, String serviceOperationName) throws org.odpi.openmetadata.frameworks.openmetadata.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.openmetadata.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.openmetadata.ffdc.PropertyServerException
      Get the publishZones for a specific service. This is used in services that are shared by different access services.
      Parameters:
      userId - calling user
      serverName - name of this server
      callingServiceURLName - url fragment that indicates the service name
      serviceOperationName - name of the REST API call (typically the top-level methodName)
      Returns:
      list of governance zones
      Throws:
      org.odpi.openmetadata.frameworks.openmetadata.ffdc.InvalidParameterException - the server name is not known
      org.odpi.openmetadata.frameworks.openmetadata.ffdc.UserNotAuthorizedException - the user is not authorized to issue the request.
      org.odpi.openmetadata.frameworks.openmetadata.ffdc.PropertyServerException - the service name is not known or the metadata collection is not available - indicating a logic error
    • getSupportedZones

      public List<String> getSupportedZones(String userId, String serverName, String serviceOperationName) throws org.odpi.openmetadata.frameworks.openmetadata.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.openmetadata.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.openmetadata.ffdc.PropertyServerException
      Retrieve the supported zones set up for this service instance.
      Parameters:
      userId - calling userId
      serverName - name of the server tied to the request
      serviceOperationName - name of the REST API call (typically the top-level methodName)
      Returns:
      list of governance zones
      Throws:
      org.odpi.openmetadata.frameworks.openmetadata.ffdc.InvalidParameterException - the server name is not known
      org.odpi.openmetadata.frameworks.openmetadata.ffdc.UserNotAuthorizedException - the user is not authorized to issue the request.
      org.odpi.openmetadata.frameworks.openmetadata.ffdc.PropertyServerException - the service name is not known or the metadata collection is not available - indicating a logic error
    • getDefaultZones

      public List<String> getDefaultZones(String userId, String serverName, String serviceOperationName) throws org.odpi.openmetadata.frameworks.openmetadata.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.openmetadata.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.openmetadata.ffdc.PropertyServerException
      Retrieve the default zones set up for this service instance.
      Parameters:
      userId - calling userId
      serverName - name of the server tied to the request
      serviceOperationName - name of the REST API call (typically the top-level methodName)
      Returns:
      list of governance zones
      Throws:
      org.odpi.openmetadata.frameworks.openmetadata.ffdc.InvalidParameterException - the server name is not known
      org.odpi.openmetadata.frameworks.openmetadata.ffdc.UserNotAuthorizedException - the user is not authorized to issue the request.
      org.odpi.openmetadata.frameworks.openmetadata.ffdc.PropertyServerException - the service name is not known or the metadata collection is not available - indicating a logic error
    • getPublishZones

      public List<String> getPublishZones(String userId, String serverName, String serviceOperationName) throws org.odpi.openmetadata.frameworks.openmetadata.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.openmetadata.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.openmetadata.ffdc.PropertyServerException
      Retrieve the publishZones set up for this service instance.
      Parameters:
      userId - calling userId
      serverName - name of the server tied to the request
      serviceOperationName - name of the REST API call (typically the top-level methodName)
      Returns:
      list of governance zones
      Throws:
      org.odpi.openmetadata.frameworks.openmetadata.ffdc.InvalidParameterException - the server name is not known
      org.odpi.openmetadata.frameworks.openmetadata.ffdc.UserNotAuthorizedException - the user is not authorized to issue the request.
      org.odpi.openmetadata.frameworks.openmetadata.ffdc.PropertyServerException - the service name is not known or the metadata collection is not available - indicating a logic error
    • getInTopicConnection

      public org.odpi.openmetadata.frameworks.connectors.properties.beans.Connection getInTopicConnection(String userId, String serverName, String serviceOperationName, String callerId) throws org.odpi.openmetadata.frameworks.openmetadata.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.openmetadata.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.openmetadata.ffdc.PropertyServerException
      Return the connection used in the client to create a connector to access events from the out topic.
      Parameters:
      userId - calling user
      serverName - name of the server tied to the request
      serviceOperationName - name of the REST API call (typically the top-level methodName)
      callerId - unique identifier of the caller
      Returns:
      connection object for client
      Throws:
      org.odpi.openmetadata.frameworks.openmetadata.ffdc.InvalidParameterException - no available instance for the requested server
      org.odpi.openmetadata.frameworks.openmetadata.ffdc.UserNotAuthorizedException - user does not have access to the requested server
      org.odpi.openmetadata.frameworks.openmetadata.ffdc.PropertyServerException - the service name is not known - indicating a logic error
    • getOutTopicConnection

      public org.odpi.openmetadata.frameworks.connectors.properties.beans.Connection getOutTopicConnection(String userId, String serverName, String serviceOperationName, String callerId) throws org.odpi.openmetadata.frameworks.openmetadata.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.openmetadata.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.openmetadata.ffdc.PropertyServerException
      Return the connection used in the client to create a connector to access events from the out topic.
      Parameters:
      userId - calling user
      serverName - name of the server tied to the request
      serviceOperationName - name of the REST API call (typically the top-level methodName)
      callerId - unique identifier of the caller
      Returns:
      connection object for client
      Throws:
      org.odpi.openmetadata.frameworks.openmetadata.ffdc.InvalidParameterException - no available instance for the requested server
      org.odpi.openmetadata.frameworks.openmetadata.ffdc.UserNotAuthorizedException - user does not have access to the requested server
      org.odpi.openmetadata.frameworks.openmetadata.ffdc.PropertyServerException - the service name is not known - indicating a logic error
    • getRegisteredOMAGService

      public org.odpi.openmetadata.commonservices.ffdc.rest.RegisteredOMAGService getRegisteredOMAGService(String userId, String serverName, int accessServiceCode, String serviceOperationName) throws org.odpi.openmetadata.frameworks.openmetadata.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.openmetadata.ffdc.PropertyServerException, org.odpi.openmetadata.frameworks.openmetadata.ffdc.UserNotAuthorizedException
      Retrieve the requesting service's description.
      Parameters:
      userId - calling user
      serverName - name of the server tied to the request
      serviceOperationName - name of the REST API call (typically the top-level methodName)
      accessServiceCode - identifier for the service
      Returns:
      service description
      Throws:
      org.odpi.openmetadata.frameworks.openmetadata.ffdc.InvalidParameterException - no available instance for the requested server
      org.odpi.openmetadata.frameworks.openmetadata.ffdc.UserNotAuthorizedException - user does not have access to the requested server
      org.odpi.openmetadata.frameworks.openmetadata.ffdc.PropertyServerException - the service name is not known - indicating a logic error
    • getExceptionHandler

      public org.odpi.openmetadata.commonservices.ffdc.RESTExceptionHandler getExceptionHandler()
      Retrieve the exception handler that can package up common exceptions and pack them into a REST Response.
      Returns:
      exception handler object