GNDMS 0.6.0
RESTful verison of GNDMS
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes

de.zib.gndms.common.rest.UriFactory Class Reference

A factory for GNDMS-resource URIs. More...

List of all members.

Public Member Functions

 UriFactory ()
 The constructor.
 UriFactory (final String baseUrl)
 The constructor.
final String serviceUri (final Map< String, String > vars)
 Returns the uri for a service, expanding the variables as given in the map.
final String taskFlowUri (final Map< String, String > vars, final String facet)
 Returns the uri for a task flow, expanding the variables as given in the map, followed by the given facet.
final String taskFlowTypeUri (final Map< String, String > vars, final String facet)
 Returns the uri for a task flow type, expanding the variables as given in the map, followed by the given facet.
final String quoteUri (final Map< String, String > urimap)
 Returns the uri for a quote, expanding the variables as given in the map.
final String taskUri (final Map< String, String > urimap, final String facet)
 Returns the uri for a task, expanding the variables as given in the map, followed by the given facet.
final String taskServiceUri (final Map< String, String > urimap)
 Returns the uri for a task service, expanding the variables as given in the map.
final String taskServiceUri (final Map< String, String > urimap, final String facet)
 Returns the uri for a task service, expanding the variables as given in the map, followed by the given facet.
final String subspaceUri (final Map< String, String > vars, final String facet)
 Returns the uri for a subspace, expanding the variables as given in the map, followed by the given facet.
final String sliceKindUri (final Map< String, String > vars, final String facet)
final String sliceUri (final Map< String, String > vars, final String facet)
final String getBaseUrl ()
 Returns the base url.
final void setBaseUrl (final String baseUrl)
 Sets the base url.

Static Public Attributes

static final String SERVICE = "service"
 The key for a service.
static final String TASKFLOW_TYPE = "type"
 The key for a taskflow type.
static final String TASKFLOW_ID = "id"
 The key for a taskflow id.
static final String QUOTE_ID = "idx"
 The key for a quote id.
static final String TASK_ID = "taskId"
 The key for a task ide.
static final String SUBSPACE = "subspace"
 The key for a subspace.
static final String SLICEKIND = "sliceKind"
 The key for a slice kind.
static final String SLICE = "sliceId"
 The key for a slice.

Private Member Functions

void init ()
 Initialization of the templates.
String addFacet (final URI uri, final String facet)
 Add "/" and the name of the given facet to an uri, if this facet is not null.

Private Attributes

String baseUrl
 The base url, something like http://my.host.org/gndms/grid_id.
UriTemplate serviceTemplate
 The template for a service.
UriTemplate taskFlowTemplate
 The template for a task flow.
UriTemplate taskFlowTypeTemplate
 The template for a task flow type.
UriTemplate quoteTemplate
 The template for a quote.
UriTemplate taskTemplate
 The template for a task.
UriTemplate taskServiceTemplate
 The template for a task service.
UriTemplate subspaceTemplate
 The template for a subspace.
UriTemplate sliceKindTemplate
UriTemplate sliceTemplate

Detailed Description

A factory for GNDMS-resource URIs.

Author:
try ma ik jo rr a zib
Date:
03.03.11 18:23 Methods of this class require a map for the path variables and are generating uri templates for different elements.

Constructor & Destructor Documentation

de.zib.gndms.common.rest.UriFactory.UriFactory ( final String  baseUrl)

The constructor.

Parameters:
baseUrlThe base url.

Member Function Documentation

String de.zib.gndms.common.rest.UriFactory.addFacet ( final URI  uri,
final String  facet 
) [private]

Add "/" and the name of the given facet to an uri, if this facet is not null.

Parameters:
uriThe uri.
facetThe facet.
Returns:
The uri followed by the facet.
final String de.zib.gndms.common.rest.UriFactory.getBaseUrl ( )

Returns the base url.

Returns:
The base url.
final String de.zib.gndms.common.rest.UriFactory.quoteUri ( final Map< String, String >  urimap)

Returns the uri for a quote, expanding the variables as given in the map.

Parameters:
urimapA map, which should contain the keys "service", "type", "id", and "idx".
Returns:
The corresponding uri.
final String de.zib.gndms.common.rest.UriFactory.serviceUri ( final Map< String, String >  vars)

Returns the uri for a service, expanding the variables as given in the map.

Parameters:
varsA map, which should contain the key "service".
Returns:
The corresponding uri.
final void de.zib.gndms.common.rest.UriFactory.setBaseUrl ( final String  baseUrl)

Sets the base url.

Parameters:
baseUrlThe base url.
final String de.zib.gndms.common.rest.UriFactory.subspaceUri ( final Map< String, String >  vars,
final String  facet 
)

Returns the uri for a subspace, expanding the variables as given in the map, followed by the given facet.

Parameters:
varsA map, which should contain the keys "service" and "subspace".
facetThe facet.
Returns:
The corresponding uri.
final String de.zib.gndms.common.rest.UriFactory.taskFlowTypeUri ( final Map< String, String >  vars,
final String  facet 
)

Returns the uri for a task flow type, expanding the variables as given in the map, followed by the given facet.

Parameters:
varsA map, which should contain the keys "service" and "type".
facetThe facet.
Returns:
The corresponding uri.
final String de.zib.gndms.common.rest.UriFactory.taskFlowUri ( final Map< String, String >  vars,
final String  facet 
)

Returns the uri for a task flow, expanding the variables as given in the map, followed by the given facet.

Parameters:
varsA map, which should contain the keys "service", "type", and "id".
facetThe facet.
Returns:
The corresponding uri.
final String de.zib.gndms.common.rest.UriFactory.taskServiceUri ( final Map< String, String >  urimap,
final String  facet 
)

Returns the uri for a task service, expanding the variables as given in the map, followed by the given facet.

Parameters:
urimapA map, which should contain the key "service".
facetThe facet.
Returns:
The corresponding uri.
final String de.zib.gndms.common.rest.UriFactory.taskServiceUri ( final Map< String, String >  urimap)

Returns the uri for a task service, expanding the variables as given in the map.

Parameters:
urimapA map, which should contain the key "service".
Returns:
The corresponding uri.
final String de.zib.gndms.common.rest.UriFactory.taskUri ( final Map< String, String >  urimap,
final String  facet 
)

Returns the uri for a task, expanding the variables as given in the map, followed by the given facet.

Parameters:
urimapA map, which should contain the keys "service" and "taskId".
facetThe facet.
Returns:
The corresponding uri.

Member Data Documentation

The base url, something like http://my.host.org/gndms/grid_id.


The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Enumerations