public class ErrorHandler extends Object
| Constructor and Description |
|---|
ErrorHandler() |
| Modifier and Type | Method and Description |
|---|---|
static void |
handleClassificationErrorException(ClassificationErrorException e,
String methodName,
String serverName,
String serviceName) |
static void |
handleEntityNotDeletedException(EntityNotDeletedException e,
String methodName,
String serverName,
String serviceName,
String guid)
convert OMRS exception to OMAS Exception
|
static void |
handleEntityNotDeletedException(String guid,
String methodName,
String serverName,
String serviceName)
Entity not deleted
|
static void |
handleEntityNotKnownError(String guid,
String methodName,
String serverName,
String serviceName)
Entity not known
|
static void |
handleEntityProxyOnlyException(EntityProxyOnlyException e,
String methodName,
String serverName,
String serviceName)
convert OMRS exception to OMAS Exception
|
static void |
handleFunctionNotSupportedException(FunctionNotSupportedException e,
String methodName,
String serverName,
String serviceName)
convert OMRS exception to OMAS Exception
|
static void |
handleInvalidParameterException(InvalidParameterException e,
String methodName,
String serverName,
String serviceName)
convert OMRS exception to OMAS Exception
|
static void |
handlePagingErrorException(PagingErrorException e,
String methodName,
String serverName,
String serviceName)
convert OMRS exception to OMAS Exception
|
static void |
handlePropertyErrorException(PropertyErrorException e,
String methodName,
String serverName,
String serviceName)
convert OMRS exception to OMAS Exception
|
static void |
handleRelationshipNotDeletedException(RelationshipNotDeletedException e,
String methodName,
String serverName,
String serviceName,
String guid)
relationship not deleted
|
static void |
handleRelationshipNotKnownException(String guid,
String methodName,
String serverName,
String serviceName)
relationship not known
|
static void |
handleRepositoryError(Throwable error,
String methodName,
String serverName,
String serviceName)
Throw an exception if the respository could not be contacted
|
static void |
handleStatusNotSupportedException(StatusNotSupportedException e,
String methodName,
String serverName,
String serviceName)
status is not known
|
static void |
handleTypeDefNotKnownException(String typeName,
String methodName,
String serverName,
String serviceName)
Invalid type name
convert OMRS exception to OMAS Exception
|
static void |
handleTypeErrorException(TypeErrorException e,
String methodName,
String serverName,
String serviceName)
convert OMRS exception to OMAS Exception
|
static void |
handleUnauthorizedUser(String userId,
String methodName,
String serverName,
String serviceName)
Throw an exception if the supplied userId is not authorized to perform a request
|
static void |
handleUnknownAsset(Throwable error,
String assetGUID,
String methodName,
String serverName,
String serviceName)
Throw an exception if the asset is not known
|
static void |
validateEnum(Object enumValue,
String parameterName,
String methodName)
Throw an exception if the supplied enum is null
|
static void |
validateGUID(String guid,
String parameterName,
String methodName)
Throw an exception if the supplied unique identifier is null
|
static void |
validateName(String name,
String parameterName,
String methodName)
Throw an exception if the supplied name is null
|
static OMRSMetadataCollection |
validateRepositoryConnector(String methodName,
OMRSRepositoryConnector repositoryConnector)
Check that there is a repository connector.
|
static void |
validateText(String text,
String parameterName,
String methodName)
Throw an exception if the supplied text field is null
|
static void |
validateUserId(String userId,
String methodName)
Throw an exception if the supplied userId is null
|
public static void validateUserId(String userId, String methodName) throws InvalidParameterException
userId - - user name to validatemethodName - - name of the method making the call.InvalidParameterException - - the userId is nullpublic static void validateGUID(String guid, String parameterName, String methodName) throws InvalidParameterException
guid - - unique identifier to validateparameterName - - name of the parameter that passed the guid.methodName - - name of the method making the call.InvalidParameterException - - the guid is nullpublic static void validateEnum(Object enumValue, String parameterName, String methodName) throws InvalidParameterException
enumValue - - enum value to validateparameterName - - name of the parameter that passed the enum.methodName - - name of the method making the call.InvalidParameterException - - the enum is nullpublic static void validateName(String name, String parameterName, String methodName) throws InvalidParameterException
name - - unique name to validateparameterName - - name of the parameter that passed the name.methodName - - name of the method making the call.InvalidParameterException - - the guid is nullpublic static void validateText(String text, String parameterName, String methodName) throws InvalidParameterException
text - - unique name to validateparameterName - - name of the parameter that passed the name.methodName - - name of the method making the call.InvalidParameterException - - the guid is nullpublic static OMRSMetadataCollection validateRepositoryConnector(String methodName, OMRSRepositoryConnector repositoryConnector) throws MetadataServerUncontactableException
methodName - - name of the method being calledMetadataServerUncontactableException - - exception thrown if the repository connectorpublic static void handleUnauthorizedUser(String userId, String methodName, String serverName, String serviceName) throws UserNotAuthorizedException
userId - - user name to validatemethodName - - name of the method making the call.serverName - - name of this serverserviceName - - name of this access serviceUserNotAuthorizedException - - the userId is unauthorised for the requestpublic static void handleRepositoryError(Throwable error, String methodName, String serverName, String serviceName) throws MetadataServerUncontactableException
error - - caught exceptionmethodName - - name of the method making the call.serverName - - name of this serverserviceName - - name of this access serviceMetadataServerUncontactableException - - unexpected exception from property serverpublic static void handleUnknownAsset(Throwable error, String assetGUID, String methodName, String serverName, String serviceName) throws InvalidParameterException, UnrecognizedGUIDException
error - - caught exceptionassetGUID - - unique identifier for the requested assetmethodName - - name of the method making the callserverName - - name of this serverserviceName - - name of this access serviceUnrecognizedGUIDException - - unexpected exception from property serverInvalidParameterExceptionpublic static void handleInvalidParameterException(InvalidParameterException e, String methodName, String serverName, String serviceName) throws InvalidParameterException
e - - exception to handlemethodName - serverName - serviceName - InvalidParameterExceptionpublic static void handleTypeDefNotKnownException(String typeName, String methodName, String serverName, String serviceName) throws InvalidParameterException
typeName - methodName - serverName - serviceName - InvalidParameterExceptionpublic static void handlePropertyErrorException(PropertyErrorException e, String methodName, String serverName, String serviceName) throws InvalidParameterException
e - - exception to handlemethodName - serverName - serviceName - InvalidParameterExceptionpublic static void handleClassificationErrorException(ClassificationErrorException e, String methodName, String serverName, String serviceName) throws ClassificationException
e - methodName - serverName - serviceName - ClassificationExceptionpublic static void handleStatusNotSupportedException(StatusNotSupportedException e, String methodName, String serverName, String serviceName) throws StatusNotSupportedException
e - methodName - serverName - serviceName - StatusNotSupportedExceptionpublic static void handleEntityNotKnownError(String guid, String methodName, String serverName, String serviceName) throws UnrecognizedGUIDException
guid - methodName - serverName - serviceName - UnrecognizedGUIDExceptionpublic static void handleEntityProxyOnlyException(EntityProxyOnlyException e, String methodName, String serverName, String serviceName) throws MetadataServerUncontactableException
e - - exception to handlemethodName - serverName - serviceName - MetadataServerUncontactableExceptionpublic static void handleTypeErrorException(TypeErrorException e, String methodName, String serverName, String serviceName) throws InvalidParameterException
e - - exception to handlemethodName - serverName - serviceName - InvalidParameterExceptionpublic static void handleFunctionNotSupportedException(FunctionNotSupportedException e, String methodName, String serverName, String serviceName) throws FunctionNotSupportedException
e - - exception to handlemethodName - serverName - serviceName - FunctionNotSupportedExceptionpublic static void handlePagingErrorException(PagingErrorException e, String methodName, String serverName, String serviceName) throws InvalidParameterException
e - - exception to handlemethodName - serverName - serviceName - InvalidParameterExceptionpublic static void handleEntityNotDeletedException(EntityNotDeletedException e, String methodName, String serverName, String serviceName, String guid) throws GUIDNotPurgedException
e - - exception to handlemethodName - serverName - serviceName - guid - GUIDNotPurgedExceptionpublic static void handleRelationshipNotKnownException(String guid, String methodName, String serverName, String serviceName) throws UnrecognizedGUIDException
guid - methodName - serverName - serviceName - UnrecognizedGUIDExceptionpublic static void handleRelationshipNotDeletedException(RelationshipNotDeletedException e, String methodName, String serverName, String serviceName, String guid) throws GUIDNotPurgedException
e - methodName - serverName - serviceName - guid - GUIDNotPurgedExceptionpublic static void handleEntityNotDeletedException(String guid, String methodName, String serverName, String serviceName) throws GUIDNotPurgedException
guid - methodName - serverName - serviceName - GUIDNotPurgedExceptionCopyright © 2018 ODPi. All rights reserved.