Class ProxiedAuthzDecorator
- java.lang.Object
-
- org.apache.directory.api.ldap.codec.api.ControlDecorator<ProxiedAuthz>
-
- org.apache.directory.api.ldap.codec.controls.proxiedauthz.ProxiedAuthzDecorator
-
- All Implemented Interfaces:
Asn1Object
,CodecControl<ProxiedAuthz>
,Decorator<ProxiedAuthz>
,Control
,ProxiedAuthz
public class ProxiedAuthzDecorator extends ControlDecorator<ProxiedAuthz> implements ProxiedAuthz
An ProxiedAuthz implementation, that wraps and decorates the Control with codec specific functionality.- Author:
- Apache Directory Project
-
-
Field Summary
-
Fields inherited from interface org.apache.directory.api.ldap.model.message.controls.ProxiedAuthz
OID
-
-
Constructor Summary
Constructors Constructor Description ProxiedAuthzDecorator(LdapApiService codec)
Creates a new instance of ProxiedAuthzDecoder wrapping a newly created ProxiedAuthz Control object.ProxiedAuthzDecorator(LdapApiService codec, ProxiedAuthz control)
Creates a new instance of ProxiedAuthzDecorator wrapping the supplied ProxiedAuthz Control.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
computeLength()
Compute the ProxiedAuthzControl lengthAsn1Object
decode(byte[] controlBytes)
Decodes raw ASN.1 encoded bytes into an Asn1Object for the control.ByteBuffer
encode(ByteBuffer buffer)
Encodes the ProxiedAuthz control.String
getAuthzId()
byte[]
getValue()
Get the control valuevoid
setAuthzId(String authzId)
-
Methods inherited from class org.apache.directory.api.ldap.codec.api.ControlDecorator
equals, getCodecService, getDecorated, getOid, hashCode, hasValue, isCritical, setCritical, setDecorated, setValue, toString
-
Methods inherited from interface org.apache.directory.api.ldap.model.message.Control
getOid, isCritical, setCritical
-
-
-
-
Constructor Detail
-
ProxiedAuthzDecorator
public ProxiedAuthzDecorator(LdapApiService codec)
Creates a new instance of ProxiedAuthzDecoder wrapping a newly created ProxiedAuthz Control object.- Parameters:
codec
- The LDAP service instance
-
ProxiedAuthzDecorator
public ProxiedAuthzDecorator(LdapApiService codec, ProxiedAuthz control)
Creates a new instance of ProxiedAuthzDecorator wrapping the supplied ProxiedAuthz Control.- Parameters:
codec
- The LDAP service instancecontrol
- The ProxiedAuthz Control to be decorated.
-
-
Method Detail
-
computeLength
public int computeLength()
Compute the ProxiedAuthzControl length0x04 L1 authzId]
- Specified by:
computeLength
in interfaceAsn1Object
- Returns:
- the control length.
-
encode
public ByteBuffer encode(ByteBuffer buffer) throws EncoderException
Encodes the ProxiedAuthz control.- Specified by:
encode
in interfaceAsn1Object
- Parameters:
buffer
- The encoded sink- Returns:
- A ByteBuffer that contains the encoded PDU
- Throws:
EncoderException
- If anything goes wrong.
-
getValue
public byte[] getValue()
Get the control value- Specified by:
getValue
in interfaceCodecControl<ProxiedAuthz>
- Overrides:
getValue
in classControlDecorator<ProxiedAuthz>
- Returns:
- The control value
-
getAuthzId
public String getAuthzId()
- Specified by:
getAuthzId
in interfaceProxiedAuthz
- Returns:
- The authzId
-
setAuthzId
public void setAuthzId(String authzId)
- Specified by:
setAuthzId
in interfaceProxiedAuthz
- Parameters:
authzId
- The authzId to set. Must be empty (not null), or a valid DN prefixed by 'dn:', or any user information prefixed by 'u:'
-
decode
public Asn1Object decode(byte[] controlBytes) throws DecoderException
Decodes raw ASN.1 encoded bytes into an Asn1Object for the control.- Specified by:
decode
in interfaceCodecControl<ProxiedAuthz>
- Parameters:
controlBytes
- the encoded control bytes- Returns:
- the decoded Asn1Object for the control
- Throws:
DecoderException
- if anything goes wrong
-
-