public class GovernanceProgramExceptionHandler extends Object
| Constructor and Description |
|---|
GovernanceProgramExceptionHandler(String newServerURL)
Create a new GovernanceProgramExceptionHandler.
|
| Modifier and Type | Method and Description |
|---|---|
void |
detectAndThrowAppointmentIdNotUniqueException(String methodName,
GovernanceProgramOMASAPIResponse restResult)
Throw an AppointmentIdNotUniqueException if it is encoded in the REST response.
|
void |
detectAndThrowEmployeeNumberNotUniqueException(String methodName,
GovernanceProgramOMASAPIResponse restResult)
Throw an EmployeeNumberNotUniqueException if it is encoded in the REST response.
|
void |
detectAndThrowInvalidParameterException(String methodName,
GovernanceProgramOMASAPIResponse restResult)
Throw an InvalidParameterException if it is encoded in the REST response.
|
void |
detectAndThrowPropertyServerException(String methodName,
GovernanceProgramOMASAPIResponse restResult)
Throw an PropertyServerException if it is encoded in the REST response.
|
void |
detectAndThrowUnrecognizedGUIDException(String methodName,
GovernanceProgramOMASAPIResponse restResult)
Throw an UnrecognizedGUIDException if it is encoded in the REST response.
|
void |
detectAndThrowUserNotAuthorizedException(String methodName,
GovernanceProgramOMASAPIResponse restResult)
Throw an UserNotAuthorizedException if it is encoded in the REST response.
|
void |
handleRESTRequestFailure(String methodName,
Throwable error)
Handles a failed REST call.
|
void |
validateGovernanceDomain(GovernanceDomain governanceDomain,
String nameParameter,
String methodName)
Throw an exception if the supplied GovernanceDomain enum is null
|
void |
validateGUID(String guid,
String guidParameter,
String expectedTypeName,
String methodName)
Throw an exception if the supplied guid is null
|
void |
validateName(String name,
String nameParameter,
String methodName)
Throw an exception if the supplied name is null
|
void |
validateOMASServerURL(String methodName)
Throw an exception if a server URL has not been supplied on the constructor.
|
void |
validateUserId(String userId,
String methodName)
Throw an exception if the supplied userId is null
|
public GovernanceProgramExceptionHandler(String newServerURL)
newServerURL - - the network address of the server running the OMAS REST servicespublic void validateOMASServerURL(String methodName) throws PropertyServerException
methodName - - name of the method making the call.PropertyServerException - the server URL is not setpublic void validateUserId(String userId, String methodName) throws UserNotAuthorizedException
userId - - user name to validatemethodName - - name of the method making the call.UserNotAuthorizedException - the userId is nullpublic void validateGUID(String guid, String guidParameter, String expectedTypeName, String methodName) throws UnrecognizedGUIDException
guid - - unique identifier to validateguidParameter - - name of the parameter that passed the guid.methodName - - name of the method making the call.UnrecognizedGUIDException - the guid is nullpublic void validateName(String name, String nameParameter, String methodName) throws InvalidParameterException
name - - unique name to validatenameParameter - - name of the parameter that passed the name.methodName - - name of the method making the call.InvalidParameterException - the guid is nullpublic void validateGovernanceDomain(GovernanceDomain governanceDomain, String nameParameter, String methodName) throws InvalidParameterException
governanceDomain - domain enum to validatenameParameter - - name of the parameter that passed the name.methodName - - name of the method making the call.InvalidParameterException - the guid is nullpublic void detectAndThrowUnrecognizedGUIDException(String methodName, GovernanceProgramOMASAPIResponse restResult) throws UnrecognizedGUIDException
methodName - name of the method calledrestResult - response from the rest call. This generated in the remote server.UnrecognizedGUIDException - encoded exception from the serverpublic void detectAndThrowInvalidParameterException(String methodName, GovernanceProgramOMASAPIResponse restResult) throws InvalidParameterException
methodName - name of the method calledrestResult - response from the rest call. This generated in the remote server.InvalidParameterException - encoded exception from the serverpublic void detectAndThrowEmployeeNumberNotUniqueException(String methodName, GovernanceProgramOMASAPIResponse restResult) throws EmployeeNumberNotUniqueException
methodName - name of the method calledrestResult - response from the rest call. This generated in the remote server.EmployeeNumberNotUniqueException - encoded exception from the serverpublic void detectAndThrowAppointmentIdNotUniqueException(String methodName, GovernanceProgramOMASAPIResponse restResult) throws AppointmentIdNotUniqueException
methodName - name of the method calledrestResult - response from the rest call. This generated in the remote server.AppointmentIdNotUniqueException - encoded exception from the serverpublic void detectAndThrowPropertyServerException(String methodName, GovernanceProgramOMASAPIResponse restResult) throws PropertyServerException
methodName - name of the method calledrestResult - response from the rest call. This generated in the remote server.PropertyServerException - encoded exception from the serverpublic void detectAndThrowUserNotAuthorizedException(String methodName, GovernanceProgramOMASAPIResponse restResult) throws UserNotAuthorizedException
methodName - name of the method calledrestResult - response from UserNotAuthorizedException encoded exception from the serverUserNotAuthorizedExceptionpublic void handleRESTRequestFailure(String methodName, Throwable error) throws PropertyServerException
methodName - the name of the method issuing the call.error - the exception that was returned from the REST call.PropertyServerException - the exception that will wrap the original exceptionCopyright © 2017–2018 ODPi. All rights reserved.