info.aduna.infosource.manager
Class InfoSourceManager

java.lang.Object
  extended by org.openrdf.repository.manager.RepositoryManager
      extended by org.openrdf.repository.manager.LocalRepositoryManager
          extended by info.aduna.infosource.manager.InfoSourceManager

public class InfoSourceManager
extends org.openrdf.repository.manager.LocalRepositoryManager

An InfoSourceManager is a RepositoryManager extended with capabilities for scheduling and invoking CrawlingRepositories.


Field Summary
static String INFOSOURCE_PREFIX
           
 
Fields inherited from class org.openrdf.repository.manager.LocalRepositoryManager
REPOSITORIES_DIR
 
Constructor Summary
InfoSourceManager(File dataDir)
           
 
Method Summary
 void addInfoSourceManagerListener(InfoSourceManagerListener listener)
           
 void crawl(Collection<CrawlingRepository> sources, boolean fullRecrawl)
          Crawls the specified CrawlingRepositories.
 void crawl(CrawlingRepository source, boolean fullRecrawl)
          Crawls the specified CrawlingRepository.
 void crawlAll(boolean fullRecrawl, boolean useListCrawlPreference)
          Sequentially crawls all CrawlingRepositories.
 String createID(String baseName)
          Derives a ID from a specified base name.
 CrawlingRepository getCrawlingRepository(String id)
          Returns the CrawlingRepository with the specified ID.
 Executor getLocalQueryExecutor()
           
 Executor getRemoteQueryExecutor()
           
 RemoteRepository getRemoteRepository(String id)
          Returns the RemoteRepository with the specified ID.
 void initialize()
           
 boolean isKnownRepositoryId(String id)
          Determines if the current ID is already in use as a Repository ID.
 void refresh()
           
 void removeInfoSourceManagerListener(InfoSourceManagerListener listener)
           
 void scheduleCrawl(String repositoryID, boolean fullRecrawl)
          Schedules an immediate recrawl of the specified CrawlingRepository.
 void shutDown()
           
 void startScheduler()
          Starts the recrawl scheduler.
 void stopCrawling()
          Stops the currently ongoing crawl.
 void stopCrawling(CrawlingRepository repository)
           
 void stopScheduler()
          Stops the recrawl scheduler.
 
Methods inherited from class org.openrdf.repository.manager.LocalRepositoryManager
cleanUpRepository, createRepository, createSystemRepository, getAllRepositoryInfos, getBaseDir, getRepositoryDir, getRepositoryInfo, getSystemRepository, resolvePath
 
Methods inherited from class org.openrdf.repository.manager.RepositoryManager
addRepositoryConfig, getAllRepositories, getAllRepositoryInfos, getAllUserRepositoryInfos, getInitializedRepositories, getRepository, getRepositoryConfig, getRepositoryIDs, hasRepositoryConfig, removeRepositoryConfig
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INFOSOURCE_PREFIX

public static final String INFOSOURCE_PREFIX
See Also:
Constant Field Values
Constructor Detail

InfoSourceManager

public InfoSourceManager(File dataDir)
Method Detail

createID

public String createID(String baseName)
                throws org.openrdf.repository.RepositoryException
Derives a ID from a specified base name. The base name may for example be a Repository name entered by the user. The derived ID will contain a version of this name that does not occur as a Repository ID yet and is suitable for use as a file name.

Parameters:
baseName - The String on which the returned ID should be based. This may be null or an empty string.
Returns:
A ID for a new Repository that is not used in the set of Repositories maintained by this InfoSourceManager at the moment of invocation.
Throws:
org.openrdf.repository.RepositoryException - when queries to the system repository fails.

isKnownRepositoryId

public boolean isKnownRepositoryId(String id)
                            throws org.openrdf.repository.RepositoryException
Determines if the current ID is already in use as a Repository ID.

Parameters:
id - The ID to test.
Throws:
org.openrdf.repository.RepositoryException - Whenever access to the SystemRepository results in a RepositoryException.

initialize

public void initialize()
                throws org.openrdf.repository.RepositoryException
Overrides:
initialize in class org.openrdf.repository.manager.RepositoryManager
Throws:
org.openrdf.repository.RepositoryException

startScheduler

public void startScheduler()
Starts the recrawl scheduler.


stopScheduler

public void stopScheduler()
Stops the recrawl scheduler.


refresh

public void refresh()
Overrides:
refresh in class org.openrdf.repository.manager.RepositoryManager

getCrawlingRepository

public CrawlingRepository getCrawlingRepository(String id)
                                         throws org.openrdf.repository.config.RepositoryConfigException,
                                                org.openrdf.repository.RepositoryException
Returns the CrawlingRepository with the specified ID.

Parameters:
id - The ID of a CrawlingRepository.
Returns:
The requested CrawlingRepository, or null in case the manager does not have a CrawlingRepository with the specified ID.
Throws:
org.openrdf.repository.config.RepositoryConfigException
org.openrdf.repository.RepositoryException

getRemoteRepository

public RemoteRepository getRemoteRepository(String id)
                                     throws org.openrdf.repository.config.RepositoryConfigException,
                                            org.openrdf.repository.RepositoryException
Returns the RemoteRepository with the specified ID.

Parameters:
id - The ID of a RemoteRepository.
Returns:
The requested RemoteRepository, or null in case the manager does not have a RemoteRepository with the specified ID.
Throws:
org.openrdf.repository.config.RepositoryConfigException
org.openrdf.repository.RepositoryException

shutDown

public void shutDown()
Overrides:
shutDown in class org.openrdf.repository.manager.RepositoryManager

crawlAll

public void crawlAll(boolean fullRecrawl,
                     boolean useListCrawlPreference)
              throws org.openrdf.repository.config.RepositoryConfigException,
                     org.openrdf.repository.RepositoryException
Sequentially crawls all CrawlingRepositories. This method is blocking: it will return after the last CrawlingRepository has finished its crawling.

Parameters:
fullRecrawl - Flag indicating whether a full- or incremental crawl should be performed.
useListCrawlPreference - Flag indicating whether the "include in list crawl" property should be obeyed.
Throws:
org.openrdf.repository.config.RepositoryConfigException
org.openrdf.repository.RepositoryException

crawl

public void crawl(Collection<CrawlingRepository> sources,
                  boolean fullRecrawl)
Crawls the specified CrawlingRepositories.

Parameters:
sources - A Collection of CrawlingRepositories.
fullRecrawl - Flag indicating whether a full- or incremental crawl should be performed.

crawl

public void crawl(CrawlingRepository source,
                  boolean fullRecrawl)
Crawls the specified CrawlingRepository.

Parameters:
source - The CrawlingRepository to crawl.
fullRecrawl - Flag indicating whether a full- or incremental crawl should be performed.

scheduleCrawl

public void scheduleCrawl(String repositoryID,
                          boolean fullRecrawl)
Schedules an immediate recrawl of the specified CrawlingRepository.

Parameters:
repositoryID - The ID of a CrawlingRepository.
fullRecrawl - If true, a full recrawl will be performed, otherwise an incremental recrawl is performed.

stopCrawling

public void stopCrawling()
Stops the currently ongoing crawl. This method will return immediately, while some background crawling operations may continue for an unspecified of time. Note that this method is not synchronized, so take care not to invoke this when Repositories are added or removed.


stopCrawling

public void stopCrawling(CrawlingRepository repository)

getRemoteQueryExecutor

public Executor getRemoteQueryExecutor()

getLocalQueryExecutor

public Executor getLocalQueryExecutor()

addInfoSourceManagerListener

public void addInfoSourceManagerListener(InfoSourceManagerListener listener)

removeInfoSourceManagerListener

public void removeInfoSourceManagerListener(InfoSourceManagerListener listener)


Copyright © 1997-2008 Aduna. All Rights Reserved.