Class StreamValidator

java.lang.Object
dev.galasa.framework.api.common.resources.StreamValidator

public class StreamValidator extends Object
Common validator for stream-related validation logic. Provides reusable validation methods for stream names, URLs, and OBR fields.
  • Field Details

  • Constructor Details

    • StreamValidator

      public StreamValidator()
  • Method Details

    • validateStreamName

      public void validateStreamName(String streamName) throws InternalServletException
      Throws:
      InternalServletException
    • validateUrl

      public void validateUrl(String fieldName, String urlToCheck) throws InternalServletException
      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

      public void validateObrs(StreamOBRData[] obrs, boolean isRequired) throws InternalServletException
      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

      public void validateObr(StreamOBRData obr) throws InternalServletException
      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