Class WhoAmIResponseDecorator
- java.lang.Object
-
- org.apache.directory.api.ldap.codec.api.MessageDecorator<M>
-
- org.apache.directory.api.ldap.codec.decorators.ResponseDecorator<R>
-
- org.apache.directory.api.ldap.codec.decorators.ExtendedResponseDecorator<WhoAmIResponse>
-
- org.apache.directory.api.ldap.extras.extended.ads_impl.whoAmI.WhoAmIResponseDecorator
-
- All Implemented Interfaces:
Asn1Object
,Decorator<WhoAmIResponse>
,WhoAmIResponse
,ExtendedResponse
,Message
,Response
,ResultResponse
public class WhoAmIResponseDecorator extends ExtendedResponseDecorator<WhoAmIResponse> implements WhoAmIResponse
A Decorator for WhoAmIResponse extended request.- Author:
- Apache Directory Project
-
-
Field Summary
-
Fields inherited from interface org.apache.directory.api.ldap.extras.extended.whoAmI.WhoAmIResponse
EXTENSION_OID
-
-
Constructor Summary
Constructors Constructor Description WhoAmIResponseDecorator(LdapApiService codec, WhoAmIResponse decoratedMessage)
Creates a new instance of WhoAmIResponseDecorator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
getAuthzId()
Get the authzid as a byte[]String
getAuthzIdString()
Get the authzid as String.Dn
getDn()
Get the DN authzid.String
getResponseName()
Overload the parent's getResponseName method, as the WhoAmI response should not contain the responseName.byte[]
getResponseValue()
Gets the Extended response payloadString
getUserId()
Get the UserIdboolean
isDnAuthzId()
boolean
isUserAuthzId()
void
setAuthzId(byte[] authzId)
set the authzidvoid
setResponseValue(byte[] responseValue)
sets the Extended response payload-
Methods inherited from class org.apache.directory.api.ldap.codec.decorators.ExtendedResponseDecorator
computeLength, encode, setResponseName
-
Methods inherited from class org.apache.directory.api.ldap.codec.decorators.ResponseDecorator
getLdapResult, setLdapResult
-
Methods inherited from class org.apache.directory.api.ldap.codec.api.MessageDecorator
addAllControls, addControl, get, getCodecService, getControl, getControls, getControlsLength, getCurrentControl, getDecorated, getDecorator, getMessageId, getMessageLength, getType, hasControl, put, removeControl, setControlsLength, setMessageId, setMessageLength, toString
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.directory.api.ldap.model.message.ExtendedResponse
setResponseName
-
Methods inherited from interface org.apache.directory.api.ldap.model.message.Message
addAllControls, addControl, get, getControl, getControls, getMessageId, getType, hasControl, put, removeControl, setMessageId
-
Methods inherited from interface org.apache.directory.api.ldap.model.message.ResultResponse
getLdapResult
-
-
-
-
Constructor Detail
-
WhoAmIResponseDecorator
public WhoAmIResponseDecorator(LdapApiService codec, WhoAmIResponse decoratedMessage)
Creates a new instance of WhoAmIResponseDecorator.- Parameters:
codec
- The LDAP service instancedecoratedMessage
- The decorated message
-
-
Method Detail
-
setResponseValue
public void setResponseValue(byte[] responseValue)
sets the Extended response payload- Overrides:
setResponseValue
in classExtendedResponseDecorator<WhoAmIResponse>
- Parameters:
responseValue
- The extended payload
-
getResponseValue
public byte[] getResponseValue()
Gets the Extended response payload- Overrides:
getResponseValue
in classExtendedResponseDecorator<WhoAmIResponse>
- Returns:
- The extended payload
-
getAuthzId
public byte[] getAuthzId()
Get the authzid as a byte[]- Specified by:
getAuthzId
in interfaceWhoAmIResponse
- Returns:
- The authzid or null
-
setAuthzId
public void setAuthzId(byte[] authzId)
set the authzid- Specified by:
setAuthzId
in interfaceWhoAmIResponse
- Parameters:
authzId
- The authzId to set
-
isDnAuthzId
public boolean isDnAuthzId()
- Specified by:
isDnAuthzId
in interfaceWhoAmIResponse
- Returns:
- true if the response contains a DN authz (dn:XXX)
-
isUserAuthzId
public boolean isUserAuthzId()
- Specified by:
isUserAuthzId
in interfaceWhoAmIResponse
- Returns:
- true if the response contains a userID authz (u:XXX)
-
getAuthzIdString
public String getAuthzIdString()
Get the authzid as String. We will strip out the 'dn:' or 'u:' part.- Specified by:
getAuthzIdString
in interfaceWhoAmIResponse
- Returns:
- The authzid or null
-
getUserId
public String getUserId()
Get the UserId- Specified by:
getUserId
in interfaceWhoAmIResponse
- Returns:
- The userId or null
-
getDn
public Dn getDn()
Get the DN authzid.- Specified by:
getDn
in interfaceWhoAmIResponse
- Returns:
- The DN or null
-
getResponseName
public String getResponseName()
Overload the parent's getResponseName method, as the WhoAmI response should not contain the responseName.- Specified by:
getResponseName
in interfaceExtendedResponse
- Overrides:
getResponseName
in classExtendedResponseDecorator<WhoAmIResponse>
- Returns:
- the OID of the extended response type.
-
-