{scrollbar}

Introduction

AVA stands for AttributeTypeAndValue. It describes a container holding an AttributeType (...) associated with a Value in a Rdn. An example would be :

dc=example

where 'dc' is the AttributeType (...) and 'example' the associated value.

A user is not likely to manipulate such a class.

AVA is a final class, it can be schema aware. It's also a Externalizable class.

Usage

As for the Dn and Rdn classes, we have to hold two representation for the interned AttributeType (...) and Value : the User Provided form, and the normalized form. If the AVA is schema aware, we will use the AttributeType's Oid as the normalized form for the AttributeType (...), and the value will be normalized accordingly to the equality matching rule the AttributeType (...) defines, if any. Let's see some examples.

Schema Aware :

Here we will create an AVA and check that the user provided values are preserved. The getUpName() and getString() methods will give back this user provided form.

public void testAvaSimpleNorm() throws LdapException    {     Ava atav = new Ava( schemaManager, " CommonName ", " This is    a TEST " );     assertEquals( " CommonName = This is    a TEST ", atav.toString() );     assertEquals( "2.5.4.3=this is a test", atav.getNormName() );     assertEquals( " CommonName = This is    a TEST ", atav.getUpName() ); }

Note that the normalized value has transformed the AttributeType (...) and now uses its Oid, and the value has been lower cased and the superfluous spaces have been removed, as dictated by the CaseIgnoreMatch MatchingRule (e)

Not Schema Aware

The biggest difference in this case is that the AttributeType (...) will not be replaced by its Oid, but instead by a lower cased form of the provided ID. We also escape the leading and trailing spaces in the value.

public void testAvaSimpleNorm() throws LdapException { Ava atav = new Ava( null, " CommonName ", " This is a TEST " ); assertEquals( " CommonName = This is a TEST ", atav.toString() ); assertEquals( "commonname=\\ This is a TEST\\ ", atav.getNormName() ); assertEquals( " CommonName = This is a TEST ", atav.getUpName() ); }
  • No labels