org.apache.directory.shared.ldap.name
Class RdnSerializer

java.lang.Object
  extended by org.apache.directory.shared.ldap.name.RdnSerializer

public class RdnSerializer
extends java.lang.Object

A helper class which serialize and deserialize a RDN

Version:
$Rev$, $Date$
Author:
Apache Directory Project

Field Summary
protected static org.slf4j.Logger LOG
          The LoggerFactory used by this class
 
Constructor Summary
RdnSerializer()
           
 
Method Summary
static RDN deserialize(java.io.ObjectInput in)
          Deserialize a RDN instance We read back the data to create a new RDB.
static void serialize(RDN rdn, java.io.ObjectOutput out)
          Serialize a RDN instance A RDN is composed of on to many ATAVs (AttributeType And Value).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

protected static final org.slf4j.Logger LOG
The LoggerFactory used by this class

Constructor Detail

RdnSerializer

public RdnSerializer()
Method Detail

serialize

public static void serialize(RDN rdn,
                             java.io.ObjectOutput out)
                      throws java.io.IOException
Serialize a RDN instance A RDN is composed of on to many ATAVs (AttributeType And Value). We should write all those ATAVs sequencially, following the structure :
  • nbAtavs
  • The number of ATAVs to write. Can't be 0.
  • upName
  • The User provided RDN
  • normName
  • The normalized RDN. It can be empty if the normalized name equals the upName.
  • atavs
  • For each ATAV :

  • start
  • The position of this ATAV in the upName string
  • length
  • The ATAV user provided length
  • Call the ATAV write method
  • The ATAV itself

    Parameters:
    rdn - The RDN to serialize
    out - the stream in which the RDN will be serialized
    Throws:
    java.io.IOException - If we can't write in this stream

    deserialize

    public static RDN deserialize(java.io.ObjectInput in)
                           throws java.io.IOException
    Deserialize a RDN instance We read back the data to create a new RDB. The structure read is exposed in the RDN.writeExternal(ObjectOutput) method

    Parameters:
    in - The input stream from which the RDN is read
    Returns:
    a deserialized RDN
    Throws:
    java.io.IOException - If the stream can't be read


    Copyright © 2003-2011 Apache Software Foundation. All Rights Reserved.