Interface Asn1Container
-
- All Known Implementing Classes:
AbstractContainer
,AdDirSyncContainer
,AdPolicyHintsContainer
,CancelContainer
,CertGenerationContainer
,ControlsContainer
,EndTransactionRequestContainer
,EndTransactionResponseContainer
,EntryChangeContainer
,GracefulDisconnectContainer
,GracefulShutdownContainer
,LdapMessageContainer
,PagedResultsContainer
,PasswordModifyRequestContainer
,PasswordModifyResponseContainer
,PasswordPolicyContainer
,PersistentSearchContainer
,SortRequestContainer
,SortResponseContainer
,StoredProcedureContainer
,SubentriesContainer
,SyncDoneValueContainer
,SyncInfoValueContainer
,SyncRequestValueContainer
,SyncStateValueContainer
,VirtualListViewRequestContainer
,VirtualListViewResponseContainer
,WhoAmIResponseContainer
public interface Asn1Container
Every ASN1 container must implement this interface.- Author:
- Apache Directory Project
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TLV
getCurrentTLV()
Gets the currentTLVint
getDecodedBytes()
Grammar
getGrammar()
Gets the grammarint
getMaxPDUSize()
int
getNewTlvId()
Gets a new TLV idTLV
getParentTLV()
TLVStateEnum
getState()
Gets the current grammar stateByteBuffer
getStream()
Gets the current stream containing the bytes to decodeint
getTlvId()
Gets the current TLV idEnum<?>
getTransition()
Gets the transitionvoid
incrementDecodedBytes(int nb)
Increment the decodedBytes by the latest received buffer's size.boolean
isGathering()
boolean
isGrammarEndAllowed()
Checks that we can have a end state after this transitionvoid
rewind()
Move backward in the stream to the first byte for a given TLV.void
setCurrentTLV(TLV tlv)
Sets the current TLVvoid
setDecodedBytes(int decodedBytes)
void
setGathering(boolean isGathering)
Set the isGathering flagvoid
setGrammar(Grammar<?> grammar)
Sets the grammarvoid
setGrammarEndAllowed(boolean grammarEndAllowed)
Sets the flag to allow a end transitionvoid
setMaxPDUSize(int maxPDUSize)
Set the maximum PDU size.void
setParentTLV(TLV parentTLV)
Sets the parent TLVvoid
setState(TLVStateEnum state)
Sets the new current statevoid
setStream(ByteBuffer stream)
Stores the Stream being decodedvoid
setTransition(Enum<?> transition)
Updates the transition from a state to anothervoid
updateParent()
Update the parent's length
-
-
-
Method Detail
-
getStream
ByteBuffer getStream()
Gets the current stream containing the bytes to decode- Returns:
- The current stream
-
setStream
void setStream(ByteBuffer stream)
Stores the Stream being decoded- Parameters:
stream
- The stream being decoded
-
getState
TLVStateEnum getState()
Gets the current grammar state- Returns:
- Returns the current grammar state
-
setState
void setState(TLVStateEnum state)
Sets the new current state- Parameters:
state
- The new state
-
getCurrentTLV
TLV getCurrentTLV()
Gets the currentTLV- Returns:
- Returns the current TLV being decoded
-
setCurrentTLV
void setCurrentTLV(TLV tlv)
Sets the current TLV- Parameters:
tlv
- The current TLV
-
getGrammar
Grammar getGrammar()
Gets the grammar- Returns:
- Returns the grammar used to decode a LdapMessage.
-
setGrammar
void setGrammar(Grammar<?> grammar)
Sets the grammar- Parameters:
grammar
- The grammar to set
-
getTransition
Enum<?> getTransition()
Gets the transition- Returns:
- Returns the transition from the previous state to the new state
-
setTransition
void setTransition(Enum<?> transition)
Updates the transition from a state to another- Parameters:
transition
- The transition to set
-
getParentTLV
TLV getParentTLV()
- Returns:
- The parent TLV.
-
setParentTLV
void setParentTLV(TLV parentTLV)
Sets the parent TLV- Parameters:
parentTLV
- The new parent TLV
-
isGrammarEndAllowed
boolean isGrammarEndAllowed()
Checks that we can have a end state after this transition- Returns:
- true if this can be the last transition
-
setGrammarEndAllowed
void setGrammarEndAllowed(boolean grammarEndAllowed)
Sets the flag to allow a end transition- Parameters:
grammarEndAllowed
- true or false, depending on the next transition being an end or not.
-
getNewTlvId
int getNewTlvId()
Gets a new TLV id- Returns:
- a unique value representing the current TLV id
-
getTlvId
int getTlvId()
Gets the current TLV id- Returns:
- a unique value representing the current TLV id
-
getDecodedBytes
int getDecodedBytes()
- Returns:
- The number of decoded bytes for this message. This is used to control the PDU size and avoid PDU exceeding the maximum allowed size to break the server.
-
setDecodedBytes
void setDecodedBytes(int decodedBytes)
- Parameters:
decodedBytes
- The number of decoded bytes for this message.
-
incrementDecodedBytes
void incrementDecodedBytes(int nb)
Increment the decodedBytes by the latest received buffer's size.- Parameters:
nb
- The buffer size.
-
getMaxPDUSize
int getMaxPDUSize()
- Returns:
- The maximum PDU size.
-
setMaxPDUSize
void setMaxPDUSize(int maxPDUSize)
Set the maximum PDU size.- Parameters:
maxPDUSize
- The maximum PDU size (if negative or null, will be replaced by the max integer value)
-
rewind
void rewind()
Move backward in the stream to the first byte for a given TLV. This is useful when we have read some Tag and Length in order to define the next transition, and if this transition do a grammar switch.
-
updateParent
void updateParent()
Update the parent's length
-
isGathering
boolean isGathering()
- Returns:
- true if the container should gather the value into itself, false if the decoding of the Value part should be done immediately for constructed types.
-
setGathering
void setGathering(boolean isGathering)
Set the isGathering flag- Parameters:
isGathering
- true to ask the Asn1Decoder to gather the data into the container. If not set, the default value is 'false'
-
-