HistoricalCsnOrderingMatchingRuleImpl.java revision d9ef4462a53d5ae301f2e86c4299503b155f1118
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at legal-notices/CDDLv1_0.txt.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Copyright 2006-2010 Sun Microsystems, Inc.
* Portions Copyright 2012-2015 ForgeRock AS.
*/
/**
* Matching rule used to establish an order between historical information and index them.
*/
public final class HistoricalCsnOrderingMatchingRuleImpl implements MatchingRuleImpl
{
private final Collection<? extends Indexer> indexers = Collections.singleton(new HistoricalIndexer());
/** Indexer for the matching rule. */
private final class HistoricalIndexer implements Indexer
{
public void createKeys(Schema schema, ByteSequence value, Collection<ByteString> keys) throws DecodeException
{
}
public String getIndexID()
{
return ORDERING_ID;
}
{
}
}
/** {@inheritDoc} */
{
/*
* Change the format of the value to index and start with the serverId. In
* that manner, the search response time is optimized for a particular
* serverId. The format of the key is now : serverId + timestamp + seqNum
*/
try
{
return builder.toByteString();
}
catch (Exception e)
{
// This should never occur in practice since these attributes are managed
// internally.
}
}
/** {@inheritDoc} */
{
return new Assertion()
{
{
}
{
}
};
}
/** {@inheritDoc} */
{
return UNDEFINED_ASSERTION;
}
/** {@inheritDoc} */
public Assertion getGreaterOrEqualAssertion(Schema schema, ByteSequence value) throws DecodeException
{
return new Assertion()
{
{
}
{
}
};
}
/** {@inheritDoc} */
{
return new Assertion()
{
{
}
{
}
};
}
/** {@inheritDoc} */
{
return indexers;
}
}