/** * {@inheritDoc} */ @Override public CompareRequest setAssertionValue( String value ) { this.attrVal = new Value( value ); return this; }
/** * Create a Value with an AttributeType. It will not contain anything and will only be used by * the deserializer. * * @param attributeType The ATttributeType to use * @return An instance of value. */ public static Value createValue( AttributeType attributeType ) { return new Value( attributeType ); }
/** * Create a Value with an AttributeType. It will not contain anything and will only be used by * the deserializer. * * @param attributeType The ATttributeType to use * @return An instance of value. */ public static Value createValue( AttributeType attributeType ) { return new Value( attributeType ); }
/** * {@inheritDoc} */ @Override public CompareRequest setAssertionValue( String value ) { this.attrVal = new Value( value ); return this; }
/** * {@inheritDoc} */ @Override public CompareRequest setAssertionValue( String value ) { this.attrVal = new Value( value ); return this; }
/** * Create a Value with an AttributeType. It will not contain anything and will only be used by * the deserializer. * * @param attributeType The ATttributeType to use * @return An instance of value. */ public static Value createValue( AttributeType attributeType ) { return new Value( attributeType ); }
/** * {@inheritDoc} */ @Override public CompareRequest setAssertionValue( byte[] value ) { if ( value != null ) { this.attrVal = new Value( value ); } else { this.attrVal = null; } return this; }
/** * {@inheritDoc} */ @Override public Object normalizeByName( String name, byte[] value ) throws LdapException { AttributeType attributeType = schemaManager.getAttributeType( name ); return new Value( attributeType, value ); }
/** * {@inheritDoc} */ @Override public Object normalizeByName( String name, byte[] value ) throws LdapException { AttributeType attributeType = schemaManager.getAttributeType( name ); return new Value( attributeType, value ); }
/** * Deserialize a Value. It will return a new Value instance. * * @param in The input stream * @return A new Value instance * @throws IOException If the stream can't be read * @throws ClassNotFoundException If we can't instanciate a Value */ public static Value deserialize( ObjectInput in ) throws IOException, ClassNotFoundException { Value value = new Value( ( AttributeType ) null ); value.readExternal( in ); return value; }
private EqualityNode<String> newIsReferralEqualityNode( LdapSession session ) throws Exception { EqualityNode<String> ocIsReferral = new EqualityNode<String>( SchemaConstants.OBJECT_CLASS_AT, new Value( objectClassAT, SchemaConstants.REFERRAL_OC ).getValue() ); return ocIsReferral; }
/** * {@inheritDoc} */ @Override public Object normalizeByName( String name, byte[] value ) throws LdapException { AttributeType attributeType = schemaManager.getAttributeType( name ); return new Value( attributeType, value ); }
/** * Deserialize a Value. It will return a new Value instance. * * @param attributeType The AttributeType associated with the Value. Can be null * @param in The input stream * @return A new Value instance * @throws IOException If the stream can't be read * @throws ClassNotFoundException If we can't instanciate a Value */ public static Value deserialize( AttributeType attributeType, ObjectInput in ) throws IOException, ClassNotFoundException { Value value = new Value( attributeType ); value.readExternal( in ); return value; }
/** * Normalize a Value * * @param value The value to normalize * @return The normalized value * @exception LdapException If teh value cannot be normalized or is invalid */ public Value normalize( Value value ) throws LdapException { String normalized = normalize( value.getValue() ); return new Value( normalized ); }
/** * Normalize a Value * * @param value The value to normalize * @return The normalized value * @exception LdapException If teh value cannot be normalized or is invalid */ public Value normalize( Value value ) throws LdapException { String normalized = normalize( value.getValue() ); return new Value( normalized ); }
/** * Normalize a Value * * @param value The value to normalize * @return The normalized value * @exception LdapException If teh value cannot be normalized or is invalid */ public Value normalize( Value value ) throws LdapException { String normalized = normalize( value.getValue() ); return new Value( normalized ); }
/** * Constructs a filter expression tree for the filter used to search the * directory. * * @param schemaManager The server schemaManager to use for attribute lookups * @param principal the principal to use for building the filter * @return the filter expression tree * @throws Exception if there are problems while looking up attributes */ private static ExprNode getFilter( SchemaManager schemaManager, String principal ) throws Exception { AttributeType type = schemaManager.lookupAttributeTypeRegistry( KerberosAttribute.KRB5_PRINCIPAL_NAME_AT ); Value value = new Value( type, principal ); return new EqualityNode<String>( type, value ); }
/** * Constructs a new filter EqualityNode asserting that a candidate * objectClass is a referral. * * @param session the {@link LdapSession} to construct the node for * @return the {@link org.apache.directory.api.ldap.model.filter.EqualityNode} (objectClass=referral) non-normalized * @throws Exception in the highly unlikely event of schema related failures */ private EqualityNode<String> newIsReferralEqualityNode( LdapSession session ) throws Exception { AttributeType objectClassAT = session.getCoreSession().getDirectoryService().getAtProvider().getObjectClass(); EqualityNode<String> ocIsReferral = new EqualityNode<String>( objectClassAT, new Value( objectClassAT, SchemaConstants.REFERRAL_OC ) ); return ocIsReferral; }