org.apache.directory.api.ldap.model.message
Class AbstractExtendedRequest<R extends ExtendedResponse>

java.lang.Object
  extended by org.apache.directory.api.ldap.model.message.AbstractMessage
      extended by org.apache.directory.api.ldap.model.message.AbstractRequest
          extended by org.apache.directory.api.ldap.model.message.AbstractExtendedRequest<R>
All Implemented Interfaces:
ExtendedRequest<R>, Message, Request, ResultResponseRequest<R>, SingleReplyRequest<R>

public abstract class AbstractExtendedRequest<R extends ExtendedResponse>
extends AbstractRequest
implements ExtendedRequest<R>

ExtendedRequest implementation.

Author:
Apache Directory Project

Field Summary
protected  R response
          The associated response
 
Fields inherited from class org.apache.directory.api.ldap.model.message.AbstractMessage
controls
 
Fields inherited from interface org.apache.directory.api.ldap.model.message.ExtendedRequest
RESP_TYPE, TYPE
 
Constructor Summary
AbstractExtendedRequest()
          Creates an ExtendedRequest implementing object used to perform extended protocol operation on the server.
AbstractExtendedRequest(int id)
          Creates an ExtendedRequest implementing object used to perform extended protocol operation on the server.
 
Method Summary
 ExtendedRequest<R> addAllControls(Control[] controls)
          Adds an array of controls to this Message.
 ExtendedRequest<R> addControl(Control control)
          Adds a control to this Message.
 boolean equals(Object obj)
          Checks to see if an object equals this ExtendedRequest.
 String getRequestName()
          Gets the Object Identifier corresponding to the extended request type.
 MessageTypeEnum getResponseType()
          Gets the protocol response message type for this request which produces at least one response.
abstract  R getResultResponse()
          The result containing response for this request.
 int hashCode()
          
 ExtendedRequest<R> removeControl(Control control)
          Deletes a control removing it from this Message.
 ExtendedRequest<R> setMessageId(int messageId)
          Sets the Message ID for this request
 ExtendedRequest<R> setRequestName(String newOid)
          Sets the Object Identifier corresponding to the extended request type.
 String toString()
          Get a String representation of an Extended Request
 
Methods inherited from class org.apache.directory.api.ldap.model.message.AbstractRequest
hasResponse
 
Methods inherited from class org.apache.directory.api.ldap.model.message.AbstractMessage
get, getControl, getControls, getMessageId, getType, hasControl, put, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.directory.api.ldap.model.message.Request
hasResponse
 
Methods inherited from interface org.apache.directory.api.ldap.model.message.Message
get, getControl, getControls, getMessageId, getType, hasControl, put
 

Field Detail

response

protected R extends ExtendedResponse response
The associated response

Constructor Detail

AbstractExtendedRequest

public AbstractExtendedRequest()
Creates an ExtendedRequest implementing object used to perform extended protocol operation on the server.


AbstractExtendedRequest

public AbstractExtendedRequest(int id)
Creates an ExtendedRequest implementing object used to perform extended protocol operation on the server.

Parameters:
id - the sequential message identifier
Method Detail

getRequestName

public String getRequestName()
Gets the Object Identifier corresponding to the extended request type. This is the requestName portion of the ext. req. PDU.

Specified by:
getRequestName in interface ExtendedRequest<R extends ExtendedResponse>
Returns:
the dotted-decimal representation as a String of the OID

setRequestName

public ExtendedRequest<R> setRequestName(String newOid)
Sets the Object Identifier corresponding to the extended request type.

Specified by:
setRequestName in interface ExtendedRequest<R extends ExtendedResponse>
Parameters:
newOid - the dotted-decimal representation as a String of the OID
Returns:
The ExtendedRequest instance

setMessageId

public ExtendedRequest<R> setMessageId(int messageId)
Sets the Message ID for this request

Specified by:
setMessageId in interface ExtendedRequest<R extends ExtendedResponse>
Specified by:
setMessageId in interface Message
Overrides:
setMessageId in class AbstractMessage
Parameters:
messageId - The message Id
Returns:
A Message reference

addControl

public ExtendedRequest<R> addControl(Control control)
                                                       throws MessageException
Adds a control to this Message.

Specified by:
addControl in interface ExtendedRequest<R extends ExtendedResponse>
Specified by:
addControl in interface Message
Overrides:
addControl in class AbstractMessage
Parameters:
control - the control to add.
Returns:
A Message reference
Throws:
MessageException - if controls cannot be added to this Message or the control is not known etc.

addAllControls

public ExtendedRequest<R> addAllControls(Control[] controls)
                                                           throws MessageException
Adds an array of controls to this Message.

Specified by:
addAllControls in interface ExtendedRequest<R extends ExtendedResponse>
Specified by:
addAllControls in interface Message
Overrides:
addAllControls in class AbstractMessage
Parameters:
controls - the controls to add.
Returns:
A Message reference
Throws:
MessageException - if controls cannot be added to this Message or they are not known etc.

removeControl

public ExtendedRequest<R> removeControl(Control control)
                                                          throws MessageException
Deletes a control removing it from this Message.

Specified by:
removeControl in interface ExtendedRequest<R extends ExtendedResponse>
Specified by:
removeControl in interface Message
Overrides:
removeControl in class AbstractMessage
Parameters:
control - the control to remove.
Returns:
A Message reference
Throws:
MessageException - if controls cannot be added to this Message or the control is not known etc.

getResponseType

public MessageTypeEnum getResponseType()
Gets the protocol response message type for this request which produces at least one response.

Specified by:
getResponseType in interface SingleReplyRequest<R extends ExtendedResponse>
Returns:
the message type of the response.

getResultResponse

public abstract R getResultResponse()
The result containing response for this request.

Specified by:
getResultResponse in interface ResultResponseRequest<R extends ExtendedResponse>
Returns:
the result containing response for this request

hashCode

public int hashCode()

Overrides:
hashCode in class AbstractRequest
Returns:
the instance's hash code
See Also:
Object.hashCode()

equals

public boolean equals(Object obj)
Checks to see if an object equals this ExtendedRequest.

Overrides:
equals in class AbstractRequest
Parameters:
obj - the object to be checked for equality
Returns:
true if the obj equals this ExtendedRequest, false otherwise

toString

public String toString()
Get a String representation of an Extended Request

Overrides:
toString in class Object
Returns:
an Extended Request String


Copyright © 2003-2013 The Apache Software Foundation. All Rights Reserved.