Class OMAGServerPlatformInstanceMap
java.lang.Object
org.odpi.openmetadata.commonservices.multitenant.OMAGServerPlatformInstanceMap
OMAGServerPlatformInstanceMap provides part of the mapping for inbound REST requests to the appropriate
service instances for the requested server. It manages the server name to server instance mapping.
The map is maintained in a static, so it is scoped to the class loader.
Instances of this class call the synchronized static methods to work with the map.
Instances of this class call the synchronized static methods to work with the map.
-
Constructor Summary
ConstructorDescriptionConstructor for instances - used by service instances to get access to the platform map -
Method Summary
Modifier and TypeMethodDescriptiongetActiveServerList
(String userId) Return the list of OMAG Servers running in this OMAG Server Platform.getActiveServicesForServer
(String userId, String serverName) Return the list of services running in an OMAG Server that is running on this OMAG Server Platform.getAllRegisteredServices
(String userId) Return the list of services that are registered (supported) in this OMAG Server Platform and can be configured as part of a server.getKnownServerList
(String userId) Return the list of OMAG Servers that have run or are running in this OMAG Server Platform.getRegisteredAccessServices
(String userId) Return the list of access services that are registered (supported) in this OMAG Server Platform and can be configured in a metadata access point or metadata server.getRegisteredCommonServices
(String userId) Return the list of common services that are registered (supported) in this OMAG Server Platform and can be configured as part of a server.getRegisteredEngineServices
(String userId) Return the list of engine services that are registered (supported) in this OMAG Server Platform and can be configured in an engine hosting OMAG server.Return the list of governance services that are registered (supported) in this OMAG Server Platform and can be configured as part of a governance server.Return the list of access services that are registered (supported) in this OMAG Server Platform and can be configured in an integration daemon.getRegisteredViewServices
(String userId) Return the list of view services that are registered (supported) in this OMAG Server Platform and can be configured in a view server.getServerEndTime
(String userId, String serverName) Return the time this server instance last ended (or null if it is still running).getServerHistory
(String userId, String serverName) Return the time this server instance last started.getServerStartTime
(String userId, String serverName) Return the time this server instance last started.getServerStatus
(String userId, String serverName, String serviceOperationName) Return the type of server.getServerType
(String userId, String serverName, String serviceOperationName) Return the type of server.boolean
isServerActive
(String userId, String serverName) Return whether a particular server is active (running) in the platform.boolean
isServerKnown
(String userId, String serverName) Return whether a particular server is registered with the platform.void
shutdownServerInstance
(String userId, String serverName, String methodName) Shutdown the server instance.startUpServerInstance
(String localServerUserId, String serverName, AuditLog auditLog, Connection connection) Start up the server with the requested security.static void
Verify that the calling user is allowed to query the platform services.static void
Check that the calling user is authorized to issue operator requests to the OMAG Server Platform.
-
Constructor Details
-
OMAGServerPlatformInstanceMap
public OMAGServerPlatformInstanceMap()Constructor for instances - used by service instances to get access to the platform map
-
-
Method Details
-
validateUserAsInvestigatorForPlatform
public static void validateUserAsInvestigatorForPlatform(String userId) throws UserNotAuthorizedException Verify that the calling user is allowed to query the platform services.- Parameters:
userId
- calling user- Throws:
UserNotAuthorizedException
- calling user not allowed to use these services
-
validateUserAsOperatorForPlatform
public static void validateUserAsOperatorForPlatform(String userId) throws UserNotAuthorizedException Check that the calling user is authorized to issue operator requests to the OMAG Server Platform.- Parameters:
userId
- calling user- Throws:
UserNotAuthorizedException
- the user is not authorized to issue operator commands to this platform
-
getRegisteredAccessServices
public List<RegisteredOMAGService> getRegisteredAccessServices(String userId) throws UserNotAuthorizedException Return the list of access services that are registered (supported) in this OMAG Server Platform and can be configured in a metadata access point or metadata server.- Parameters:
userId
- calling user- Returns:
- list of access service descriptions
- Throws:
UserNotAuthorizedException
- user not authorized
-
getRegisteredEngineServices
public List<RegisteredOMAGService> getRegisteredEngineServices(String userId) throws UserNotAuthorizedException Return the list of engine services that are registered (supported) in this OMAG Server Platform and can be configured in an engine hosting OMAG server.- Parameters:
userId
- calling user- Returns:
- list of engine service descriptions
- Throws:
UserNotAuthorizedException
- user not authorized
-
getRegisteredIntegrationServices
public List<RegisteredOMAGService> getRegisteredIntegrationServices(String userId) throws UserNotAuthorizedException Return the list of access services that are registered (supported) in this OMAG Server Platform and can be configured in an integration daemon.- Parameters:
userId
- calling user- Returns:
- list of access service descriptions
- Throws:
UserNotAuthorizedException
- user not authorized
-
getRegisteredViewServices
public List<RegisteredOMAGService> getRegisteredViewServices(String userId) throws UserNotAuthorizedException Return the list of view services that are registered (supported) in this OMAG Server Platform and can be configured in a view server.- Parameters:
userId
- calling user- Returns:
- list of view service descriptions
- Throws:
UserNotAuthorizedException
- user not authorized
-
getRegisteredGovernanceServices
public List<RegisteredOMAGService> getRegisteredGovernanceServices(String userId) throws UserNotAuthorizedException Return the list of governance services that are registered (supported) in this OMAG Server Platform and can be configured as part of a governance server.- Parameters:
userId
- calling user- Returns:
- list of governance service descriptions
- Throws:
UserNotAuthorizedException
- user not authorized
-
getRegisteredCommonServices
public List<RegisteredOMAGService> getRegisteredCommonServices(String userId) throws UserNotAuthorizedException Return the list of common services that are registered (supported) in this OMAG Server Platform and can be configured as part of a server.- Parameters:
userId
- calling user- Returns:
- list of service descriptions
- Throws:
UserNotAuthorizedException
- user not authorized
-
getAllRegisteredServices
public List<RegisteredOMAGService> getAllRegisteredServices(String userId) throws UserNotAuthorizedException Return the list of services that are registered (supported) in this OMAG Server Platform and can be configured as part of a server.- Parameters:
userId
- calling user- Returns:
- list of service descriptions
- Throws:
UserNotAuthorizedException
- user not authorized
-
getServerType
public String getServerType(String userId, String serverName, String serviceOperationName) throws InvalidParameterException, UserNotAuthorizedException Return the type of server.- Parameters:
userId
- calling user or null if it is an anonymous requestserverName
- name of the serverserviceOperationName
- name of the calling method/request- Returns:
- string name
- Throws:
InvalidParameterException
- the serverName is not known.UserNotAuthorizedException
- the user is not authorized to issue the request.
-
getServerStatus
public ServerStatus getServerStatus(String userId, String serverName, String serviceOperationName) throws InvalidParameterException, UserNotAuthorizedException Return the type of server.- Parameters:
userId
- calling user or null if it is an anonymous requestserverName
- name of the serverserviceOperationName
- name of the calling method/request- Returns:
- server status
- Throws:
InvalidParameterException
- the serverName is not known.UserNotAuthorizedException
- the user is not authorized to issue the request.
-
isServerActive
Return whether a particular server is active (running) in the platform. This is used by the admin services when 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.
-
isServerKnown
Return whether a particular server is registered with the platform. This is used by the admin services when 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.
-
getServerStartTime
public Date getServerStartTime(String userId, String serverName) throws InvalidParameterException, UserNotAuthorizedException Return the time this server instance last started.- Parameters:
userId
- calling user or null if it is an anonymous requestserverName
- name of the server- Returns:
- start time
- Throws:
InvalidParameterException
- the serverName is not known.UserNotAuthorizedException
- the user is not authorized to issue the request.
-
getServerEndTime
public Date getServerEndTime(String userId, String serverName) throws InvalidParameterException, UserNotAuthorizedException Return the time this server instance last ended (or null if it is still running).- Parameters:
userId
- calling user or null if it is an anonymous requestserverName
- name of the server- Returns:
- end time or null
- Throws:
InvalidParameterException
- the serverName is not known.UserNotAuthorizedException
- the user is not authorized to issue the request.
-
getServerHistory
public List<OMAGServerInstanceHistory> getServerHistory(String userId, String serverName) throws InvalidParameterException, UserNotAuthorizedException Return the time this server instance last started.- Parameters:
userId
- calling user or null if it is an anonymous requestserverName
- name of the server- Returns:
- start time
- Throws:
InvalidParameterException
- the serverName is not known.UserNotAuthorizedException
- the user is not authorized to issue the request.
-
startUpServerInstance
public OpenMetadataServerSecurityVerifier startUpServerInstance(String localServerUserId, String serverName, AuditLog auditLog, Connection connection) throws InvalidParameterException Start up the server with the requested security.- Parameters:
localServerUserId
- userId for local serverserverName
- name of the serverauditLog
- logging destinationconnection
- connection properties for open metadata security connector for server (can be null for no security)- Returns:
- OpenMetadataServerSecurityVerifier object
- Throws:
InvalidParameterException
- the connection is invalid
-
shutdownServerInstance
public void shutdownServerInstance(String userId, String serverName, String methodName) throws InvalidParameterException, PropertyServerException Shutdown the server instance. This is called once all services have been shutdown.- Parameters:
userId
- calling userserverName
- name of the unknown servermethodName
- calling method- Throws:
InvalidParameterException
- server name is not knownPropertyServerException
- server still has active services - logic error
-
getActiveServerList
Return the list of OMAG Servers running in this OMAG Server Platform.- Parameters:
userId
- calling user- Returns:
- list of OMAG server names
- Throws:
UserNotAuthorizedException
- the user is not authorized to issue the request.
-
getKnownServerList
Return the list of OMAG Servers that have run or are running in this OMAG Server Platform.- Parameters:
userId
- calling user- Returns:
- list of OMAG server names
- Throws:
UserNotAuthorizedException
- the user is not authorized to issue the request.
-
getActiveServicesForServer
public List<String> getActiveServicesForServer(String userId, String serverName) throws InvalidParameterException, UserNotAuthorizedException Return the list of services running in an OMAG Server that is running on this OMAG Server Platform.- Parameters:
userId
- calling userserverName
- name of the server- Returns:
- list on OMAG Services
- Throws:
InvalidParameterException
- the server name is not knownUserNotAuthorizedException
- the user is not authorized to issue the request.
-