Class OMAGServerErrorHandler
java.lang.Object
org.odpi.openmetadata.adminservices.server.OMAGServerErrorHandler
OMAGServerErrorHandler provides common error handling routines for the admin services
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
validateFileName
(String fileName, String serverName, String methodName) Validate that the file name is not null.void
validateOMAGServerName
(String omagServerName, String serverName, String serverService) Validate that the server name of the server where an access service resides is not null.void
validatePlatformConnection
(Connection connection, String methodName) Validate that the connection is not null.void
validatePropertyNotNull
(Object property, String propertyName, String serverName, String methodName) Validate that an essential OMAG server configuration property has been set.void
validateServerConnection
(Connection connection, String serverName, String methodName) Validate that the connection is not null.void
validateServerName
(String serverName, String methodName) Validate that the server name is not null and save it in the config.void
validateServiceURLMarker
(String serviceURLMarker, String serverName, String serverService) Validate that the server name of the server where an access service resides is not null.void
validateUserId
(String userId, String serverName, String methodName) Validate that the user id is not null.
-
Constructor Details
-
OMAGServerErrorHandler
public OMAGServerErrorHandler()Default constructor
-
-
Method Details
-
validateUserId
public void validateUserId(String userId, String serverName, String methodName) throws OMAGNotAuthorizedException Validate that the user id is not null.- Parameters:
userId
- user name passed on the requestserverName
- name of this servermethodName
- method receiving the call- Throws:
OMAGNotAuthorizedException
- no userId provided
-
validateServerName
public void validateServerName(String serverName, String methodName) throws OMAGInvalidParameterException Validate that the server name is not null and save it in the config.- Parameters:
serverName
- serverName passed on a requestmethodName
- method being called- Throws:
OMAGInvalidParameterException
- null server name
-
validateFileName
public void validateFileName(String fileName, String serverName, String methodName) throws OMAGInvalidParameterException Validate that the file name is not null.- Parameters:
fileName
- fileName passed on the requestserverName
- server name for this servermethodName
- method called- Throws:
OMAGInvalidParameterException
- the cohort name is null
-
validateServerConnection
public void validateServerConnection(Connection connection, String serverName, String methodName) throws OMAGInvalidParameterException Validate that the connection is not null. This is used for server specific requests- Parameters:
connection
- connection passed on the requestserverName
- server name for this servermethodName
- method called- Throws:
OMAGInvalidParameterException
- the connection is null
-
validatePlatformConnection
public void validatePlatformConnection(Connection connection, String methodName) throws OMAGInvalidParameterException Validate that the connection is not null. This is used for OMAG Platform Requests- Parameters:
connection
- connection passed on the requestmethodName
- method called- Throws:
OMAGInvalidParameterException
- the connection is null
-
validatePropertyNotNull
public void validatePropertyNotNull(Object property, String propertyName, String serverName, String methodName) throws OMAGInvalidParameterException Validate that an essential OMAG server configuration property has been set.- Parameters:
property
- The property that should be present in the OMAG server configuration.propertyName
- The name of the property that should be present in the OMAG server configuration.serverName
- server name for this server.methodName
- method called.- Throws:
OMAGInvalidParameterException
- The property is null.
-
validateOMAGServerName
public void validateOMAGServerName(String omagServerName, String serverName, String serverService) throws OMAGInvalidParameterException Validate that the server name of the server where an access service resides is not null.- Parameters:
omagServerName
- remote server name passed on the requestserverName
- server name for this serverserverService
- name of the service being configured- Throws:
OMAGInvalidParameterException
- the name is null
-
validateServiceURLMarker
public void validateServiceURLMarker(String serviceURLMarker, String serverName, String serverService) throws OMAGInvalidParameterException Validate that the server name of the server where an access service resides is not null.- Parameters:
serviceURLMarker
- remote server name passed on the requestserverName
- server name for this serverserverService
- name of the service being configured- Throws:
OMAGInvalidParameterException
- the name is null
-