SMILA (incubation) API documentation

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

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

public final class ConnectivityHashFactory
extends java.lang.Object

A factory to create Hash objects in Crawlers and Agents.


Method Summary
 java.lang.String createHash(AnyMap hashAttributesMap)
          Create a hash object based on the given Attributes.
 java.lang.String createHash(AnyMap hashAttributeMap, java.util.Map<java.lang.String,?> hashAttachments)
          Create a hash object based on the given Attributes and Attachments.
 java.lang.String createHash(java.util.Map<java.lang.String,?> hashAttachments)
          Create a hash object based on the given Attachments.
 java.lang.String createHash(java.lang.String value)
          Computes a hash for the value.
static ConnectivityHashFactory getInstance()
          Returns the singleton instance of the HashFactory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ConnectivityHashFactory getInstance()
Returns the singleton instance of the HashFactory.

Returns:
the HashFactory

createHash

public java.lang.String createHash(AnyMap hashAttributesMap)
Create a hash object based on the given 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:
hashAttributesMap - an AnyMap of attributes whose values are used to create the hash. Must not be null or empty.
Returns:
a String containing the hash

createHash

public java.lang.String createHash(java.util.Map<java.lang.String,?> hashAttachments)
Create a hash object based on the given 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:
hashAttachments - a Map of attachment names and attachment String values, that are used to create the hash. Must not be null or empty.
Returns:
a String containing the hash

createHash

public java.lang.String createHash(AnyMap hashAttributeMap,
                                   java.util.Map<java.lang.String,?> hashAttachments)
Create a hash object based on the given Attributes and Attachments. One of the parameters may be null or empty.

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:
hashAttributeMap - an AnyMap of attributes whose values are used to create the hash
hashAttachments - a Map of attachment names and attachment String values, that are used to create the hash.
Returns:
a String containing the hash

createHash

public java.lang.String createHash(java.lang.String value)
Computes a hash for the value.

Parameters:
value - the value to compute the hash for.
Returns:
the computed hash.

SMILA (incubation) API documentation