net.dpml.transit.link
Class ArtifactLinkManager

java.lang.Object
  extended by net.dpml.transit.link.ArtifactLinkManager
All Implemented Interfaces:
LinkManager

public class ArtifactLinkManager
extends Object
implements LinkManager

A link manager that maintains persistent link information as a resource. Link resource located using the [cache]/[group]/[name]/[type]s/[name]-[version].[type].link resource naming convention. Applications should not call the methods for the LinkManager directly, and it is likely that the LinkManager remains outside the reachability of applications.

Version:
1.0.3
Author:
Digital Product Meta Library

Constructor Summary
ArtifactLinkManager()
           
 
Method Summary
 URI getTargetURI(URI linkUri)
          Returns the URI that the provided link URI instance is pointing to.
 void setTargetURI(URI linkUri, URI targetUri)
          Sets the URI for the provided Link.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArtifactLinkManager

public ArtifactLinkManager()
Method Detail

setTargetURI

public void setTargetURI(URI linkUri,
                         URI targetUri)
                  throws IOException
Sets the URI for the provided Link. The LinkManager is required to persist this information between JVM restarts and should be persisted on a scope larger than a single JVM, typically a host or a local area network. LinkManagers are encouraged to establish other virtual scopes independent of network topologies.

Specified by:
setTargetURI in interface LinkManager
Parameters:
linkUri - the uri of the link resource
targetUri - the uri that the link redirects to
Throws:
IOException - if the mapping could not be updated.

getTargetURI

public URI getTargetURI(URI linkUri)
                 throws IOException,
                        LinkNotFoundException
Returns the URI that the provided link URI instance is pointing to.

Specified by:
getTargetURI in interface LinkManager
Parameters:
linkUri - the link uri from which the target will be resolved
Returns:
target URI that the link points to (possibly null if the link does not declare a target)
Throws:
LinkNotFoundException - if the supplied link uri could not be located
IOException - if the mapping could not be retrieved, due to an IOException during link retrival.