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)
Convert the supplied OMRS exception to a Subject Area classification error exception and throw it.
|
static void |
handleEntityNotDeletedException(EntityNotDeletedException e,
String methodName,
String serverName,
String serviceName,
String guid)
Convert the supplied OMRS exception to a Subject Area Entity Not Deleted exception and throw it.
|
static void |
handleEntityNotDeletedException(String guid,
String methodName,
String serverName,
String serviceName)
Convert the supplied OMRS exception to a Subject Area entity not deleted exception and throw it.
|
static void |
handleEntityNotKnownError(String guid,
String methodName,
String serverName,
String serviceName)
Convert the supplied OMRS exception to a Subject Area Entity Not known exception and throw it.
|
static void |
handleEntityNotKnownException(String guid,
String methodName,
String serverName,
String serviceName)
Convert the supplied OMRS exception to a Subject Area Entity not known exception and throw it.
|
void |
handleEntityNotPurgedException(String obsoleteGuid,
String restAPIName,
String serverName,
String serviceName) |
static void |
handleEntityProxyOnlyException(EntityProxyOnlyException e,
String methodName,
String serverName,
String serviceName)
Convert the supplied OMRS exception to a Subject Area Entity Proxy Only exception and throw it.
|
static void |
handleFunctionNotSupportedException(FunctionNotSupportedException e,
String methodName,
String serverName,
String serviceName)
Convert the supplied OMRS exception to a Subject Area Function Not Supported exception and throw it.
|
static void |
handleInvalidParameterException(InvalidParameterException e,
String methodName,
String serverName,
String serviceName)
Throw an Invalid Parameter exception
|
void |
handleMetadataServerUnContactable(MetadataServerUncontactableException e,
String methodName,
String serverName,
String serviceName)
Convert the supplied OMRS exception to a Subject Area metadata server not reachable exception and throw it.
|
static void |
handlePagingErrorException(PagingErrorException e,
String methodName,
String serverName,
String serviceName)
Convert the supplied OMRS exception to a Subject Area paging error exception and throw it.
|
static void |
handlePropertyErrorException(PropertyErrorException e,
String methodName,
String serverName,
String serviceName)
Convert the supplied OMRS exception to a Subject Area property error exception and throw it.
|
static void |
handleRelationshipNotDeletedException(String guid,
String methodName,
String serverName,
String serviceName)
Convert the supplied OMRS exception to a Subject Area relationship not deleted exception and throw it.
|
static void |
handleRelationshipNotKnownException(String guid,
String methodName,
String serverName,
String serviceName)
Convert the supplied OMRS exception to a Subject Area relationship not known exception and throw it.
|
void |
handleRelationshipNotPurgedException(String obsoleteGuid,
String restAPIName,
String serverName,
String serviceName) |
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)
Convert the supplied OMRS exception to a Subject Area status not known exception and throw it.
|
static void |
handleTypeDefNotKnownException(String typeName,
String methodName,
String serverName,
String serviceName)
Convert the supplied OMRS exception to a Subject Area invalid type name exception and throw it.
|
static void |
handleTypeErrorException(TypeErrorException e,
String methodName,
String serverName,
String serviceName)
Convert the supplied OMRS exception to a Subject Area type error exception and throw it.
|
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 - supplied 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 calledrepositoryConnector - connector to the repositoryMetadataServerUncontactableException - exception thrown if the metadata server cannot be reachedpublic 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 server 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 server name of this serverserviceName - name of this access serviceMetadataServerUncontactableException - the metadata server cannot be reachedpublic static void handleUnknownAsset(Throwable error, String assetGUID, String methodName, String serverName, String serviceName) throws UnrecognizedGUIDException
error - caught exceptionassetGUID - unique identifier for the requested assetmethodName - name of the method making the callserverName - name of this server name of this serverserviceName - name of this access serviceUnrecognizedGUIDException - unexpected exception from property serverpublic static void handleInvalidParameterException(InvalidParameterException e, String methodName, String serverName, String serviceName) throws InvalidParameterException
e - exception to handlemethodName - name of the method making the call.serverName - name of this serverserviceName - name of this access serviceInvalidParameterException - a parameter is not valid or missing.public static void handleTypeDefNotKnownException(String typeName, String methodName, String serverName, String serviceName) throws InvalidParameterException
typeName - the name of the unknown typemethodName - name of the method making the call.serverName - name of this serverserviceName - access service nameInvalidParameterException - a parameter is not valid or missing.public static void handlePropertyErrorException(PropertyErrorException e, String methodName, String serverName, String serviceName) throws InvalidParameterException
e - exception to handlemethodName - name of the method making the call.serverName - name of this serverserviceName - name of this access serviceInvalidParameterException - a parameter is not valid or missing.public static void handleClassificationErrorException(ClassificationErrorException e, String methodName, String serverName, String serviceName) throws ClassificationException
e - exception to handlemethodName - name of the method making the call.serverName - name of this serverserviceName - name of this access serviceClassificationException - error occured during a classificationpublic static void handleStatusNotSupportedException(StatusNotSupportedException e, String methodName, String serverName, String serviceName) throws StatusNotSupportedException
e - exception to handlemethodName - name of the method making the call.serverName - name of this serverserviceName - name of this access serviceStatusNotSupportedException - staus not supportedpublic static void handleEntityNotKnownError(String guid, String methodName, String serverName, String serviceName) throws UnrecognizedGUIDException
guid - supplied guidmethodName - name of the method making the call.serverName - name of this serverserviceName - name of this access serviceUnrecognizedGUIDException - unrecognized GUIDpublic static void handleEntityProxyOnlyException(EntityProxyOnlyException e, String methodName, String serverName, String serviceName) throws MetadataServerUncontactableException
e - exception to handlemethodName - name of the method making the call.serverName - name of this serverserviceName - name of this access serviceMetadataServerUncontactableException - the metadata server cannot be reachedpublic static void handleTypeErrorException(TypeErrorException e, String methodName, String serverName, String serviceName) throws InvalidParameterException
e - exception to handlemethodName - name of the method making the call.serverName - name of this serverserviceName - name of this access serviceInvalidParameterException - a parameter is not valid or missing.public static void handleFunctionNotSupportedException(FunctionNotSupportedException e, String methodName, String serverName, String serviceName) throws FunctionNotSupportedException
e - exception to handlemethodName - name of the method making the call.serverName - name of this serverserviceName - name of this access serviceFunctionNotSupportedException - Function not supportedpublic static void handlePagingErrorException(PagingErrorException e, String methodName, String serverName, String serviceName) throws InvalidParameterException
e - exception to handlemethodName - name of the method making the call.serverName - name of this serverserviceName - name of this access serviceInvalidParameterException - a parameter is not valid or missing.public static void handleEntityNotDeletedException(EntityNotDeletedException e, String methodName, String serverName, String serviceName, String guid) throws GUIDNotPurgedException
e - exception to handlemethodName - name of the method making the call.serverName - name of this serverserviceName - name of this access serviceguid - supplied guidGUIDNotPurgedException - Entity not deletedpublic static void handleRelationshipNotKnownException(String guid, String methodName, String serverName, String serviceName) throws UnrecognizedGUIDException
guid - supplied guidmethodName - name of the method making the call.serverName - name of this serverserviceName - name of this access serviceUnrecognizedGUIDException - GUID not recognizedpublic static void handleEntityNotKnownException(String guid, String methodName, String serverName, String serviceName) throws UnrecognizedGUIDException
guid - supplied guidmethodName - name of the method making the call.serverName - name of this serverserviceName - name of this access serviceUnrecognizedGUIDException - GUID not recognizedpublic static void handleEntityNotDeletedException(String guid, String methodName, String serverName, String serviceName) throws GUIDNotDeletedException
guid - supplied guidmethodName - name of the method making the call.serverName - name of this serverserviceName - name of this access serviceGUIDNotDeletedException - Relationship not purgedpublic static void handleRelationshipNotDeletedException(String guid, String methodName, String serverName, String serviceName) throws GUIDNotDeletedException
guid - supplied guidmethodName - name of the method making the call.serverName - name of this serverserviceName - name of this access serviceGUIDNotDeletedException - Relationship not purgedpublic void handleMetadataServerUnContactable(MetadataServerUncontactableException e, String methodName, String serverName, String serviceName) throws MetadataServerUncontactableException
e - exception to handlemethodName - name of the method making the call.serverName - name of this serverserviceName - name of this access serviceMetadataServerUncontactableException - the metadata server cannot be reachedpublic void handleEntityNotPurgedException(String obsoleteGuid, String restAPIName, String serverName, String serviceName) throws GUIDNotPurgedException
GUIDNotPurgedExceptionpublic void handleRelationshipNotPurgedException(String obsoleteGuid, String restAPIName, String serverName, String serviceName) throws GUIDNotPurgedException
GUIDNotPurgedExceptionCopyright © 2018–2019 ODPi. All rights reserved.