public class EntryChangeDecorator extends ControlDecorator<EntryChange> implements EntryChange
Modifier and Type | Field and Description |
---|---|
static int |
UNDEFINED_CHANGE_NUMBER
Default value when no change number is provided
|
OID
Constructor and Description |
---|
EntryChangeDecorator(LdapApiService codec)
Creates a new instance of EntryChangeDecoder wrapping a newly created
EntryChange Control object.
|
EntryChangeDecorator(LdapApiService codec,
EntryChange control)
Creates a new instance of EntryChangeDecorator wrapping the supplied
EntryChange Control.
|
Modifier and Type | Method and Description |
---|---|
int |
computeLength()
Compute the EntryChangeControl length
|
Asn1Object |
decode(byte[] controlBytes)
Decodes raw ASN.1 encoded bytes into an Asn1Object for the control.
|
ByteBuffer |
encode(ByteBuffer buffer)
Encodes the entry change control.
|
long |
getChangeNumber() |
ChangeType |
getChangeType() |
Dn |
getPreviousDn() |
byte[] |
getValue()
Get the control value
|
void |
setChangeNumber(long changeNumber)
Sets the ChangeNumber
|
void |
setChangeType(ChangeType changeType)
Set the ChangeType
|
void |
setPreviousDn(Dn previousDn)
Sets the previous DN
|
equals, getCodecService, getDecorated, getOid, hashCode, hasValue, isCritical, setCritical, setDecorated, setValue, toString
getOid, isCritical, setCritical
public static final int UNDEFINED_CHANGE_NUMBER
public EntryChangeDecorator(LdapApiService codec)
codec
- The LDAP service instancepublic EntryChangeDecorator(LdapApiService codec, EntryChange control)
codec
- The LDAP service instancecontrol
- The EntryChange Control to be decorated.public int computeLength()
0x30 L1 | +--> 0x0A 0x0(1-4) [1|2|4|8] (changeType) [+--> 0x04 L2 previousDN] [+--> 0x02 0x0(1-4) [0..2^63-1] (changeNumber)]
computeLength
in interface Asn1Object
computeLength
in interface Decorator<EntryChange>
computeLength
in class ControlDecorator<EntryChange>
public ByteBuffer encode(ByteBuffer buffer) throws EncoderException
encode
in interface Asn1Object
encode
in interface Decorator<EntryChange>
buffer
- The encoded sinkEncoderException
- If anything goes wrong.public byte[] getValue()
getValue
in interface CodecControl<EntryChange>
getValue
in class ControlDecorator<EntryChange>
public ChangeType getChangeType()
getChangeType
in interface EntryChange
public void setChangeType(ChangeType changeType)
setChangeType
in interface EntryChange
changeType
- Add, Delete; Modify or ModifyDNpublic Dn getPreviousDn()
getPreviousDn
in interface EntryChange
public void setPreviousDn(Dn previousDn)
setPreviousDn
in interface EntryChange
previousDn
- The previous DNpublic long getChangeNumber()
getChangeNumber
in interface EntryChange
public void setChangeNumber(long changeNumber)
setChangeNumber
in interface EntryChange
changeNumber
- The ChanegNumberpublic Asn1Object decode(byte[] controlBytes) throws DecoderException
decode
in interface CodecControl<EntryChange>
controlBytes
- the encoded control bytesDecoderException
- if anything goes wrongCopyright © 2003–2018 The Apache Software Foundation. All rights reserved.