public class InvalidParameterHandler extends Object
| Constructor and Description |
|---|
InvalidParameterHandler()
Default constructor
|
| Modifier and Type | Method and Description |
|---|---|
int |
getMaxPagingSize()
Get the maximum paging size.
|
void |
handleWrongTypeForGUIDException(String guid,
String methodName,
String actualType,
String expectedType)
Throw an exception if the supplied guid returned an instance of the wrong type
|
void |
setMaxPagingSize(int maxPagingSize)
Override the default maximum paging size.
|
void |
throwCannotDeleteElementInUse(String guid,
String type,
String serviceName,
String methodName)
Throw an exception to indicate that the call to a method is not supported.
|
void |
throwMethodNotSupported(String userId,
String serviceName,
String serverName,
String methodName)
Throw an exception to indicate that the call to a method is not supported.
|
void |
throwUnknownElement(String userId,
String guid,
String type,
String serviceName,
String serverName,
String methodName)
Throw an exception to indicate that the requested element is not recognized.
|
void |
validateAssetInSupportedZone(String assetGUID,
String parameterName,
List<String> assetZones,
List<String> supportedZones,
String serviceName,
String methodName)
Compare the supported zones with the zones stored in the asset.
|
void |
validateConnection(Connection connection,
String parameterName,
String methodName)
Throw an exception if the supplied connection is null
|
void |
validateEnum(Object enumValue,
String parameterName,
String methodName)
Throw an exception if the supplied enum is null
|
void |
validateGUID(String guid,
String guidParameter,
String methodName)
Throw an exception if the supplied userId is null
|
void |
validateInstanceProvenanceForUpdate(String instanceGUID,
String parameterName,
ElementHeader instanceHeader,
ElementOrigin expectedOrigin,
String expectedMetadataCollectionGUID,
String expectedMetadataCollectionName,
String serviceName,
String methodName)
Validate that an instance is from the expected metadata collection.
|
void |
validateName(String name,
String nameParameter,
String methodName)
Throw an exception if the supplied userId is null
|
void |
validateObject(Object object,
String nameParameter,
String methodName)
Throw an exception if the supplied userId is null
|
void |
validateOMAGServerPlatformURL(String omagServerPlatformURL,
String methodName)
Throw an exception if a server URL or has not been supplied.
|
void |
validateOMAGServerPlatformURL(String omagServerPlatformURL,
String serverName,
String methodName)
Throw an exception if a server URL or has not been supplied.
|
int |
validatePaging(int startFrom,
int pageSize,
String methodName)
Throw an exception if the supplied paging values don't make sense.
|
void |
validateSearchString(String searchString,
String searchParameter,
String methodName)
Throw an exception if the supplied userId is null
|
void |
validateStringArray(List<String> stringArray,
String parameterName,
String methodName)
Throw an exception if the supplied array is null or empty
|
void |
validateText(String text,
String parameterName,
String methodName)
Throw an exception if the supplied text field is null
|
String |
validateTypeName(String typeName,
String superTypeName,
String serviceName,
String methodName,
OMRSRepositoryHelper repositoryHelper)
Throw an exception if the supplied type name is not recognized not of the correct subclass
|
void |
validateUserId(String userId,
String methodName)
Throw an exception if the supplied userId is null
|
public void setMaxPagingSize(int maxPagingSize)
maxPagingSize - new valuepublic int getMaxPagingSize()
public void validateOMAGServerPlatformURL(String omagServerPlatformURL, String methodName) throws InvalidParameterException
omagServerPlatformURL - url of the servermethodName - name of the method making the call.InvalidParameterException - the server URL or server name are not setpublic void validateOMAGServerPlatformURL(String omagServerPlatformURL, String serverName, String methodName) throws InvalidParameterException
omagServerPlatformURL - url of the serverserverName - requested servermethodName - name of the method making the call.InvalidParameterException - the server URL or server name are not setpublic 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 void validateGUID(String guid, String guidParameter, String methodName) throws InvalidParameterException
guid - unique identifier to validateguidParameter - name of the parameter that passed the guid.methodName - name of the method making the call.InvalidParameterException - 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 name is nullpublic void validateSearchString(String searchString, String searchParameter, String methodName) throws InvalidParameterException
searchString - searchString to validatesearchParameter - name of the parameter that passed the searchString.methodName - name of the method making the call.InvalidParameterException - the searchString is nullpublic void validateObject(Object object, String nameParameter, String methodName) throws InvalidParameterException
object - object to validatenameParameter - name of the parameter that passed the object.methodName - name of the method making the call.InvalidParameterException - the object is nullpublic 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 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 text is nullpublic int validatePaging(int startFrom,
int pageSize,
String methodName)
throws InvalidParameterException
startFrom - index of the list ot start from (0 for start)pageSize - maximum number of elements to return.methodName - name of the method making the call.InvalidParameterException - the paging options are incorrectpublic void validateStringArray(List<String> stringArray, String parameterName, String methodName) throws InvalidParameterException
stringArray - object to validateparameterName - name of the parameter that passed the array.methodName - name of the method making the call.InvalidParameterException - the array is null or emptypublic void validateConnection(Connection connection, String parameterName, String methodName) throws InvalidParameterException
connection - object to validateparameterName - name of the parameter that passed the connection.methodName - name of the method making the call.InvalidParameterException - the connection is nullpublic String validateTypeName(String typeName, String superTypeName, String serviceName, String methodName, OMRSRepositoryHelper repositoryHelper) throws InvalidParameterException
typeName - name of typesuperTypeName - name of expected supertypeserviceName - calling servicemethodName - calling methodrepositoryHelper - helper class that can return information about typeInvalidParameterException - the type name is not correctpublic void handleWrongTypeForGUIDException(String guid, String methodName, String actualType, String expectedType) throws InvalidParameterException
guid - unique identifier of instancemethodName - name of the method making the call.actualType - type of retrieved instanceexpectedType - type the instance should beInvalidParameterException - the guid is for the wrong type of objectpublic void validateInstanceProvenanceForUpdate(String instanceGUID, String parameterName, ElementHeader instanceHeader, ElementOrigin expectedOrigin, String expectedMetadataCollectionGUID, String expectedMetadataCollectionName, String serviceName, String methodName) throws InvalidParameterException
instanceGUID - unique identifier of the instanceparameterName - name of the parameter tha supplied the instanceinstanceHeader - header of the instanceexpectedOrigin - expected origin (defined by the type of API) - null means anyexpectedMetadataCollectionGUID - unique identifier of expected metadata collection id - null means anyexpectedMetadataCollectionName - unique name of expected metadata collection id - used for error loggingserviceName - name of calling servicemethodName - name of calling methodInvalidParameterException - the metadata collection id or origin is not correctpublic void validateAssetInSupportedZone(String assetGUID, String parameterName, List<String> assetZones, List<String> supportedZones, String serviceName, String methodName) throws InvalidParameterException
assetGUID - unique identifier of the assetparameterName - name of the parameter that passed the asset guidassetZones - list of zone names from the assetsupportedZones - list of zone names supported by the serviceserviceName - calling servicemethodName - calling methodInvalidParameterException - the asset is not in the supported zone.public void throwMethodNotSupported(String userId, String serviceName, String serverName, String methodName) throws InvalidParameterException
userId - user name to validateserviceName - name of called serviceserverName - name of this servermethodName - name of the called method.InvalidParameterException - the method is not supportedpublic void throwUnknownElement(String userId, String guid, String type, String serviceName, String serverName, String methodName) throws InvalidParameterException
userId - user name to validateguid - unique identifier of elementtype - type of elementserviceName - name of called serviceserverName - name of this servermethodName - name of the called method.InvalidParameterException - the element is not knownpublic void throwCannotDeleteElementInUse(String guid, String type, String serviceName, String methodName) throws InvalidParameterException
guid - unique identifier of elementtype - type of elementserviceName - name of called servicemethodName - name of the called method.InvalidParameterException - the guid is in useCopyright © 2018–2020 ODPi. All rights reserved.