Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Replaced ATAV by AVA, as suggested by Howard

...

Code Block
DN => n * RDN
RDN => m * ATAVAVA
ATAVAVA => AttributeType + AttributeValue
AttributeType => non sensitive String or an OID
AttributeValue => a String

Each RDN is separated from the other ones by a ',' or a ';' character.
Each ATAV AVA is separated from the other ones by a '+' character.
Attribute and values are separated by the '=' character.

...

The last point is that spaces are not meaningfull around the ',', ';', '+' and '=' character, nor they are at the beginning and end of each RDN, ATAVAVA, type and value. To be able to store a leading or trailing space into a value, a user must embed this value between two '"' characters.

...

As everyhting is a balance between those elements, we should favor the most frequent cases, which are pure ASCII DNs where RDN contains only one ATAVAVA, where value are not escaped.

...

  • attribute types are lower cased and spaces are removed around ',', ';', '=', and '+'
  • then attribute type are transformed to their OID counterpart to avoid having to deal with multiple form of the same attributeType (AT can have aliases, like CN, CommonNmae, and 2.5.4.4 which are all the same attributeType)
  • attribute values are normalized accordingly to their attributeType suyntax.
  • at the end, into a RDN, ATAV AVA will be ordered following the alphabetic increase order.

...

We have five objects to describe :

  • DN
  • RDN
  • ATAVAVA
  • Type
  • Value

The following paragraphs describe those ojects internal structure.

...

A RDN may contains more than one ATAVAVA, but usually contains only one. An optimization could be not to create an array to store more than one ATV, but instead keeping it in a single member. If we have more than one ATAVAVA, then we will create an array instead. The extra cost of creating this array is totally acceptable regarding the frequency of such multiple ATAVs AVAs in a RDN (which is very low). On the osther side, it forces the access metho to deal with the number of atavAVA, but this cost is obviously less than access an atav AVA through an ArrayList (to be double checked)

...

Code Block
	class RDN
		// The user provided form
		String upRdn;

		// The ATAVAVA if we have only one
		ATAVAVA atavava;

		// A flag set to true if we have only one ATAVAVA
		boolean isSingle;

		// An array of ATAVsAVAs if we have more than one
		List<ATAV>List<AVA> atavsavas;
Note

atavs AVAs are stored in alphabetic order ?

...

AVA internal structure

An ATAV AVA contains an attributeType and an attribute value. We could keep the String representation of an ATAV AVA internally, but as those members already have a String representation, and as we rarelly manipulate an ATAV AVA (except when creating it while decoding a DN), there is no need to store this duplicated information.

Code Block
	class ATAVAVA
		AttributeType type;
		AttributeValue value;

...