com.fatwire.cs.core.uri
Interface Assembler

All Known Implementing Classes:
AbstractAssembler, QueryAsPathInfoAssembler, QueryAssembler, SatelliteTokenAssembler

public interface Assembler

This interface defines the component that converts a Definition to a URI, and converts a URI back into a Definition. Implementations are able to define the structure of their URI in any way allowed, provided that the rules of this interface are followed.

While it is not guaranteed that for a given Definition def and a given Assembler ua, that ua.assemble(def).equals(ua.assemble(ua.disassemble(ua.assemble(def)))), it is required that the arguments of a Definition passed into the assemble method will be identical to the arguments returned when the uri is disassembled.

Since:
12-Oct-2004 5:13:15 PM

Field Summary
static java.lang.String LOG_NAME
          Logger name, for use with Jakarta Commons Logging.
static java.lang.String PROP_PATH_PREFIX
          Property name prefix.
static java.lang.String PROP_URIBASE_BLOB_SERVER
          Property name for the Blob Server app's uri path
static java.lang.String PROP_URIBASE_CACHE_SERVER
          Property name for the Cache Server app's uri path
static java.lang.String PROP_URIBASE_CATALOG_MANAGER
          Property name for the Catalog Manager app's uri path
static java.lang.String PROP_URIBASE_CONTENT_SERVER
          Property name for the Content Server app's uri path
static java.lang.String PROP_URIBASE_COOKIE_SERVER
          Property name for the Cookie Server app's uri path
static java.lang.String PROP_URIBASE_DISPATCH_MANAGER
          Property name for the Dispatch Manager app's uri path
static java.lang.String PROP_URIBASE_PAGE_DISPATCH_SERVER
          Property name for the Page Dispatch Server app's uri path
static java.lang.String PROP_URIBASE_SATELLITE_SERVER
          Property name for the Satellite Server servlet's uri path.
static java.lang.String PROP_URIBASE_SEED_DISPATCH_SERVER
          Property name for the Seed Dispatch Server app's uri path
static java.lang.String PROP_URIBASE_SYNC_SEED_DISPATCH_SERVER
          Property name for the Sync Seed Dispatch Server app's uri path
static java.lang.String PROP_URIBASE_TREE_MANAGER
          Property name for the Tree Manager app's uri path
 
Method Summary
 java.net.URI assemble(Definition def)
          Construct a URI from a Definition.
 Definition disassemble(java.net.URI uri, Definition.ContainerType ct)
          This method disassembles a URI into its components, constructing a Definition object to provide conveniece accessors to the data encoded in the URI.
 void setProperties(java.util.Properties props)
          Sets the properties into the assembler.
 

Field Detail

PROP_PATH_PREFIX

static final java.lang.String PROP_PATH_PREFIX
Property name prefix. Properties passed into the setProperties() method include one path for each app type that denotes the path component of a uri to the servlet (or other logic component) that is responsible for serving requests for that app type. The property name is of the form: PROP_PATH_PREFIX + AppType

See Also:
Constant Field Values

PROP_URIBASE_CONTENT_SERVER

static final java.lang.String PROP_URIBASE_CONTENT_SERVER
Property name for the Content Server app's uri path


PROP_URIBASE_BLOB_SERVER

static final java.lang.String PROP_URIBASE_BLOB_SERVER
Property name for the Blob Server app's uri path


PROP_URIBASE_CATALOG_MANAGER

static final java.lang.String PROP_URIBASE_CATALOG_MANAGER
Property name for the Catalog Manager app's uri path


PROP_URIBASE_TREE_MANAGER

static final java.lang.String PROP_URIBASE_TREE_MANAGER
Property name for the Tree Manager app's uri path


PROP_URIBASE_COOKIE_SERVER

static final java.lang.String PROP_URIBASE_COOKIE_SERVER
Property name for the Cookie Server app's uri path


PROP_URIBASE_CACHE_SERVER

static final java.lang.String PROP_URIBASE_CACHE_SERVER
Property name for the Cache Server app's uri path


PROP_URIBASE_PAGE_DISPATCH_SERVER

static final java.lang.String PROP_URIBASE_PAGE_DISPATCH_SERVER
Property name for the Page Dispatch Server app's uri path


PROP_URIBASE_DISPATCH_MANAGER

static final java.lang.String PROP_URIBASE_DISPATCH_MANAGER
Property name for the Dispatch Manager app's uri path


PROP_URIBASE_SYNC_SEED_DISPATCH_SERVER

static final java.lang.String PROP_URIBASE_SYNC_SEED_DISPATCH_SERVER
Property name for the Sync Seed Dispatch Server app's uri path


PROP_URIBASE_SEED_DISPATCH_SERVER

static final java.lang.String PROP_URIBASE_SEED_DISPATCH_SERVER
Property name for the Seed Dispatch Server app's uri path


PROP_URIBASE_SATELLITE_SERVER

static final java.lang.String PROP_URIBASE_SATELLITE_SERVER
Property name for the Satellite Server servlet's uri path. Satellite Server does not correspond to a specific app type.

See Also:
Constant Field Values

LOG_NAME

static final java.lang.String LOG_NAME
Logger name, for use with Jakarta Commons Logging.

See Also:
Log, Constant Field Values
Method Detail

setProperties

void setProperties(java.util.Properties props)
Sets the properties into the assembler. The properties passed in correspond to the properties named in this interface. The properties correspond to the url path for each app type. Some containers may not permit the use of a url path, in which case the property value supplied will be null.

Property values do not need to be unique.

This method must be called by all Assemblers before any other Assembler methods are called.

Parameters:
props - The properties

assemble

java.net.URI assemble(Definition def)
                      throws java.net.URISyntaxException
Construct a URI from a Definition. This method will construct a URI object suitable for consumption by a user agent. If session encoding of the URI is required (as defined by the Definition), then it need not be done by this method. The interface user is responsible for session- encoding of URIs.

Parameters:
def - The definition to convert to a URI
Returns:
a URI
Throws:
java.net.URISyntaxException - if the definition contains illegal data

disassemble

Definition disassemble(java.net.URI uri,
                       Definition.ContainerType ct)
                       throws java.net.URISyntaxException
This method disassembles a URI into its components, constructing a Definition object to provide conveniece accessors to the data encoded in the URI.

This method needs to be able to identify a URI passed to it as one of its own or as a foreign URI. If the URI is foreign, then this method must return null. If there is an error in the URI syntax, and this URI is identified as owned by the implementation, then a URISyntaxException may be thrown.

Parameters:
uri - URI to disassemble
ct - the type of the container that this URL is being generated for.
Returns:
a Definition that contained the data in the URI, or null if the URI was not constructed by this Assembler
Throws:
java.net.URISyntaxException - if there is a problem with the URI syntax.
See Also:
Definition, Definition.ContainerType