org.activemath.content.mediator
Class RepositoryManager

java.lang.Object
  extended by org.activemath.content.mediator.RepositoryManager

public class RepositoryManager
extends Object

Manage the repositories. This class handle the registeration and unregisteration of repository and give the necessary information about the mediator in respect of repository like MetaDataOntologie. Every succesfully registered repository will get an Id and with this Id, the coordinary KBCaller instance can be found in the HashMap "repositories". Currently there are only Web Service Repositories can be managed here.


Field Summary
protected static Category log
           
 
Method Summary
 String addRepository(String name, String serviceAdrURL, String ontologieAdrURL, String mappingAdrURL, String contentIdWithConfident)
          Add a repository to Mediator.
static RepositoryManager getInstance()
           
 String getMetadataOntologyURL()
          The ontology of the Metadata can be get here.
 boolean hasRepository(String id)
          Check if the repository with given id is registered in the HashMap
 boolean removeRepository(String id)
          Remove a Repository with given Id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static Category log
Method Detail

getInstance

public static RepositoryManager getInstance()

addRepository

public String addRepository(String name,
                            String serviceAdrURL,
                            String ontologieAdrURL,
                            String mappingAdrURL,
                            String contentIdWithConfident)
                     throws MediatorException
Add a repository to Mediator. The given parameter must be valid to register a KBCaller and then a test thread will be started to check if the repository can be queryed. Only when all of the above succeed, the repository can be registered and an Id will be given back. This Id is the reference to the registered KBCaller in the HashMap repositories. When one of the step fails, the whole process will be rolled back and a MediatorException will be thrown.

Parameters:
name -
serviceAdrURL -
ontologieAdrURL -
mappingAdrURL -
Returns:
the Id of the registered Repository
Throws:
MediatorException

removeRepository

public boolean removeRepository(String id)
Remove a Repository with given Id. If the given Id can be found. Then the appropriate KBCaller instance will be removed and also unregistered from Mediator. That means, by the next time the query to Mediator won't be send to this repository.

Parameters:
id -
Returns:
true, if successfully removed, false, if cannot removed, because of e.g. wrong id.

hasRepository

public boolean hasRepository(String id)
Check if the repository with given id is registered in the HashMap

Parameters:
id -
Returns:
true if id can be found false if id can't be found

getMetadataOntologyURL

public String getMetadataOntologyURL()
The ontology of the Metadata can be get here.

Returns:
the absolute URL of the ontology file.