net.dpml.transit
Class Layout

java.lang.Object
  extended by net.dpml.transit.Layout
Direct Known Subclasses:
ClassicLayout, EclipseLayout, ModernLayout

public abstract class Layout
extends Object

Definition of a repository layout. Specialized layouts must extend from this base abstract class. The class includes static methods supporting the resolution of available layouts. Each layout instance is associated with a unique identifier and represents the mapping between a layout strategy name and the physical structural representation of a repository. Operations on the layout class support the translation of artifact addresses to their corresponding physicaly layout on remote systems.

Version:
2.1.1
Author:
Digital Product Management Library

Constructor Summary
Layout()
           
 
Method Summary
abstract  String getID()
          Return the layout identifier.
static Layout getLayout(String id)
          Return a location resolver capable for supporting the supplied id.
abstract  String resolveBase(Artifact artifact)
          Return the base path for an artifact.
abstract  String resolveFilename(Artifact artifact)
          Return the filename for an artifact.
abstract  String resolvePath(Artifact artifact)
          Returns the full path of the artifact relative to a logical root directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Layout

public Layout()
Method Detail

getLayout

public static Layout getLayout(String id)
Return a location resolver capable for supporting the supplied id. If a handler is available the handler is returned otherwise the returned value is null.

Parameters:
id - the layout identifier
Returns:
the location resolver or null if not available

getID

public abstract String getID()
Return the layout identifier. The id value is used to identify layout instances assigned to cache handlers and resource host handlers.

Returns:
the layout id

resolveBase

public abstract String resolveBase(Artifact artifact)
Return the base path for an artifact. The base path is the location where the file will be found. The base + "/" filename is equal to the full path.

Parameters:
artifact - the Artifact to resolve.
Returns:
the base path

resolvePath

public abstract String resolvePath(Artifact artifact)
Returns the full path of the artifact relative to a logical root directory. The base + "/" filename is equal to the full path.

Parameters:
artifact - the Artifact to resolve.
Returns:
the logical artifact path
See Also:
resolveBase(net.dpml.transit.Artifact), resolveFilename(net.dpml.transit.Artifact)

resolveFilename

public abstract String resolveFilename(Artifact artifact)
Return the filename for an artifact. The base + "/" filename is equal to the full path.

Parameters:
artifact - the Artifact to resolve.
Returns:
the logical artifact path
See Also:
resolveBase(net.dpml.transit.Artifact), resolveFilename(net.dpml.transit.Artifact)