org.opends.server.replication.plugin
Class HistoricalCsnOrderingMatchingRule

java.lang.Object
  extended by org.opends.server.api.MatchingRule<OrderingMatchingRuleCfg>
      extended by org.opends.server.api.OrderingMatchingRule
          extended by org.opends.server.replication.plugin.HistoricalCsnOrderingMatchingRule
All Implemented Interfaces:
java.io.Serializable, java.util.Comparator<byte[]>

public class HistoricalCsnOrderingMatchingRule
extends OrderingMatchingRule

Used to establish an order between historical information and index them.

See Also:
Serialized Form

Constructor Summary
HistoricalCsnOrderingMatchingRule()
          Construct a new HistoricalCsnOrderingMatchingRule object.
 
Method Summary
 int compare(byte[] b1, byte[] b2)
          Compares two normalized representation of historical information.
 int compareValues(ByteString value1, ByteString value2)
          Compare two ByteString values containing historical information.
 java.lang.String getDescription()
          Get the description of this Class.
 java.lang.String getName()
          Get the name of this class.
 java.lang.String getOID()
          Get the OID of the class.
 java.lang.String getSyntaxOID()
          Get the Syntax OID for this class.
 void initializeMatchingRule(OrderingMatchingRuleCfg configuration)
          Initializes this matching rule based on the information in the provided configuration entry.
 ByteString normalizeValue(ByteString value)
          Normalize historical information representation.
 
Methods inherited from class org.opends.server.api.OrderingMatchingRule
valuesMatch
 
Methods inherited from class org.opends.server.api.MatchingRule
equals, finalizeMatchingRule, getNameOrOID, hashCode, isConfigurationAcceptable, isObsolete, toString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

HistoricalCsnOrderingMatchingRule

public HistoricalCsnOrderingMatchingRule()
Construct a new HistoricalCsnOrderingMatchingRule object.

Method Detail

compareValues

public int compareValues(ByteString value1,
                         ByteString value2)
Compare two ByteString values containing historical information.

Specified by:
compareValues in class OrderingMatchingRule
Parameters:
value1 - first value to compare
value2 - second value to compare
Returns:
0 when equals, -1 or 1 to establish order

initializeMatchingRule

public void initializeMatchingRule(OrderingMatchingRuleCfg configuration)
Initializes this matching rule based on the information in the provided configuration entry.

Specified by:
initializeMatchingRule in class MatchingRule<OrderingMatchingRuleCfg>
Parameters:
configuration - The configuration to use to intialize this matching rule.

getName

public java.lang.String getName()
Get the name of this class.

Specified by:
getName in class MatchingRule<OrderingMatchingRuleCfg>
Returns:
name of the class in String form

getOID

public java.lang.String getOID()
Get the OID of the class.

Specified by:
getOID in class MatchingRule<OrderingMatchingRuleCfg>
Returns:
the OID of the class in String form.

getDescription

public java.lang.String getDescription()
Get the description of this Class.

Specified by:
getDescription in class MatchingRule<OrderingMatchingRuleCfg>
Returns:
the Class description in String form, currently not used.

getSyntaxOID

public java.lang.String getSyntaxOID()
Get the Syntax OID for this class.

Specified by:
getSyntaxOID in class MatchingRule<OrderingMatchingRuleCfg>
Returns:
the syntax OID in String form

normalizeValue

public ByteString normalizeValue(ByteString value)
Normalize historical information representation.

Specified by:
normalizeValue in class MatchingRule<OrderingMatchingRuleCfg>
Parameters:
value - the value that must be normalized
Returns:
The String form that must be used for historical information comparison

compare

public int compare(byte[] b1,
                   byte[] b2)
Compares two normalized representation of historical information.

Parameters:
b1 - first value to compare
b2 - second value to compare
Returns:
0, -1 or 1 depending on relative positions