org.apache.directory.shared.ldap.codec
Class TwixEncoder

java.lang.Object
  extended by org.apache.directory.shared.ldap.codec.TwixEncoder
All Implemented Interfaces:
StatefulEncoder, ProviderEncoder, ProviderObject

public class TwixEncoder
extends java.lang.Object
implements ProviderEncoder

Twix LDAP BER provider's encoder.

Version:
$Rev: 664290 $
Author:
Apache Directory Project

Constructor Summary
TwixEncoder(Provider provider)
          Creates an instance of a Twix Encoder implementation.
 
Method Summary
 void encode(java.lang.Object obj)
          Encodes a LdapMessage, and calls the callback
 java.nio.ByteBuffer encodeBlocking(java.lang.Object obj)
          Encodes a LdapMessage, and return a ByteBuffer containing the resulting PDU
 void encodeBlocking(java.lang.Object lock, java.io.OutputStream out, java.lang.Object obj)
          Encodes a LdapMessage, and calls the callback.
 byte[] encodeToArray(java.lang.Object obj)
          Encodes a LdapMessage, and return a byte array containing the resulting PDU
 Provider getProvider()
          Gets the Provider associated with this SPI implementation object.
 void setCallback(EncoderCallback cb)
          Set the callback called when the encoding is done.
 void setEncoderMonitor(EncoderMonitor monitor)
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TwixEncoder

public TwixEncoder(Provider provider)
Creates an instance of a Twix Encoder implementation.

Parameters:
provider - The associated Provider
Method Detail

encodeBlocking

public void encodeBlocking(java.lang.Object lock,
                           java.io.OutputStream out,
                           java.lang.Object obj)
                    throws ProviderException
Encodes a LdapMessage, and calls the callback.

Specified by:
encodeBlocking in interface ProviderEncoder
Parameters:
lock - Not used...
out - Not used ...
obj - The LdapMessage to encode
Throws:
ProviderException - If anything went wrong

encodeBlocking

public java.nio.ByteBuffer encodeBlocking(java.lang.Object obj)
                                   throws ProviderException
Encodes a LdapMessage, and return a ByteBuffer containing the resulting PDU

Specified by:
encodeBlocking in interface ProviderEncoder
Parameters:
obj - The LdapMessage to encode
Returns:
The ByteBuffer containing the PDU
Throws:
ProviderException - If anything went wrong

encodeToArray

public byte[] encodeToArray(java.lang.Object obj)
                     throws ProviderException
Encodes a LdapMessage, and return a byte array containing the resulting PDU

Parameters:
obj - The LdapMessage to encode
Returns:
The byte[] containing the PDU
Throws:
ProviderException - If anything went wrong

getProvider

public Provider getProvider()
Gets the Provider associated with this SPI implementation object.

Specified by:
getProvider in interface ProviderObject
Returns:
Provider The provider

encode

public void encode(java.lang.Object obj)
            throws EncoderException
Encodes a LdapMessage, and calls the callback

Specified by:
encode in interface StatefulEncoder
Parameters:
obj - The LdapMessage to encode
Throws:
EncoderException - If anything went wrong

setCallback

public void setCallback(EncoderCallback cb)
Set the callback called when the encoding is done.

Specified by:
setCallback in interface StatefulEncoder
Parameters:
cb - The callback.

setEncoderMonitor

public void setEncoderMonitor(EncoderMonitor monitor)
Deprecated. 

Not used ...

Specified by:
setEncoderMonitor in interface StatefulEncoder
Parameters:
monitor - the monitor to set on the underlying implementation


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