|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.directory.shared.ldap.message.MessageEncoder
Encodes a Message instance into a binary message envelope using Basic Encoding rules flushing the PDU out to an OutputStream.
Constructor Summary | |
MessageEncoder(java.util.Hashtable env)
Creates a MessageEncoder using default properties for enabling a BER library provider. |
Method Summary | |
void |
encode(java.lang.Object obj)
Encodes a Message object peice by peice often emitting chunks of the final PDU to the callback if present. |
java.nio.ByteBuffer |
encodeBlocking(java.lang.Object obj)
Encodes a compiler stub specific ASN.1 message envelope containment tree into byte array. |
void |
encodeBlocking(java.lang.Object lock,
java.io.OutputStream out,
java.lang.Object obj)
Encodes a compiler stub specific ASN.1 message envelope containment tree onto an output stream. |
Provider |
getProvider()
Gets the Provider associated with this SPI implementation object. |
void |
setCallback(org.apache.directory.shared.asn1.codec.stateful.EncoderCallback cb)
Sets the callback of the underlying implementation. |
void |
setEncoderMonitor(org.apache.directory.shared.asn1.codec.stateful.EncoderMonitor monitor)
Sets the monitor of the underlying implementation. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MessageEncoder(java.util.Hashtable env) throws MessageException
env
- The Map of environment parameters.
MessageException
- if the encoder cannot be created.Method Detail |
public void encodeBlocking(java.lang.Object lock, java.io.OutputStream out, java.lang.Object obj) throws ProviderException
ProviderEncoder
encodeBlocking
in interface ProviderEncoder
lock
- lock object used to exclusively write to the output streamout
- the OutputStream to encode the message envelope onto.obj
- the top-level message envelope stub instance, i.e. for the
Snacc4J service provider this would be an instance of the
LDAPMessage compiler generated stub class.
ProviderException
- to indicate an error while attempting to encode the message
envelope onto the output stream. Provider specific exceptions
encountered while encoding can be held within this subclass
of MultiException.ProviderEncoder.encodeBlocking(Object, java.io.OutputStream, Object)
public java.nio.ByteBuffer encodeBlocking(java.lang.Object obj) throws ProviderException
ProviderEncoder
encodeBlocking
in interface ProviderEncoder
obj
- the top-level message envelope stub instance, i.e. for the
Snacc4J service provider this would be an instance of the
LDAPMessage compiler generated stub class.
ProviderException
- to indicate an error while attempting to encode the message
envelope into a byte buffer. Provider specific exceptions
encountered while encoding can be held within this subclass
of MultiException.ProviderEncoder.encodeBlocking(Object)
public Provider getProvider()
ProviderObject
getProvider
in interface ProviderObject
ProviderObject.getProvider()
public void encode(java.lang.Object obj) throws org.apache.directory.shared.asn1.codec.EncoderException
encode
in interface org.apache.directory.shared.asn1.codec.stateful.StatefulEncoder
obj
- the message object to encode into a PDU
org.apache.directory.shared.asn1.codec.EncoderException
- if there are problems while encodingggpublic void setCallback(org.apache.directory.shared.asn1.codec.stateful.EncoderCallback cb)
setCallback
in interface org.apache.directory.shared.asn1.codec.stateful.StatefulEncoder
cb
- the callback to set on the underlying provider specific
encoderpublic void setEncoderMonitor(org.apache.directory.shared.asn1.codec.stateful.EncoderMonitor monitor)
setEncoderMonitor
in interface org.apache.directory.shared.asn1.codec.stateful.StatefulEncoder
monitor
- the monitor to set on the underlying implementation
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |