Class OMAGServerPlatformInstanceMap
- java.lang.Object
-
- org.odpi.openmetadata.commonservices.multitenant.OMAGServerPlatformInstanceMap
-
public class OMAGServerPlatformInstanceMap extends Object
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.
-
-
Constructor Summary
Constructors Constructor Description OMAGServerPlatformInstanceMap()Constructor for instances - used by service instances to get access to the platform map
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<String>getActiveServerList(String userId)Return the list of OMAG Servers running in this OMAG Server Platform.List<String>getActiveServiceListForServer(String userId, String serverName)Return the list of services running in an OMAG Server that is running on this OMAG Server Platform.List<RegisteredOMAGService>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.List<String>getKnownServerList(String userId)Return the list of OMAG Servers that have run or are running in this OMAG Server Platform.List<RegisteredOMAGService>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.List<RegisteredOMAGService>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.List<RegisteredOMAGService>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.List<RegisteredOMAGService>getRegisteredGovernanceServices(String userId)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.List<RegisteredOMAGService>getRegisteredIntegrationServices(String userId)Return the list of access services that are registered (supported) in this OMAG Server Platform and can be configured in an integration daemon.List<RegisteredOMAGService>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.DategetServerEndTime(String userId, String serverName)Return the time this server instance last ended (or null if it is still running).List<OMAGServerInstanceHistory>getServerHistory(String userId, String serverName)Return the time this server instance last started.DategetServerStartTime(String userId, String serverName)Return the time this server instance last started.StringgetServerType(String userId, String serverName, String serviceOperationName)Return the type of server.booleanisServerActive(String userId, String serverName)Return whether a particular server is active (running) in the platform.booleanisServerKnown(String userId, String serverName)Return whether a particular server is registered with the platform.voidshutdownServerInstance(String userId, String serverName, String methodName)Shutdown the server instance.OpenMetadataServerSecurityVerifierstartUpServerInstance(String localServerUserId, String serverName, AuditLog auditLog, Connection connection)Start up the server with the requested security.
-
-
-
Method Detail
-
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 server- Returns:
- string name
- Throws:
InvalidParameterException- the serverName is not known.UserNotAuthorizedException- the user is not authorized to issue the request.
-
isServerActive
public boolean isServerActive(String userId, String serverName) throws UserNotAuthorizedException
Return whether a particular server is active (running) in 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.
-
isServerKnown
public boolean isServerKnown(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.
-
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
public List<String> getActiveServerList(String userId) throws UserNotAuthorizedException
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
public List<String> getKnownServerList(String userId) throws UserNotAuthorizedException
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.
-
getActiveServiceListForServer
public List<String> getActiveServiceListForServer(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.
-
-