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

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

public class TwixEncoder
extends java.lang.Object
implements ProviderEncoder

Twix LDAP BER provider's encoder.

Version:
$Rev: 379008 $
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(org.apache.directory.shared.asn1.codec.stateful.EncoderCallback cb)
          Set the callback called when the encoding is done.
 void setEncoderMonitor(org.apache.directory.shared.asn1.codec.stateful.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 org.apache.directory.shared.asn1.codec.EncoderException
Encodes a LdapMessage, and calls the callback

Specified by:
encode in interface org.apache.directory.shared.asn1.codec.stateful.StatefulEncoder
Parameters:
obj - The LdapMessage to encode
Throws:
org.apache.directory.shared.asn1.codec.EncoderException - If anything went wrong

setCallback

public void setCallback(org.apache.directory.shared.asn1.codec.stateful.EncoderCallback cb)
Set the callback called when the encoding is done.

Specified by:
setCallback in interface org.apache.directory.shared.asn1.codec.stateful.StatefulEncoder
Parameters:
cb - The callback.

setEncoderMonitor

public void setEncoderMonitor(org.apache.directory.shared.asn1.codec.stateful.EncoderMonitor monitor)
Deprecated.  

Not used ...

Specified by:
setEncoderMonitor in interface org.apache.directory.shared.asn1.codec.stateful.StatefulEncoder


Copyright © 2003-2006 . All Rights Reserved.