Class InputValidator
java.lang.Object
org.odpi.openmetadata.accessservices.subjectarea.validators.InputValidator
Methods used for rest API input validation
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
validateGUIDNotNull
(String className, String actionDescription, String guid, String guidParameter) Throw an exception if the supplied userId is nullstatic void
validateNameNotNull
(String className, String actionDescription, String name, String nameParameter) Throw an exception if the supplied userId is nullstatic void
validateNodeType
(Object... args) static void
validateRemoteServerNameNotNull
(String className, String actionDescription, String omasServerName) Throw an exception if the metadata server Name (which comes from the configuration has not been supplied on the constructor.static void
validateRemoteServerURLNotNull
(String className, String actionDescription, String omasServerURL) Throw an exception if the metadata server URL (which comes from the configuration has not been supplied on the constructor.static Status
validateStatusAndCheckNotDeleted
(String className, String actionDescription, String statusName) Validate the supplied string can be converted to a Status and return that status.static void
validateUserIdNotNull
(String className, String actionDescription, String userId) Throw an exception if the supplied userId is null
-
Constructor Details
-
InputValidator
public InputValidator()
-
-
Method Details
-
validateRemoteServerURLNotNull
public static void validateRemoteServerURLNotNull(String className, String actionDescription, String omasServerURL) throws InvalidParameterException Throw an exception if the metadata server URL (which comes from the configuration has not been supplied on the constructor.- Parameters:
className
- - name of the class making the call.actionDescription
- - action descriptionomasServerURL
- - metadata server url.- Throws:
InvalidParameterException
- - the org.odpi.openmetadata.accessservices.subjectarea.server URL is not set
-
validateRemoteServerNameNotNull
public static void validateRemoteServerNameNotNull(String className, String actionDescription, String omasServerName) throws InvalidParameterException Throw an exception if the metadata server Name (which comes from the configuration has not been supplied on the constructor.- Parameters:
className
- - name of the class making the call.actionDescription
- - action descriptionomasServerName
- - metadata server name- Throws:
InvalidParameterException
- - the org.odpi.openmetadata.accessservices.subjectarea.server URL is not set
-
validateUserIdNotNull
public static void validateUserIdNotNull(String className, String actionDescription, String userId) throws InvalidParameterException Throw an exception if the supplied userId is null- Parameters:
className
- name of the classactionDescription
- - action descriptionuserId
- user name to validate- Throws:
InvalidParameterException
- the userId is null
-
validateStatusAndCheckNotDeleted
public static Status validateStatusAndCheckNotDeleted(String className, String actionDescription, String statusName) throws InvalidParameterException Validate the supplied string can be converted to a Status and return that status. If it cannot be converted then null is returned.- Parameters:
className
- - name of the class making the call.actionDescription
- - name of the method making the call.statusName
- - the String name to convert to a Status- Returns:
- Status or null.
- Throws:
InvalidParameterException
- invalid status
-
validateGUIDNotNull
public static void validateGUIDNotNull(String className, String actionDescription, String guid, String guidParameter) throws InvalidParameterException Throw an exception if the supplied userId is null- Parameters:
className
- - name of the class making the call.actionDescription
- - name of the method making the call.guid
- - unique identifier to validateguidParameter
- - name of the parameter that passed the userId- Throws:
InvalidParameterException
- - the userId is null
-
validateNameNotNull
public static void validateNameNotNull(String className, String actionDescription, String name, String nameParameter) throws InvalidParameterException Throw an exception if the supplied userId is null- Parameters:
className
- - name of the class making the call.actionDescription
- - name of the method making the call.name
- - unique name to validatenameParameter
- - name of the parameter that passed the name.- Throws:
InvalidParameterException
- - the userId is null
-
validateNodeType
- Throws:
InvalidParameterException
-