Class ViewServiceClientMap<B>

java.lang.Object
org.odpi.openmetadata.commonservices.multitenant.ViewServiceClientMap<B>

public class ViewServiceClientMap<B> extends Object
Manages a map from view service URL marker to client. This is used by the generic view services to ensure the request is mapped to the correct access service in the metadata access server.
  • Constructor Details

    • ViewServiceClientMap

      public ViewServiceClientMap(Class<B> beanClass, String localServerName, String serverName, String serverPlatformURLRoot, AuditLog auditLog, List<ViewServiceConfig> activeViewServices, String serviceName, int maxPageSize)
      Create new clients with no authentication embedded in the HTTP request.
      Parameters:
      beanClass - name of the class to create
      localServerName - name of this server (view server)
      serverName - name of the server to connect to
      serverPlatformURLRoot - the network address of the server running the OMAS REST services
      auditLog - logging destination
      serviceName - local service name
      maxPageSize - maximum number of results supported by this server
    • ViewServiceClientMap

      public ViewServiceClientMap(Class<B> beanClass, String localServerName, String serverName, String serverPlatformURLRoot, String userId, String password, AuditLog auditLog, List<ViewServiceConfig> activeViewServices, String serviceName, int maxPageSize)
      Create new clients that pass userId and password in each HTTP request. This is the userId/password of the calling server. The end user's userId is sent on each request.
      Parameters:
      beanClass - name of the class to create
      localServerName - name of this server (view server)
      serverName - name of the server to connect to
      serverPlatformURLRoot - the network address of the server running the OMAS REST services
      userId - caller's userId embedded in all HTTP requests
      password - caller's userId embedded in all HTTP requests
      maxPageSize - maximum number of results supported by this server
      activeViewServices - which view services are running
      serviceName - local service name
      auditLog - logging destination
  • Method Details

    • getClient

      public B getClient(String viewServiceURLMarker, String methodName) throws InvalidParameterException, PropertyServerException
      Retrieve/create the client for the requested view service.
      Parameters:
      viewServiceURLMarker - url marker from the incoming request
      methodName - calling method
      Returns:
      requested client
      Throws:
      InvalidParameterException - problem initializing the client
      PropertyServerException - problem with the client class
    • handleInvalidBeanClass

      protected void handleInvalidBeanClass(String beanClassName, Exception error, String methodName) throws PropertyServerException
      Throw an exception to indicate that one of the update methods has not been implemented by an OMAS.
      Parameters:
      beanClassName - class name of bean
      error - exception generated when the new bean is created
      methodName - method that is missing
      Throws:
      PropertyServerException - there is a problem in the use of the generic handlers because the converter has been configured with a type of bean that is not a known class