SMILA (incubation) API documentation

org.eclipse.smila.connectivity.framework.util
Class DataReferenceFactory

java.lang.Object
  extended by org.eclipse.smila.connectivity.framework.util.DataReferenceFactory

public final class DataReferenceFactory
extends java.lang.Object

A factory to create DataReference objects in Crawlers.


Method Summary
 DataReference createDataReference(CrawlerCallback ccb, ConnectivityId id, java.lang.String hash)
          Creates a DataReference object with the given CrawlerCallback, Id and hash.
 DataReference createDataReference(CrawlerCallback ccb, java.lang.String dataSourceId, AnyMap idAttributes, AnyMap hashAttributes)
          Creates a DataReference object with the given CrawlerCallback, the dataSourceId, list of Id Attributes and list of Hash Attributes.
 DataReference createDataReference(CrawlerCallback ccb, java.lang.String dataSourceId, AnyMap idAttributes, AnyMap hashAttributes, java.util.Map<java.lang.String,?> hashAttachments)
          Creates a DataReference object with the given CrawlerCallback, the dataSourceId, list of Id Attributes, list of Hash Attributes and list of Hash Attachments.
 DataReference createDataReference(CrawlerCallback ccb, java.lang.String dataSourceId, AnyMap idAttributes, java.util.Map<java.lang.String,?> hashAttachments)
          Creates a DataReference object with the given CrawlerCallback, the dataSourceId, list of Id Attributes and list of Hash Attachments.
static DataReferenceFactory getInstance()
          Returns the singleton instance of the DataReferenceFactory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static DataReferenceFactory getInstance()
Returns the singleton instance of the DataReferenceFactory.

Returns:
the DataReferenceFactory

createDataReference

public DataReference createDataReference(CrawlerCallback ccb,
                                         java.lang.String dataSourceId,
                                         AnyMap idAttributes,
                                         AnyMap hashAttributes)
Creates a DataReference object with the given CrawlerCallback, the dataSourceId, list of Id Attributes and list of Hash Attributes.

Note the order of elementds in the passed AnyMaps is important and reflected in the generated hash and id. Usually this is not wanted but for performance reasons it is better to take the order as is and ensure proper ordering in the crawler/agent.

Parameters:
ccb - reference to the CrawlerCallback
dataSourceId - the dataSourceId. Must not be null or empty.
idAttributes - an array of Attributes to create the Id from
hashAttributes - an array of Attributes to create the Hash from
Returns:
the DataReference

createDataReference

public DataReference createDataReference(CrawlerCallback ccb,
                                         java.lang.String dataSourceId,
                                         AnyMap idAttributes,
                                         java.util.Map<java.lang.String,?> hashAttachments)
Creates a DataReference object with the given CrawlerCallback, the dataSourceId, list of Id Attributes and list of Hash Attachments.

Parameters:
ccb - reference to the CrawlerCallback
dataSourceId - the dataSourceId. Must not be null or empty.
idAttributes - an array of Attributes to create the Id from
hashAttachments - a Map of attachment names and attachment String values to create the hash from
Returns:
the DataReference

createDataReference

public DataReference createDataReference(CrawlerCallback ccb,
                                         java.lang.String dataSourceId,
                                         AnyMap idAttributes,
                                         AnyMap hashAttributes,
                                         java.util.Map<java.lang.String,?> hashAttachments)
Creates a DataReference object with the given CrawlerCallback, the dataSourceId, list of Id Attributes, list of Hash Attributes and list of Hash Attachments.

Note the order of elementds in the passed AnyMaps is important and reflected in the generated hash and id. Usually this is not wanted but for performance reasons it is better to take the order as is and ensure proper ordering in the crawler/agent.

Parameters:
ccb - reference to the CrawlerCallback
dataSourceId - the dataSourceId. Must not be null or empty.
idAttributes - an array of Attributes to create the Id from
hashAttributes - an array of Attributes to create the Hash from
hashAttachments - a Map of attachment names and attachment String values to create the hash from
Returns:
the DataReference

createDataReference

public DataReference createDataReference(CrawlerCallback ccb,
                                         ConnectivityId id,
                                         java.lang.String hash)
Creates a DataReference object with the given CrawlerCallback, Id and hash.

Parameters:
ccb - reference to the CrawlerCallback
id - the Id
hash - the hash
Returns:
the DataReference

SMILA (incubation) API documentation