Class StreamValidator
java.lang.Object
dev.galasa.framework.api.common.resources.StreamValidator
Common validator for stream-related validation logic.
Provides reusable validation methods for stream names, URLs, and OBR fields.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvalidateObr(StreamOBRData obr) Validates a single OBR object.voidvalidateObrs(StreamOBRData[] obrs, boolean isRequired) Validates an array of OBRs.voidvalidateRepositoryUrl(String repositoryUrl, boolean isRequired) Validates a repository URL field.voidvalidateStreamName(String streamName) voidvalidateTestCatalogUrl(String testCatalogUrl, boolean isRequired) Validates a test catalog URL field.voidvalidateUrl(String fieldName, String urlToCheck) Validates that a URL string is a valid, well-formed URL.
-
Field Details
-
OBR_VERSION_KEY
- See Also:
-
OBR_ARTIFACT_ID_KEY
- See Also:
-
OBR_GROUP_ID_KEY
- See Also:
-
MAVEN_REPOSITORY_KEY
- See Also:
-
TESTCATALOG_KEY
- See Also:
-
OBRS_KEY
- See Also:
-
-
Constructor Details
-
StreamValidator
public StreamValidator()
-
-
Method Details
-
validateStreamName
- Throws:
InternalServletException
-
validateUrl
Validates that a URL string is a valid, well-formed URL.- Parameters:
fieldName- the name of the field being validated (for error messages)urlToCheck- the URL string to validate- Throws:
InternalServletException- if the URL is invalid
-
validateRepositoryUrl
public void validateRepositoryUrl(String repositoryUrl, boolean isRequired) throws InternalServletException Validates a repository URL field.- Parameters:
repositoryUrl- the repository URL to validate (can be null for update requests)isRequired- whether the field is required (true for create, false for update)- Throws:
InternalServletException- if validation fails
-
validateTestCatalogUrl
public void validateTestCatalogUrl(String testCatalogUrl, boolean isRequired) throws InternalServletException Validates a test catalog URL field.- Parameters:
testCatalogUrl- the test catalog URL to validate (can be null for update requests)isRequired- whether the field is required (true for create, false for update)- Throws:
InternalServletException- if validation fails
-
validateObrs
Validates an array of OBRs. Checks that the array is not null (if required), not empty, and each OBR is valid.- Parameters:
obrs- the array of OBRs to validate (can be null for update requests)isRequired- whether the field is required (true for create, false for update)- Throws:
InternalServletException- if validation fails
-
validateObr
Validates a single OBR object. Checks that groupId, artifactId, and version are all present.- Parameters:
obr- the OBR to validate- Throws:
InternalServletException- if validation fails
-