Class AddRequestDsml
- java.lang.Object
-
- org.apache.directory.api.dsmlv2.AbstractDsmlMessageDecorator<E>
-
- org.apache.directory.api.dsmlv2.request.AbstractRequestDsml<E>
-
- org.apache.directory.api.dsmlv2.request.AbstractResultResponseRequestDsml<AddRequest,AddResponse>
-
- org.apache.directory.api.dsmlv2.request.AddRequestDsml
-
- All Implemented Interfaces:
DsmlDecorator<AddRequest>
,AbandonableRequest
,AddRequest
,Message
,Request
,ResultResponseRequest
,SingleReplyRequest
public class AddRequestDsml extends AbstractResultResponseRequestDsml<AddRequest,AddResponse> implements AddRequest
DSML Decorator for AddRequest- Author:
- Apache Directory Project
-
-
Constructor Summary
Constructors Constructor Description AddRequestDsml(LdapApiService codec)
Creates a new getDecoratedMessage() of AddRequestDsml.AddRequestDsml(LdapApiService codec, AddRequest ldapMessage)
Creates a new getDecoratedMessage() of AddRequestDsml.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AddRequest
addAllControls(Control[] controls)
Adds an array of controls to this Message.void
addAttributeType(String type)
Create a new attributeValuevoid
addAttributeValue(byte[] value)
Add a new value to the current attributevoid
addAttributeValue(Object value)
Add a new value to the current attributevoid
addAttributeValue(String value)
Add a new value to the current attributevoid
addAttributeValue(Value value)
Add a new value to the current attributeAddRequest
addControl(Control control)
Adds a control to this Message.String
getCurrentAttributeType()
Entry
getEntry()
Get the entry with its attributes.Dn
getEntryDn()
Get the added DnMessageTypeEnum
getResponseType()
Gets the protocol response message type for this request which produces at least one response.MessageTypeEnum
getType()
Gets the LDAP message type code associated with this Message.void
initEntry()
Initialize the Entry.AddRequest
removeControl(Control control)
Deletes a control removing it from this Message.AddRequest
setEntry(Entry entry)
Sets the Entry to add.AddRequest
setEntryDn(Dn entryDn)
Sets the distinguished name of the entry to add.AddRequest
setMessageId(int messageId)
Sets the Message ID for this requestorg.dom4j.Element
toDsml(org.dom4j.Element root)
Creates the Request Element and adds RequestID and Controls.-
Methods inherited from class org.apache.directory.api.dsmlv2.request.AbstractResultResponseRequestDsml
abandon, addAbandonListener, computeLength, encode, getResultResponse, isAbandoned
-
Methods inherited from class org.apache.directory.api.dsmlv2.request.AbstractRequestDsml
hasResponse
-
Methods inherited from class org.apache.directory.api.dsmlv2.AbstractDsmlMessageDecorator
get, getCodecService, getControl, getControls, getCurrentControl, getDecorated, getMessageId, hasControl, put
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.directory.api.ldap.model.message.AbandonableRequest
abandon, addAbandonListener, isAbandoned
-
Methods inherited from interface org.apache.directory.api.ldap.model.message.Message
get, getControl, getControls, getMessageId, hasControl, put
-
Methods inherited from interface org.apache.directory.api.ldap.model.message.Request
hasResponse
-
Methods inherited from interface org.apache.directory.api.ldap.model.message.ResultResponseRequest
getResultResponse
-
-
-
-
Constructor Detail
-
AddRequestDsml
public AddRequestDsml(LdapApiService codec)
Creates a new getDecoratedMessage() of AddRequestDsml.- Parameters:
codec
- The LDAP Service to use
-
AddRequestDsml
public AddRequestDsml(LdapApiService codec, AddRequest ldapMessage)
Creates a new getDecoratedMessage() of AddRequestDsml.- Parameters:
codec
- The LDAP Service to useldapMessage
- the message to decorate
-
-
Method Detail
-
addAttributeType
public void addAttributeType(String type) throws LdapException
Create a new attributeValue- Parameters:
type
- The attribute's name (called 'type' in the grammar)- Throws:
LdapException
- If we can't add the type
-
getCurrentAttributeType
public String getCurrentAttributeType()
- Returns:
- Returns the currentAttribute type.
-
addAttributeValue
public void addAttributeValue(String value) throws LdapException
Add a new value to the current attribute- Parameters:
value
- The value to add- Throws:
LdapException
- If we can't add a new value
-
addAttributeValue
public void addAttributeValue(Value value) throws LdapException
Add a new value to the current attribute- Parameters:
value
- The value to add- Throws:
LdapException
- If we can't add a new value
-
addAttributeValue
public void addAttributeValue(byte[] value) throws LdapException
Add a new value to the current attribute- Parameters:
value
- The value to add- Throws:
LdapException
- If we can't add a new value
-
getType
public MessageTypeEnum getType()
Gets the LDAP message type code associated with this Message. Each request and response type has a unique message type code defined by the protocol in RFC 2251.- Specified by:
getType
in interfaceMessage
- Overrides:
getType
in classAbstractDsmlMessageDecorator<AddRequest>
- Returns:
- the message type code.
-
toDsml
public org.dom4j.Element toDsml(org.dom4j.Element root)
Creates the Request Element and adds RequestID and Controls.- Specified by:
toDsml
in interfaceDsmlDecorator<AddRequest>
- Overrides:
toDsml
in classAbstractResultResponseRequestDsml<AddRequest,AddResponse>
- Parameters:
root
- the root element- Returns:
- the Request Element of the given name containing
-
initEntry
public void initEntry()
Initialize the Entry.
-
getEntry
public Entry getEntry()
Get the entry with its attributes.- Specified by:
getEntry
in interfaceAddRequest
- Returns:
- Returns the entry.
-
addAttributeValue
public void addAttributeValue(Object value) throws LdapException
Add a new value to the current attribute- Parameters:
value
- The value to be added- Throws:
LdapException
- If we can't add a new value
-
getEntryDn
public Dn getEntryDn()
Get the added Dn- Specified by:
getEntryDn
in interfaceAddRequest
- Returns:
- Returns the entry Dn.
-
setEntryDn
public AddRequest setEntryDn(Dn entryDn)
Sets the distinguished name of the entry to add.- Specified by:
setEntryDn
in interfaceAddRequest
- Parameters:
entryDn
- the Dn of the added entry.- Returns:
- The AddRequest instance
-
setEntry
public AddRequest setEntry(Entry entry)
Sets the Entry to add.- Specified by:
setEntry
in interfaceAddRequest
- Parameters:
entry
- the added Entry- Returns:
- The AddRequest instance
-
setMessageId
public AddRequest setMessageId(int messageId)
Sets the Message ID for this request- Specified by:
setMessageId
in interfaceAddRequest
- Specified by:
setMessageId
in interfaceMessage
- Overrides:
setMessageId
in classAbstractDsmlMessageDecorator<AddRequest>
- Parameters:
messageId
- The message Id- Returns:
- A Message reference
-
addControl
public AddRequest addControl(Control control)
Adds a control to this Message.- Specified by:
addControl
in interfaceAddRequest
- Specified by:
addControl
in interfaceMessage
- Overrides:
addControl
in classAbstractDsmlMessageDecorator<AddRequest>
- Parameters:
control
- the control to add.- Returns:
- A Message reference
-
addAllControls
public AddRequest addAllControls(Control[] controls)
Adds an array of controls to this Message.- Specified by:
addAllControls
in interfaceAddRequest
- Specified by:
addAllControls
in interfaceMessage
- Overrides:
addAllControls
in classAbstractDsmlMessageDecorator<AddRequest>
- Parameters:
controls
- the controls to add.- Returns:
- A Message reference
-
removeControl
public AddRequest removeControl(Control control)
Deletes a control removing it from this Message.- Specified by:
removeControl
in interfaceAddRequest
- Specified by:
removeControl
in interfaceMessage
- Overrides:
removeControl
in classAbstractDsmlMessageDecorator<AddRequest>
- Parameters:
control
- the control to remove.- Returns:
- A Message reference
-
getResponseType
public MessageTypeEnum getResponseType()
Gets the protocol response message type for this request which produces at least one response.- Specified by:
getResponseType
in interfaceSingleReplyRequest
- Returns:
- the message type of the response.
-
-