Class BaseUriFactory

java.lang.Object
com.emc.documentum.rest.http.BaseUriFactory
Direct Known Subclasses:
UriFactory

public class BaseUriFactory extends Object
The URI factory to build resource URIs from templates. To keep query parameters in the URI with some order, SortedMap should be used in the factory method signature This will make URI invariant with same set of query parameters, and will improve client cache eventually
  • Field Details

    • baseUri

      protected final String baseUri
    • formatExt

      protected final String formatExt
    • repositoryUri

      protected final String repositoryUri
    • repositoryName

      protected final String repositoryName
    • validate

      protected final boolean validate
    • INACTIVE_URL

      public static final String INACTIVE_URL
      Dummy value for an inactive URI.
      See Also:
    • NULL_PATH_SEGMENT

      public static final String NULL_PATH_SEGMENT
      Dummy value for the null URI path segment.
      See Also:
  • Constructor Details

    • BaseUriFactory

      public BaseUriFactory(String baseUri, String repositoryName, String formatExtension)
      Constructor
      Parameters:
      baseUri - base URI from BaseUriInfo.getBaseUri()
      repositoryName - repository name
      formatExtension - format extension
    • BaseUriFactory

      public BaseUriFactory(String baseUri, String repositoryName, String formatExtension, boolean validate)
      Constructor
      Parameters:
      baseUri - base URI from BaseUriInfo.getBaseUri()
      repositoryName - repository name
      formatExtension - format extension
      validate - validate uri, if invalidated, the returning URL is "_inactive_url_"
  • Method Details

    • logoutUri

      public String logoutUri()
      Build logout URI
      Returns:
      logout URI
    • isUriHrefTemplate

      public boolean isUriHrefTemplate(String uriTemplateName)
      Check if uriTemplateName is href template
      Parameters:
      uriTemplateName - string to check
      Returns:
      true if uriTemplateName is href template
    • isActiveUrl

      public static boolean isActiveUrl(String url)
      Check if url is active
      Parameters:
      url - URL string
      Returns:
      true if url is active
    • containsNullPathSegments

      public static boolean containsNullPathSegments(String href)
      Check if href contains null path segment built by simple uri template
      Parameters:
      href - URL string
      Returns:
      true if url contains null path segment
    • buildUriByTemplateName

      public String buildUriByTemplateName(String name, Map<String,String> varValueMap)
      Build the URI from the specified template in the custom resource registry file.
      Parameters:
      name - URI template name
      varValueMap - path and query variable value mapping
      Returns:
      built URI
    • buildUriByTemplate

      public String buildUriByTemplate(SimpleUriTemplate template, com.emc.documentum.rest.http.UrlEncodingMethod encoding, Map<String,String> varValueMap)
      Build the URI from the specified template in the custom resource registry file.
      Parameters:
      template - URI template name
      encoding - url encoding method
      varValueMap - path and query variable value mapping
      Returns:
      built URI
    • buildUri

      public String buildUri(SimpleUriTemplate uriTemplate, SortedMap<String,String> params, Object... variables)
      Build URI based on inputs
      Parameters:
      uriTemplate - original URI template
      params - URI parameters
      variables - custom variables
      Returns:
      URI based on inputs
    • buildUriWithRepositoryExt

      public String buildUriWithRepositoryExt(SimpleUriTemplate uriTemplate, SortedMap<String,String> params, Object... variables)
      Build URI with repository and format extension
      Parameters:
      uriTemplate - original URI template
      params - URI parameters
      variables - custom variables
      Returns:
      URI with repository and format extension
    • getRepositoryUri

      protected String getRepositoryUri()
      Get repository URI
      Returns:
      repository URI
    • getFormatExtension

      protected String getFormatExtension()
      Get format extension
      Returns:
      format extension
    • getBaseUri

      protected String getBaseUri()
      Get base uri
      Returns:
      format extension
    • generatePathVarValue

      protected Map<String,String> generatePathVarValue(SimpleUriTemplate simpleUriTemplate, com.emc.documentum.rest.http.UrlEncodingMethod encodingMethod, Map<String,String> varMap)