org.wsmo.locator
Class LocatorManager

java.lang.Object
  extended by org.wsmo.locator.LocatorManager

public final class LocatorManager
extends Object

The locator manager responsible to validate and manage a queue of locators.

Version:
$Revision: 1946 $ $Date: 2007-04-02 15:13:28 +0300 (Mon, 02 Apr 2007) $
Author:
not attributable

Constructor Summary
LocatorManager()
           
 
Method Summary
 void addLocator(Locator locator)
          Adds new locator to the queue of locators
static Locator createLocator(Map<String,Object> map)
          Creates a locator based on the supplied preferences.
 Set lookup(Identifier id)
          Attempts to find an entity based on its IRI.
 Entity lookup(Identifier id, Class clazz)
          Attempts to find an entity based on its IRI.
 void removeLocator(Locator locator)
          Removes a locator from the queue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocatorManager

public LocatorManager()
Method Detail

addLocator

public void addLocator(Locator locator)
Adds new locator to the queue of locators

Parameters:
locator - The locator to add

lookup

public Set lookup(Identifier id)
Attempts to find an entity based on its IRI. If the first locator in the queue is unable to locate the entity then it will pass the request to the next locator in the locator chain

Parameters:
id - The ID of the entity to find
Returns:
The entity corresponding to the supplied ID or null if none found
Throws:
SynchronisationException
See Also:
#setNext(Locator loc), Entity

lookup

public Entity lookup(Identifier id,
                     Class clazz)
Attempts to find an entity based on its IRI. If the first locator in the queue is unable to locate the entity then it will pass the request to the next locator in the locator chain

Parameters:
id - The ID of the entity to find
clazz - The type of the identifier
Returns:
The entity corresponding to the supplied ID or null if none found
Throws:
SynchronisationException
See Also:
#setNext(Locator loc)

removeLocator

public void removeLocator(Locator locator)
Removes a locator from the queue

Parameters:
locator - The locator to remove

createLocator

public static Locator createLocator(Map<String,Object> map)
Creates a locator based on the supplied preferences.

Parameters:
properties - the preferences for the locator. Such preferences should provide all the necessary information for the locator initialisation (e.g. provider class, type...)
Returns:
a Locator


Copyright © 2004-2008 Ontotext Lab.. All Rights Reserved.