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

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

public class AtavSerializer
extends java.lang.Object

A helper class which serialize and deserialize an AttributeTypeAndValue

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

Field Summary
protected static org.slf4j.Logger LOG
          The LoggerFactory used by this class
 
Constructor Summary
AtavSerializer()
           
 
Method Summary
static AttributeTypeAndValue deserialize(java.io.ObjectInput in)
          Deserialize an AttributeTypeAndValue object We read back the data to create a new ATAV.
static void serialize(AttributeTypeAndValue atav, java.io.ObjectOutput out)
          Serialize an AttributeTypeAndValue object.
 
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

AtavSerializer

public AtavSerializer()
Method Detail

serialize

public static void serialize(AttributeTypeAndValue atav,
                             java.io.ObjectOutput out)
                      throws java.io.IOException
Serialize an AttributeTypeAndValue object. An AttributeTypeAndValue is composed of a type and a value. The data are stored following the structure :
  • upName
  • The User provided ATAV
  • start
  • The position of this ATAV in the DN
  • length
  • The ATAV length
  • upType
  • The user Provided Type
  • normType
  • The normalized AttributeType
  • isHR
  • Tells if the value is a String or not

    if the value is a String :

  • upValue
  • The User Provided value.
  • value
  • The normalized value.

    if the value is binary :

  • upValueLength
  • upValue
  • The User Provided value.
  • valueLength
  • value
  • The normalized value.

    Parameters:
    atav - the AttributeTypeAndValue to serialize
    out - the OutputStream in which the atav will be serialized
    Throws:
    java.io.IOException - If we can't serialize the atav

    deserialize

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

    Parameters:
    in - the input stream
    Returns:
    The constructed AttributeTypeAndValue
    Throws:
    java.io.IOException - If the input stream can't be read


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