while (rawValues.hasMore()) { String rawValue = rawValues.next().toString(); if (isCaseSensitive || !(simpleElement.getValue() instanceof String)) { if (simpleElement.getValue().equals(rawValue)) { return true; String stringElementValue = (String) simpleElement.getValue(); if (stringElementValue.equalsIgnoreCase(rawValue)) { return true;
if ( AttributeUtils.containsValueCaseIgnore( objectClasses, node.getValue() ) ) if ( node.getValue() instanceof String ) value = ( String ) node.getValue(); else if ( node.getValue() instanceof byte[] ) value = "#" + StringTools.toHexString( ( byte[] ) node.getValue() ); value = node.getValue().toString();
/** * Gets the worst case scan count for all entries that satisfy the equality * assertion in the SimpleNode argument. * * @param node the node to get a scan count for * @return the worst case * @throws NamingException if there is an error accessing an index */ private BigInteger getEqualityScan( SimpleNode node ) throws NamingException { if ( db.hasUserIndexOn( node.getAttribute() ) ) { Index idx = db.getUserIndex( node.getAttribute() ); return BigInteger.valueOf( idx.count( node.getValue() ) ); } // count for non-indexed attribute is unknown so we presume da worst return MAX; }
/** * Returns an enumeration over candidates that satisfy a simple greater than * or less than or equal to attribute value assertion. * * @param node the AVA node * @param isGreater true if >= false if <= is used * @return an enumeration over the index records matching the AVA * @throws NamingException if there is a failure while accessing the db */ private NamingEnumeration enumGreater( final SimpleNode node, final boolean isGreater ) throws NamingException { if ( db.hasUserIndexOn( node.getAttribute() ) ) { Index idx = db.getUserIndex( node.getAttribute() ); if ( isGreater ) { return idx.listIndices( node.getValue(), true ); } else { return idx.listIndices( node.getValue(), false ); } } return nonIndexedScan( node ); }
/** * Gets a scan count of the nodes that satisfy the greater or less than test * specified by the node. * * @param node the greater or less than node to get a count for * @param isGreaterThan if true test is for >=, otherwise <= * @return the scan count of all nodes satisfying the AVA * @throws NamingException if there is an error accessing an index */ private BigInteger getGreaterLessScan( SimpleNode node, boolean isGreaterThan ) throws NamingException { if ( db.hasUserIndexOn( node.getAttribute() ) ) { Index idx = db.getUserIndex( node.getAttribute() ); int count = idx.count( node.getValue(), isGreaterThan ); return BigInteger.valueOf( count ); } // count for non-indexed attribute is unknown so we presume da worst return MAX; }
Object filterValue = normalizer.normalize( node.getValue() ); NamingEnumeration list = attr.getAll();
/** * Returns an enumeration over candidates that satisfy a simple equality * attribute value assertion. * * @param node the equality AVA node * @return an enumeration over the index records matching the AVA * @throws NamingException if there is a failure while accessing the db */ private NamingEnumeration enumEquality( final SimpleNode node ) throws NamingException { if ( db.hasUserIndexOn( node.getAttribute() ) ) { Index idx = db.getUserIndex( node.getAttribute() ); return idx.listIndices( node.getValue() ); } return nonIndexedScan( node ); }
normalized = snode.getValue(); if ( snode.getValue() instanceof String ) normalized = ncn.normalizeByOid( snode.getAttribute(), ( String ) snode.getValue() ); else if ( snode.getValue() instanceof byte [] ) normalized = ncn.normalizeByOid( snode.getAttribute(), ( byte[] ) snode.getValue() ); normalized = ncn.normalizeByOid( snode.getAttribute(), snode.getValue().toString() ); if ( snode.getValue() instanceof String ) normalized = ncn.normalizeByName( snode.getAttribute(), ( String ) snode.getValue() ); else if ( snode.getValue() instanceof byte [] ) normalized = ncn.normalizeByName( snode.getAttribute(), ( byte[] ) snode.getValue() ); normalized = ncn.normalizeByName( snode.getAttribute(), snode.getValue().toString() );
case( LeafNode.LESSEQ ): SimpleNode simpleNode = ( SimpleNode ) leaf; if ( simpleNode.getValue() instanceof String ) ( String ) simpleNode.getValue(), simpleNode.getAssertionType() ); else if ( simpleNode.getValue() instanceof byte[] ) ( byte[] ) simpleNode.getValue(), simpleNode.getAssertionType() ); simpleNode.getValue().toString(), simpleNode.getAssertionType() );
case( LeafNode.LESSEQ ): SimpleNode simpleNode = ( SimpleNode ) leaf; if ( simpleNode.getValue() instanceof String ) ( String ) simpleNode.getValue(), simpleNode.getAssertionType() ); else if ( simpleNode.getValue() instanceof byte[] ) ( byte[] ) simpleNode.getValue(), simpleNode.getAssertionType() ); simpleNode.getValue().toString(), simpleNode.getAssertionType() );