org.freecompany.brimstone.core
Class BrimstoneResolverService

java.lang.Object
  extended by org.freecompany.brimstone.core.BrimstoneResolverService
All Implemented Interfaces:
ResolverService, ResolverService.I2Ls

public class BrimstoneResolverService
extends java.lang.Object
implements ResolverService.I2Ls

The Brimstone resolver.

Resolves URIs (URNs) of the form urn:brimstone:<group>/<name>.<type> against a list of Maven-style repositories.

This service only implements the I2Ls operation. The Brimstone-style URI is re-written to a relative URI form, <group>/<type>s/<name>.<type>, and resolved against each of the URIs in the RepositoryList. All of the resulting URIs are returned. Note that not all repositories will have all artifacts, so not all of the URIs will be able to retrieve the identified resource.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.freecompany.brimstone.core.ResolverService
ResolverService.I2C, ResolverService.I2Cs, ResolverService.I2L, ResolverService.I2Ls, ResolverService.I2N, ResolverService.I2Ns, ResolverService.I2R, ResolverService.I2Rs, ResolverService.IeqI
 
Constructor Summary
BrimstoneResolverService()
          Creates a resolver with the default RepositoryList.
BrimstoneResolverService(RepositoryList searchBase)
          Creates a resolver with the specified RepositoryList.
 
Method Summary
 void addSearchBase(java.net.URI uri)
          Add a repository to the RepositoryList for this resolver.
 java.util.List<java.net.URI> getURLs(java.net.URI uri)
          Translate the given URI to a list of locators for the resource.
 boolean local()
          Returns a boolean indicating whether this resolver only generates possible matches locally.
 boolean resolvable(java.net.URI uri)
          Returns true iff the uri's scheme is "urn", the scheme-specific part starts with "brimstone:", and URI matches the rewrite pattern.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BrimstoneResolverService

public BrimstoneResolverService()
Creates a resolver with the default RepositoryList.


BrimstoneResolverService

public BrimstoneResolverService(RepositoryList searchBase)
Creates a resolver with the specified RepositoryList.

Parameters:
searchBase - the RepositoryList to search for artifacts.
Method Detail

addSearchBase

public void addSearchBase(java.net.URI uri)
Add a repository to the RepositoryList for this resolver.


local

public boolean local()
Description copied from interface: ResolverService
Returns a boolean indicating whether this resolver only generates possible matches locally. Local resolvers will always be exhausted before remote resolvers are attempted.

Specified by:
local in interface ResolverService
Returns:
true if this resolver only looks locally, false if it uses remote resources.

resolvable

public boolean resolvable(java.net.URI uri)
Returns true iff the uri's scheme is "urn", the scheme-specific part starts with "brimstone:", and URI matches the rewrite pattern.

Specified by:
resolvable in interface ResolverService

getURLs

public java.util.List<java.net.URI> getURLs(java.net.URI uri)
Description copied from interface: ResolverService.I2Ls
Translate the given URI to a list of locators for the resource.

Note that not all of the returned locators need work. If a resolver knows a list of locations that, if they exist would have the resource, it may return the corresponding locators. This differs from ResolverService.I2L, which shouldn't return a locator that "might" refer to the resource.

Specified by:
getURLs in interface ResolverService.I2Ls
Parameters:
uri - the URI to resolve.
Returns:
a list of locators for the resource identified by the URI, or null if no locators are known.