Package com.emc.documentum.rest.http
Class BaseUriFactory
java.lang.Object
com.emc.documentum.rest.http.BaseUriFactory
- Direct Known Subclasses:
UriFactory
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
-
Constructor Summary
ConstructorDescriptionBaseUriFactory
(String baseUri, String repositoryName, String formatExtension) ConstructorBaseUriFactory
(String baseUri, String repositoryName, String formatExtension, boolean validate) Constructor -
Method Summary
Modifier and TypeMethodDescriptionBuild URI based on inputsbuildUriByTemplate
(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.buildUriByTemplateName
(String name, Map<String, String> varValueMap) Build the URI from the specified template in the custom resource registry file.buildUriWithRepositoryExt
(SimpleUriTemplate uriTemplate, SortedMap<String, String> params, Object... variables) Build URI with repository and format extensionstatic boolean
Check ifhref
contains null path segment built by simple uri templategeneratePathVarValue
(SimpleUriTemplate simpleUriTemplate, com.emc.documentum.rest.http.UrlEncodingMethod encodingMethod, Map<String, String> varMap) protected String
Get base uriprotected String
Get format extensionprotected String
Get repository URIstatic boolean
isActiveUrl
(String url) Check ifurl
is activeboolean
isUriHrefTemplate
(String uriTemplateName) Check ifuriTemplateName
is href templateBuild logout URI
-
Field Details
-
baseUri
-
formatExt
-
repositoryUri
-
repositoryName
-
validate
protected final boolean validate -
INACTIVE_URL
Dummy value for an inactive URI.- See Also:
-
NULL_PATH_SEGMENT
Dummy value for the null URI path segment.- See Also:
-
-
Constructor Details
-
BaseUriFactory
Constructor- Parameters:
baseUri
- base URI fromBaseUriInfo.getBaseUri()
repositoryName
- repository nameformatExtension
- format extension
-
BaseUriFactory
public BaseUriFactory(String baseUri, String repositoryName, String formatExtension, boolean validate) Constructor- Parameters:
baseUri
- base URI fromBaseUriInfo.getBaseUri()
repositoryName
- repository nameformatExtension
- format extensionvalidate
- validate uri, if invalidated, the returning URL is "_inactive_url_"
-
-
Method Details
-
logoutUri
Build logout URI- Returns:
- logout URI
-
isUriHrefTemplate
Check ifuriTemplateName
is href template- Parameters:
uriTemplateName
- string to check- Returns:
true
ifuriTemplateName
is href template
-
isActiveUrl
Check ifurl
is active- Parameters:
url
- URL string- Returns:
true
ifurl
is active
-
containsNullPathSegments
Check ifhref
contains null path segment built by simple uri template- Parameters:
href
- URL string- Returns:
true
ifurl
contains null path segment
-
buildUriByTemplateName
Build the URI from the specified template in the custom resource registry file.- Parameters:
name
- URI template namevarValueMap
- 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 nameencoding
- url encoding methodvarValueMap
- 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 templateparams
- URI parametersvariables
- 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 templateparams
- URI parametersvariables
- custom variables- Returns:
- URI with repository and format extension
-
getRepositoryUri
Get repository URI- Returns:
- repository URI
-
getFormatExtension
Get format extension- Returns:
- format extension
-
getBaseUri
Get base uri- Returns:
- format extension
-
generatePathVarValue
-