Package com.emc.documentum.rest.http

# 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 Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final String`
  `baseUri`
  `protected final String`
  `formatExt`
  `static final String`
  `INACTIVE_URL`
  Dummy value for an inactive URI.
  `static final String`
  `NULL_PATH_SEGMENT`
  Dummy value for the null URI path segment.
  `protected final String`
  `repositoryName`
  `protected final String`
  `repositoryUri`
  `protected final boolean`
  `validate`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `BaseUriFactory(String baseUri, String repositoryName, String formatExtension)`
  Constructor
  `BaseUriFactory(String baseUri, String repositoryName, String formatExtension, boolean validate)`
  Constructor

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `buildUri(SimpleUriTemplate uriTemplate, SortedMap<String,String> params, Object... variables)`
  Build URI based on inputs
  `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.
  `String`
  `buildUriByTemplateName(String name, Map<String,String> varValueMap)`
  Build the URI from the specified template in the custom resource registry file.
  `String`
  `buildUriWithRepositoryExt(SimpleUriTemplate uriTemplate, SortedMap<String,String> params, Object... variables)`
  Build URI with repository and format extension
  `static boolean`
  `containsNullPathSegments(String href)`
  Check if `href` contains null path segment built by simple uri template
  `protected Map<String,String>`
  `generatePathVarValue(SimpleUriTemplate simpleUriTemplate, com.emc.documentum.rest.http.UrlEncodingMethod encodingMethod, Map<String,String> varMap)`
  `protected String`
  `getBaseUri()`
  Get base uri
  `protected String`
  `getFormatExtension()`
  Get format extension
  `protected String`
  `getRepositoryUri()`
  Get repository URI
  `static boolean`
  `isActiveUrl(String url)`
  Check if `url` is active
  `boolean`
  `isUriHrefTemplate(String uriTemplateName)`
  Check if `uriTemplateName` is href template
  `String`
  `logoutUri()`
  Build logout URI

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 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:
      - Constant Field Values

  - ### NULL_PATH_SEGMENT

    public static final String NULL_PATH_SEGMENT
    Dummy value for the null URI path segment.
    See Also:
      - Constant Field Values

- ## 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)