SMILA 1.0 API documentation

org.eclipse.smila.connectivity.framework.crawler.filesystem
Class FileSystemCrawler

java.lang.Object
  extended by org.eclipse.smila.connectivity.framework.AbstractCrawler
      extended by org.eclipse.smila.connectivity.framework.crawler.filesystem.FileSystemCrawler
All Implemented Interfaces:
Crawler, CrawlerCallback

public class FileSystemCrawler
extends AbstractCrawler

The Class FileSystemCrawler.


Constructor Summary
FileSystemCrawler()
          Instantiates a new file system crawler.
 
Method Summary
 void close()
          Ends crawl, allowing the Crawler implementation to close any open resources.
 void dispose(ConnectivityId id)
          Disposes the record with the given Id.
 byte[] getAttachment(ConnectivityId id, java.lang.String name)
          Returns the attachment for the given Id and name pair.
 java.lang.String[] getAttachmentNames(ConnectivityId id)
          Returns an array of String[] containing the names of the available attachments for the given id.
 CrawlerPerformanceCounterHelper<? extends ConnectivityPerformanceAgent> getCounterHelper()
           
 AnyMap getMetadata(ConnectivityId id)
          Returns the metadata for the given id.
 DataReference[] getNext()
          Returns an array of DataReference objects.
 void initialize(DataSourceConnectionConfig config)
          Initialize.
 
Methods inherited from class org.eclipse.smila.connectivity.framework.AbstractCrawler
activate, getCrawlerId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileSystemCrawler

public FileSystemCrawler()
Instantiates a new file system crawler.

Method Detail

initialize

public void initialize(DataSourceConnectionConfig config)
                throws CrawlerException,
                       CrawlerCriticalException
Initialize.

Parameters:
config - the DataSourceConnectionConfig
Throws:
CrawlerException - the crawler exception
CrawlerCriticalException - the crawler critical exception
See Also:
initialize(org.eclipse.smila.connectivity.framework.schema.config.DataSourceConnectionConfig)

getNext

public DataReference[] getNext()
                        throws CrawlerException,
                               CrawlerCriticalException
Returns an array of DataReference objects. The size of the returned array may vary from call to call. The maximum size of the array is determined by configuration or by the implementation class.

Returns:
an array of DataReference objects or null, if no more DataReference exist
Throws:
CrawlerException - if any error occurs
CrawlerCriticalException - the crawler critical exception
See Also:
Crawler.getNext()

dispose

public void dispose(ConnectivityId id)
Disposes the record with the given Id.

Parameters:
id - the record id
See Also:
org.eclipse.smila.connectivity.framework.CrawlerCallback#dispose(org.eclipse.smila.datamodel.id.Id)

getAttachment

public byte[] getAttachment(ConnectivityId id,
                            java.lang.String name)
                     throws CrawlerException,
                            CrawlerCriticalException
Returns the attachment for the given Id and name pair.

Parameters:
id - the record id
name - the name of the attachment
Returns:
a byte[] containing the attachment
Throws:
CrawlerException - if any non critical error occurs
CrawlerCriticalException - if any critical error occurs
See Also:
org.eclipse.smila.connectivity.framework.CrawlerCallback#getAttachment(org.eclipse.smila.datamodel.id.Id, java.lang.String)

getAttachmentNames

public java.lang.String[] getAttachmentNames(ConnectivityId id)
                                      throws CrawlerException,
                                             CrawlerCriticalException
Returns an array of String[] containing the names of the available attachments for the given id.

Parameters:
id - the record id
Returns:
an array of String[] containing the names of the available attachments
Throws:
CrawlerException - if any non critical error occurs
CrawlerCriticalException - if any critical error occurs
See Also:
org.eclipse.smila.connectivity.framework.CrawlerCallback#getAttachmentNames(org.eclipse.smila.datamodel.id.Id)

getMetadata

public AnyMap getMetadata(ConnectivityId id)
                   throws CrawlerException,
                          CrawlerCriticalException
Returns the metadata for the given id.

Parameters:
id - the record id
Returns:
the MObject
Throws:
CrawlerException - if any non critical error occurs
CrawlerCriticalException - if any critical error occurs
See Also:
org.eclipse.smila.connectivity.framework.CrawlerCallback#getMObject(org.eclipse.smila.datamodel.id.Id)

close

public void close()
           throws CrawlerException
Ends crawl, allowing the Crawler implementation to close any open resources.

Throws:
CrawlerException - if any error occurs
See Also:
Crawler.close()

getCounterHelper

public CrawlerPerformanceCounterHelper<? extends ConnectivityPerformanceAgent> getCounterHelper()
Returns:
helper for crawler counters.

SMILA 1.0 API documentation