public final class MessageDecoder extends Object implements ProviderDecoder
Constructor and Description |
---|
MessageDecoder(BinaryAttributeDetector binaryAttributeDetector)
Creates a MessageDecoder using default properties for enabling a BER
library provider.
|
MessageDecoder(BinaryAttributeDetector binaryAttributeDetector,
int maxPDUSize)
Creates a MessageDecoder using default properties for enabling a BER
library provider.
|
Modifier and Type | Method and Description |
---|---|
void |
decode(Object chunk)
Decodes a chunk of stream data returning any resultant decoded PDU via a
callback.
|
Object |
decode(Object lock,
InputStream in)
Reads and decodes a BER encoded LDAPv3 ASN.1 message envelope structure
from an input stream to build a fully populated Message object instance.
|
Provider |
getProvider()
Gets the Provider associated with this SPI implementation object.
|
void |
setCallback(DecoderCallback cb)
Sets the callback used to deliver completly decoded PDU's.
|
void |
setDecoderMonitor(DecoderMonitor monitor)
Sets the monitor for this MessageDecoder which receives callbacks for
noteworthy events during decoding.
|
public MessageDecoder(BinaryAttributeDetector binaryAttributeDetector) throws MessageException
binaryAttributeDetector
- detects whether or not an attribute is binaryMessageException
- if there is a problem creating this decoder.public MessageDecoder(BinaryAttributeDetector binaryAttributeDetector, int maxPDUSize) throws MessageException
binaryAttributeDetector
- detects whether or not an attribute is binarymaxPDUSize
- the maximum size a PDU can beMessageException
- if there is a problem creating this decoder.public Object decode(Object lock, InputStream in) throws MessageException
decode
in interface ProviderDecoder
lock
- lock object used to exclusively read from the input streamin
- the input stream to read PDU data from.MessageException
- if there is a problem decoding.public void decode(Object chunk) throws MessageException
decode
in interface StatefulDecoder
chunk
- the chunk to decodeMessageException
- if there are failures while decoding the chunkpublic void setCallback(DecoderCallback cb)
setCallback
in interface StatefulDecoder
cb
- the callback to use for decoded PDU deliverypublic void setDecoderMonitor(DecoderMonitor monitor)
setDecoderMonitor
in interface StatefulDecoder
monitor
- the monitor to receive notifications via callback eventspublic Provider getProvider()
ProviderObject
getProvider
in interface ProviderObject
Copyright © 2003–2014 The Apache Software Foundation. All rights reserved.