Class OMAGServerServiceInstanceHandler
- java.lang.Object
-
- org.odpi.openmetadata.commonservices.multitenant.OMAGServerServiceInstanceHandler
-
- Direct Known Subclasses:
AuditableServerServiceInstanceHandler
public abstract class OMAGServerServiceInstanceHandler extends Object
OMAGServerServiceInstanceHandler retrieves information from the instance map for an OMAG server service instance. The instance map is thread-safe. Instances are added and removed during server initialization and termination.
-
-
Field Summary
Fields Modifier and Type Field Description protected OMAGServerPlatformInstanceMapplatformInstanceMapprotected StringserviceName
-
Constructor Summary
Constructors Constructor Description OMAGServerServiceInstanceHandler(String serviceName)Constructor passes the service name that is used on all calls to this instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OpenMetadataServerSecurityVerifiergetServerSecurityVerifier(String userId, String serverName)Return the security verifier for the server.protected OMAGServerServiceInstancegetServerServiceInstance(String userId, String serverName, String serviceOperationName)Get the object containing the properties for this server.StringgetServiceName()Return the service's official namebooleanisServerActive(String userId, String serverName)Return whether a particular server is registered with the platform.voidremoveServerServiceInstance(String serverName)Remove the instance for this server.
-
-
-
Field Detail
-
platformInstanceMap
protected OMAGServerPlatformInstanceMap platformInstanceMap
-
serviceName
protected String serviceName
-
-
Constructor Detail
-
OMAGServerServiceInstanceHandler
public OMAGServerServiceInstanceHandler(String serviceName)
Constructor passes the service name that is used on all calls to this instance.- Parameters:
serviceName- unique identifier for this service with a human meaningful value
-
-
Method Detail
-
getServiceName
public String getServiceName()
Return the service's official name- Returns:
- String name
-
isServerActive
public boolean isServerActive(String userId, String serverName) throws UserNotAuthorizedException
Return whether a particular server is registered with the platform. This is used by the admin services when there being no instance is not an error.- Parameters:
userId- calling user or null if it is an anonymous requestserverName- name of the server- Returns:
- boolean
- Throws:
UserNotAuthorizedException- the user is not authorized to issue the request.
-
getServerSecurityVerifier
public OpenMetadataServerSecurityVerifier getServerSecurityVerifier(String userId, String serverName) throws InvalidParameterException
Return the security verifier for the server.- Parameters:
userId- calling user or null if it is an anonymous requestserverName- name of the server- Returns:
- OpenMetadataServerSecurityVerifier object - never null
- Throws:
InvalidParameterException- the server name is not known
-
getServerServiceInstance
protected OMAGServerServiceInstance getServerServiceInstance(String userId, String serverName, String serviceOperationName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Get the object containing the properties for this server.- Parameters:
userId- calling userserverName- name of this serverserviceOperationName- name of the REST API call (typically the top-level methodName)- Returns:
- specific service instance
- Throws:
InvalidParameterException- the server name is not knownUserNotAuthorizedException- the user is not authorized to issue the request.PropertyServerException- the service name is not known - indicating a logic error
-
removeServerServiceInstance
public void removeServerServiceInstance(String serverName)
Remove the instance for this server.- Parameters:
serverName- name of the server
-
-