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

java.lang.Object
  extended by org.apache.directory.shared.ldap.codec.TwixDecoder
All Implemented Interfaces:
StatefulDecoder, ProviderDecoder, ProviderObject

public class TwixDecoder
extends Object
implements ProviderDecoder

The TwixDecoder decodes ASN.1 BER encoded PDUs.

Author:
Apache Directory Project

Constructor Summary
TwixDecoder(Provider provider, Set binaries)
          Creates an instance of a Twix Decoder implementation.
 
Method Summary
 void decode(Object encoded)
          Decodes a PDU
 Object decode(Object lock, InputStream in)
          Decodes a PDU from an input stream into a Snickers compiler generated stub envelope.
 Provider getProvider()
          Gets the Provider that this Decoder implementation is part of.
 void setCallback(DecoderCallback cb)
          Set the callback to call when the PDU has been decoded
 void setDecoderMonitor(DecoderMonitor monitor)
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TwixDecoder

public TwixDecoder(Provider provider,
                   Set binaries)
Creates an instance of a Twix Decoder implementation.

Parameters:
provider - the owning provider.
binaries - The binary attributes set
Method Detail

decode

public void decode(Object encoded)
            throws DecoderException
Decodes a PDU

Specified by:
decode in interface StatefulDecoder
Parameters:
encoded - The PDU containing the LdapMessage to decode
Throws:
DecoderExceptionIf - anything went wrong
DecoderException

decode

public Object decode(Object lock,
                     InputStream in)
              throws ProviderException
Decodes a PDU from an input stream into a Snickers compiler generated stub envelope.

Specified by:
decode in interface ProviderDecoder
Parameters:
lock - Lock object used to exclusively read from the input stream
in - The input stream to read and decode PDU bytes from
Returns:
return decoded stub
Throws:
ProviderException - to indicate an error while attempting to decode the message envelope onto the output stream. Provider specific exceptions encountered while decoding can be held within this subclass of MultiException.

getProvider

public Provider getProvider()
Gets the Provider that this Decoder implementation is part of.

Specified by:
getProvider in interface ProviderObject
Returns:
the owning provider.

setDecoderMonitor

public void setDecoderMonitor(DecoderMonitor monitor)
Deprecated. 

Not used ...

Specified by:
setDecoderMonitor in interface StatefulDecoder
Parameters:
monitor - to set for this StatefulDecoder

setCallback

public void setCallback(DecoderCallback cb)
Set the callback to call when the PDU has been decoded

Specified by:
setCallback in interface StatefulDecoder
Parameters:
cb - The callback


Copyright © 2004-2012. All Rights Reserved.