public class RepositoryErrorHandler extends Object
| Constructor and Description |
|---|
RepositoryErrorHandler(OMRSRepositoryHelper repositoryHelper,
String serviceName,
String serverName)
Typical constructor providing access to the repository connector for this access service.
|
| Modifier and Type | Method and Description |
|---|---|
void |
handleAmbiguousEntityName(String name,
String nameParameterName,
String entityTypeName,
List<EntityDetail> returnedEntities,
String methodName)
Throw an exception if multiple relationships are returned when not expected.
|
void |
handleAmbiguousRelationships(String entityGUID,
String entityTypeName,
String relationshipTypeName,
List<Relationship> returnedRelationships,
String methodName)
Throw an exception if multiple relationships are returned when not expected.
|
void |
handleEntityProxy(Throwable error,
String entityGUID,
String entityTypeName,
String methodName,
String guidParameterName)
Throw an exception if there is a problem with the asset guid
|
void |
handleNoEntity(String entityTypeGUID,
String entityTypeName,
InstanceProperties properties,
String methodName)
Throw an exception if it is not possible to update an entity.
|
void |
handleNoEntityForClassification(String entityGUID,
String classificationTypeGUID,
String classificationTypeName,
InstanceProperties properties,
String methodName)
Throw an exception if it is not possible to update an entity.
|
void |
handleNoRelationship(String entityGUID,
String entityTypeName,
String relationshipTypeName,
String methodName)
Throw an exception if no relationships are returned when not expected.
|
void |
handleRepositoryError(Throwable error,
String methodName)
Throw an exception if an unexpected repository error is received
|
void |
handleUnauthorizedUser(String userId,
String methodName)
Throw an exception if the supplied userId is not authorized to perform a request
|
void |
handleUnknownEntity(Throwable error,
String entityGUID,
String entityTypeName,
String methodName,
String guidParameterName)
Throw an exception if there is a problem with the asset guid
|
void |
handleUnsupportedProperty(Throwable error,
String methodName,
String propertyName)
Throw an exception if the supplied userId is not authorized to perform a request
|
void |
validateRepositoryConnector(OMRSRepositoryConnector repositoryConnector,
String methodName)
Check that there is a repository connector.
|
public RepositoryErrorHandler(OMRSRepositoryHelper repositoryHelper, String serviceName, String serverName)
repositoryHelper - access to the repository helper.serviceName - name of this access serviceserverName - name of this serverpublic void validateRepositoryConnector(OMRSRepositoryConnector repositoryConnector, String methodName) throws PropertyServerException
methodName - name of the method being calledrepositoryConnector - connector objectPropertyServerException - exception thrown if the repository connectorpublic void handleUnauthorizedUser(String userId, String methodName) throws UserNotAuthorizedException
userId - user name to validatemethodName - name of the method making the call.UserNotAuthorizedException - the userId is unauthorised for the requestpublic void handleUnsupportedProperty(Throwable error, String methodName, String propertyName) throws InvalidParameterException
error - caught exceptionmethodName - name of the method making the callpropertyName - name of the property in errorInvalidParameterException - invalid propertypublic void handleRepositoryError(Throwable error, String methodName) throws PropertyServerException
error - caught exceptionmethodName - name of the method making the call.PropertyServerException - unexpected exception from property serverpublic void handleUnknownEntity(Throwable error, String entityGUID, String entityTypeName, String methodName, String guidParameterName) throws InvalidParameterException
error - caught exceptionentityGUID - unique identifier for the requested entityentityTypeName - expected type of assetmethodName - name of the method making the callguidParameterName - name of the parameter that passed the GUID.InvalidParameterException - unexpected exception from property serverpublic void handleEntityProxy(Throwable error, String entityGUID, String entityTypeName, String methodName, String guidParameterName) throws InvalidParameterException
error - caught exceptionentityGUID - unique identifier for the requested entityentityTypeName - expected type of assetmethodName - name of the method making the callguidParameterName - name of the parameter that passed the GUID.InvalidParameterException - unexpected exception from property serverpublic void handleAmbiguousRelationships(String entityGUID, String entityTypeName, String relationshipTypeName, List<Relationship> returnedRelationships, String methodName) throws PropertyServerException
entityGUID - unique identifier for the anchor entityentityTypeName - name of the entity's typerelationshipTypeName - expected type of relationshipreturnedRelationships - list of relationships returnedmethodName - name of the method making the callPropertyServerException - unexpected response from property serverpublic void handleAmbiguousEntityName(String name, String nameParameterName, String entityTypeName, List<EntityDetail> returnedEntities, String methodName) throws PropertyServerException
name - requested name for the entitynameParameterName - name of hte parameterentityTypeName - name of the entity's typereturnedEntities - list of entities returnedmethodName - name of the method making the callPropertyServerException - unexpected response from property serverpublic void handleNoRelationship(String entityGUID, String entityTypeName, String relationshipTypeName, String methodName) throws PropertyServerException
entityGUID - unique identifier for the anchor entityentityTypeName - name of the entity's typerelationshipTypeName - expected type of relationshipmethodName - name of the method making the callPropertyServerException - unexpected response from property serverpublic void handleNoEntity(String entityTypeGUID, String entityTypeName, InstanceProperties properties, String methodName) throws PropertyServerException
entityTypeGUID - unique identifier for the entity's typeentityTypeName - name of the entity's typeproperties - propertiesmethodName - name of the method making the callPropertyServerException - unexpected response from property serverpublic void handleNoEntityForClassification(String entityGUID, String classificationTypeGUID, String classificationTypeName, InstanceProperties properties, String methodName) throws PropertyServerException
entityGUID - unique identifier of entityclassificationTypeGUID - unique identifier for the classification's typeclassificationTypeName - name of the classification's typeproperties - propertiesmethodName - name of the method making the callPropertyServerException - unexpected response from property serverCopyright © 2018–2020 ODPi. All rights reserved.