Authentication
API v8.1 SP2

com.rsa.ace.techservice.udpserver
Class AbstractAceResponse

java.lang.Object
  extended by com.rsa.ace.techservice.udpserver.AbstractAceResponse
All Implemented Interfaces:
AceResponse
Direct Known Subclasses:
AceAccessDenied, AceMsgResponse, AceNewPinResponse, AceNextCodeResponse, AceOKResponse, AceTimeRequestResponse, AceTimeResponse

public abstract class AbstractAceResponse
extends java.lang.Object
implements AceResponse

This abstract class implements many of the methods required for an AceResponse. It must be extended by classes representing a specific type of response. This class handles response processing common to all response classes.


Constructor Summary
AbstractAceResponse(AceDatagram packet, AceRequest request)
          Constructor to build a V5 response to the request provided.
AbstractAceResponse(AceRequest requestPacket)
          Constructor to build a V5 response to the request provided.
 
Method Summary
 void buildResponsePacket()
          Builds a response packet by writing the AceResponse to the byte-buffer.
 java.nio.ByteBuffer getBuffer()
          Get the response Byte-buffer.
 AcePacketHeader getHeader()
          This method provides the protocol version of the response packet.
 byte[] getNewNodeSecret()
          Used on the Agent side to get a new node secret from the Server.
 byte[] getNodeSecret()
           
 java.net.DatagramPacket getPacket()
          Get a response packet by writing the AceResponse to the byte-buffer.
 byte getProtocolVersion()
          Returns the protocol version of a response.
 AceRequest getRequestToThisResponse()
          Used on the Agent side to get data in the original request.
 byte getResponseMsgType()
          Returns the response message type for an Access-Denied response.
 int getResponseSize()
          Returns the size of a response.
 int getResponseStatus()
          This method provides the status for the response packet.
 AcePacketTrailer getTrailer()
           
 boolean haveNodeSecret()
          Common method for checking is we have a nodesecret.
 void processResponse()
          Reads a response packet by reading from the byte-buffer.
 java.nio.ByteBuffer readResponse()
          read the status.
 void setNodeSecret(byte[] buf)
          Common method for overide a nodesecret.Needed for older protocol
 java.lang.String toString()
          Converts the AbstractAceResponse to a string.
 void writeResponse(java.nio.ByteBuffer buf)
          Write an AceResponse header to the stream passed.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractAceResponse

public AbstractAceResponse(AceRequest requestPacket)
                    throws AcePacketException
Constructor to build a V5 response to the request provided. The original request is provided and supplies the data needed to construct a response.

Parameters:
requestPacket - The request packet to which this response is being created.
Throws:
AcePacketException - If any subordinate constructors encounter an error.

AbstractAceResponse

public AbstractAceResponse(AceDatagram packet,
                           AceRequest request)
                    throws AcePacketException
Constructor to build a V5 response to the request provided. The original request is provided and supplies the data needed to construct a response.

Parameters:
requestPacket - The request packet to which this response is being created.
Throws:
AcePacketException - If any subordinate constructors encounter an error.
Method Detail

writeResponse

public void writeResponse(java.nio.ByteBuffer buf)
                   throws AcePacketException
Write an AceResponse header to the stream passed. The header adds itself and this object adds the status. This is generally invoked via a "super.writeResponse()" call from a packet type implementation class.

Specified by:
writeResponse in interface AceResponse
Parameters:
buf - The byte buffer to which the response is writtem.
Throws:
AcePacketException - If there's a problem writing the data output stream.

buildResponsePacket

public void buildResponsePacket()
                         throws AcePacketException
Builds a response packet by writing the AceResponse to the byte-buffer.

Specified by:
buildResponsePacket in interface AceResponse
Throws:
AcePacketException - If there is a problem writing the packet byte-buffer.

processResponse

public void processResponse()
                     throws AcePacketException
Reads a response packet by reading from the byte-buffer.

Specified by:
processResponse in interface AceResponse
Throws:
AcePacketException - If there is a problem reading the packet byte-buffer.

setNodeSecret

public void setNodeSecret(byte[] buf)
                   throws AcePacketException
Common method for overide a nodesecret.Needed for older protocol

Throws:
AcePacketException

haveNodeSecret

public boolean haveNodeSecret()
Common method for checking is we have a nodesecret.

See Also:
getCircuitID

readResponse

public java.nio.ByteBuffer readResponse()
                                 throws AcePacketException
read the status. This is generally invoked via a "super.readResponse()" call from a packet type implementation class.

Specified by:
readResponse in interface AceResponse
Parameters:
buf - The byte buffer to which is the response.
Throws:
AcePacketException - If there's a problem writing the data output stream.

getPacket

public java.net.DatagramPacket getPacket()
                                  throws AcePacketException
Get a response packet by writing the AceResponse to the byte-buffer.

Specified by:
getPacket in interface AceResponse
Throws:
AcePacketException - If there is a problem writing the packet byte-buffer.

getResponseSize

public int getResponseSize()
Returns the size of a response. This should be overridden by classes needing larger, more complicated responses.

Specified by:
getResponseSize in interface AceResponse
Returns:
The size of the response packet.

getProtocolVersion

public byte getProtocolVersion()
Returns the protocol version of a response. This may be overridden by classes needing to return legacy protocol.

Specified by:
getProtocolVersion in interface AceResponse
Returns:
The size of the response packet.

getResponseMsgType

public byte getResponseMsgType()
Returns the response message type for an Access-Denied response.

Specified by:
getResponseMsgType in interface AceResponse
Returns:
The Time Request message type.

getResponseStatus

public int getResponseStatus()
Description copied from interface: AceResponse
This method provides the status for the response packet. Implementing classes override this method with one that returns response status.

Specified by:
getResponseStatus in interface AceResponse
Returns:
The protocol version of the response packet.

getBuffer

public java.nio.ByteBuffer getBuffer()
Get the response Byte-buffer.

Returns:
The output response byte buffer.

toString

public java.lang.String toString()
Converts the AbstractAceResponse to a string.

Specified by:
toString in interface AceResponse
Overrides:
toString in class java.lang.Object
Returns:
A String representation of the response.

getNodeSecret

public byte[] getNodeSecret()
Returns:
Returns the nodeSecret.

getHeader

public AcePacketHeader getHeader()
Description copied from interface: AceResponse
This method provides the protocol version of the response packet. Implementing classes override this method with one that returns the protocol version.

Specified by:
getHeader in interface AceResponse
Returns:
Returns the header.

getTrailer

public AcePacketTrailer getTrailer()
Specified by:
getTrailer in interface AceResponse
Returns:
Returns the trailer.

getNewNodeSecret

public byte[] getNewNodeSecret()
Used on the Agent side to get a new node secret from the Server.

Returns:
the new node secret from the Server.

getRequestToThisResponse

public AceRequest getRequestToThisResponse()
Used on the Agent side to get data in the original request.

Returns:
Returns the requestToThisResponse.

Authentication
API v8.1 SP2

Copyright © 1999 - 2011 EMC Corporation. All Rights Reserved.