| | |
| | | import org.opends.server.admin.std.meta. |
| | | CollationMatchingRuleCfgDefn.MatchingRuleType; |
| | | import org.opends.server.admin.std.server.CollationMatchingRuleCfg; |
| | | import org.opends.server.api.AbstractMatchingRule; |
| | | import org.opends.server.api.ExtensibleIndexer; |
| | | import org.opends.server.api.ExtensibleMatchingRule; |
| | | import org.opends.server.api.IndexQueryFactory; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.backends.jeb.AttributeIndex; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | |
| | | import org.opends.server.types.IndexConfig; |
| | | import org.opends.server.types.InitializationException; |
| | | import org.opends.server.types.ResultCode; |
| | | import org.opends.server.util.StaticUtils; |
| | | |
| | | |
| | | |
| | |
| | | /** |
| | | * Collation Extensible matching rule. |
| | | */ |
| | | private abstract class CollationMatchingRule extends |
| | | ExtensibleMatchingRule |
| | | private abstract class CollationMatchingRule |
| | | extends AbstractMatchingRule |
| | | implements ExtensibleMatchingRule |
| | | { |
| | | // Names for this class. |
| | | private final Collection<String> names; |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public Collection<ExtensibleIndexer> getIndexers(IndexConfig config) |
| | | { |
| | | if (indexer == null) |
| | |
| | | /** |
| | | * Collation rule for Equality matching rule. |
| | | */ |
| | | private final class CollationEqualityMatchingRule extends |
| | | CollationMatchingRule |
| | | private final class CollationEqualityMatchingRule |
| | | extends CollationMatchingRule |
| | | implements OrderingMatchingRule |
| | | { |
| | | |
| | | /** |
| | | * The serial version identifier required to satisfy the compiler because |
| | | * this class implements the <CODE>java.io.Serializable</CODE> interface. |
| | | * This value was generated using the <CODE>serialver</CODE> command-line |
| | | * utility included with the Java SDK. |
| | | */ |
| | | private static final long serialVersionUID = 3990778178484159862L; |
| | | |
| | | |
| | | |
| | | /** |
| | | * Constructs a new CollationEqualityMatchingRule. |
| | | * |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public <T> T createIndexQuery(ByteSequence assertionValue, |
| | | IndexQueryFactory<T> factory) throws DirectoryException |
| | | { |
| | |
| | | return factory.createExactMatchQuery(indexer |
| | | .getExtensibleIndexID(), normalizeValue(assertionValue)); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public int compare(byte[] arg0, byte[] arg1) |
| | | { |
| | | return StaticUtils.compare(arg0, arg1); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public int compareValues(ByteSequence value1, ByteSequence value2) |
| | | { |
| | | return value1.compareTo(value2); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public <T> T createIndexQuery(ByteSequence assertionValue, |
| | | IndexQueryFactory<T> factory) throws DirectoryException |
| | | { |
| | |
| | | /** |
| | | * An abstract Collation rule for Ordering matching rule. |
| | | */ |
| | | private abstract class CollationOrderingMatchingRule extends |
| | | CollationMatchingRule |
| | | private abstract class CollationOrderingMatchingRule |
| | | extends CollationMatchingRule |
| | | implements OrderingMatchingRule |
| | | { |
| | | |
| | | /** |
| | | * The serial version identifier required to satisfy the compiler because |
| | | * this class implements the <CODE>java.io.Serializable</CODE> interface. |
| | | * This value was generated using the <CODE>serialver</CODE> command-line |
| | | * utility included with the Java SDK. |
| | | */ |
| | | private static final long serialVersionUID = 7354051060508436941L; |
| | | |
| | | |
| | | |
| | | /** |
| | | * Constructs a new CollationOrderingMatchingRule. |
| | | * |
| | |
| | | CollationKey key = collator.getCollationKey(value.toString()); |
| | | return ByteString.wrap(key.toByteArray()); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public int compare(byte[] arg0, byte[] arg1) |
| | | { |
| | | return StaticUtils.compare(arg0, arg1); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public int compareValues(ByteSequence value1, ByteSequence value2) |
| | | { |
| | | return value1.compareTo(value2); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | private final class CollationLessThanMatchingRule extends |
| | | CollationOrderingMatchingRule |
| | | { |
| | | /** |
| | | * The serial version identifier required to satisfy the compiler because |
| | | * this class implements the <CODE>java.io.Serializable</CODE> interface. |
| | | * This value was generated using the <CODE>serialver</CODE> command-line |
| | | * utility included with the Java SDK. |
| | | */ |
| | | private static final long serialVersionUID = -7578406829946732713L; |
| | | |
| | | |
| | | |
| | | /** |
| | | * Constructs a new CollationLessThanMatchingRule. |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public <T> T createIndexQuery(ByteSequence assertionValue, |
| | | IndexQueryFactory<T> factory) throws DirectoryException |
| | | { |
| | |
| | | private final class CollationLessThanOrEqualToMatchingRule extends |
| | | CollationOrderingMatchingRule |
| | | { |
| | | /** |
| | | * The serial version identifier required to satisfy the compiler because |
| | | * this class implements the <CODE>java.io.Serializable</CODE> interface. |
| | | * This value was generated using the <CODE>serialver</CODE> command-line |
| | | * utility included with the Java SDK. |
| | | */ |
| | | private static final long serialVersionUID = 7222067708233629974L; |
| | | |
| | | |
| | | |
| | | /** |
| | | * Constructs a new CollationLessThanOrEqualToMatchingRule. |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public <T> T createIndexQuery(ByteSequence assertionValue, |
| | | IndexQueryFactory<T> factory) throws DirectoryException |
| | | { |
| | |
| | | private final class CollationGreaterThanMatchingRule extends |
| | | CollationOrderingMatchingRule |
| | | { |
| | | /** |
| | | * The serial version identifier required to satisfy the compiler because |
| | | * this class implements the <CODE>java.io.Serializable</CODE> interface. |
| | | * This value was generated using the <CODE>serialver</CODE> command-line |
| | | * utility included with the Java SDK. |
| | | */ |
| | | private static final long serialVersionUID = 1204368277332957024L; |
| | | |
| | | |
| | | |
| | | /** |
| | | * Constructs a new CollationGreaterThanMatchingRule. |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public <T> T createIndexQuery(ByteSequence assertionValue, |
| | | IndexQueryFactory<T> factory) throws DirectoryException |
| | | { |
| | |
| | | private final class CollationGreaterThanOrEqualToMatchingRule extends |
| | | CollationOrderingMatchingRule |
| | | { |
| | | /** |
| | | * The serial version identifier required to satisfy the compiler because |
| | | * this class implements the <CODE>java.io.Serializable</CODE> interface. |
| | | * This value was generated using the <CODE>serialver</CODE> command-line |
| | | * utility included with the Java SDK. |
| | | */ |
| | | private static final long serialVersionUID = -5212358378014047933L; |
| | | |
| | | |
| | | |
| | | /** |
| | | * Constructs a new CollationGreaterThanOrEqualToMatchingRule. |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public <T> T createIndexQuery(ByteSequence assertionValue, |
| | | IndexQueryFactory<T> factory) throws DirectoryException |
| | | { |