/** * @see ExprNode#printRefinementToBuffer(StringBuilder) * @return The buffer in which the refinement has been appended * @throws UnsupportedOperationException if this node isn't a part of a refinement. */ public StringBuilder printRefinementToBuffer( StringBuilder buf ) { if ( getAttribute() == null || !SchemaConstants.OBJECT_CLASS_AT.equalsIgnoreCase( getAttribute() ) ) { throw new UnsupportedOperationException( I18n.err( I18n.ERR_04162, getAttribute() ) ); } buf.append( "item: " ).append( value ); return buf; }
/** * 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; }
/** * 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; }
/** * 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 ); }
Attribute attribute = attributes.get(simpleElement.getAttribute()); if (attribute == null) { throw new DirectoryException("could not retrieve value for attribute: " + simpleElement.getAttribute());
if ( !node.getAttribute().equalsIgnoreCase( "objectclass" ) ) throw new NamingException( "Refinement leaf node attribute was " + node.getAttribute() );
/** * 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 ); }
Normalizer normalizer = getNormalizer( node.getAttribute() ); Comparator comparator = getComparator( node.getAttribute() ); AttributeType type = attributeTypeRegistry.lookup( oidRegistry.getOid( node.getAttribute() ) ); Attribute attr = ServerUtils.getAttribute( type, entry );
String attrId = node.getAttribute();
if ( db.hasUserIndexOn( node.getAttribute() ) ) Index idx = db.getUserIndex( node.getAttribute() ); return idx.hasValue( node.getValue(), rec.getEntryId() ); Normalizer normalizer = getNormalizer( node.getAttribute() ); Comparator comparator = getComparator( node.getAttribute() ); AttributeType type = attributeTypeRegistry.lookup( oidRegistry.getOid( node.getAttribute() ) ); Attribute attr = ServerUtils.getAttribute( type, attrs );
if ( !ncn.isDefined( snode.getAttribute() ) ) else if ( Character.isDigit( snode.getAttribute().charAt( 0 ) ) ) normalized = ncn.normalizeByOid( snode.getAttribute(), ( String ) snode.getValue() ); normalized = ncn.normalizeByOid( snode.getAttribute(), ( byte[] ) snode.getValue() ); normalized = ncn.normalizeByOid( snode.getAttribute(), snode.getValue().toString() ); normalized = ncn.normalizeByName( snode.getAttribute(), ( String ) snode.getValue() ); normalized = ncn.normalizeByName( snode.getAttribute(), ( byte[] ) snode.getValue() ); normalized = ncn.normalizeByName( snode.getAttribute(), snode.getValue().toString() ); snode.setAttribute( registry.getOid( snode.getAttribute() ) ); log.error( "Failed to normalize filter node attribute: " + snode.getAttribute(), e ); UndefinedFilterAttributeException rte = new UndefinedFilterAttributeException( snode, e.getMessage() ); rte.initCause( e );
String attrId = node.getAttribute(); BigInteger id = record.getEntryId(); Attribute attr = AttributeUtils.getAttribute( record.getAttributes(), attributeTypeRegistry.lookup( node.getAttribute() ) );
if ( node.getAttribute().equalsIgnoreCase( "2.5.4.0" ) && ( "top".equalsIgnoreCase( objectClassOid ) || "subschema".equalsIgnoreCase( objectClassOid ) ) && ( node.getAssertionType() == SimpleNode.EQUALITY ) )