hamsam.api
Class Response

java.lang.Object
  |
  +--hamsam.api.Response
All Implemented Interfaces:
java.io.Serializable

public class Response
extends java.lang.Object
implements java.io.Serializable

A response to allow or disallow a user request. There are scenarios where the user is asked to allow or disallow a request that came from another user. Some examples are request to add a user to another user's buddy list, an invitation for conference, and request for file transfer. If they disallow such requests, they are requested to give an explanation why they chose to disallow the request. This class encapsulates the choice that the user made as well as the explanation they gave, if any.

See Also:
Serialized Form

Constructor Summary
Response()
          Creates a response which accepts the request involved.
Response(java.lang.String message)
          Creates a response which rejects the request involved.
 
Method Summary
 java.lang.String getMessage()
          Returns the explanation for rejection of the request involved.
 boolean isAccepted()
          Determines if this response accepts the request involved.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Response

public Response()
Creates a response which accepts the request involved.


Response

public Response(java.lang.String message)
Creates a response which rejects the request involved.

Parameters:
message - the explanation for the rejection.
Method Detail

isAccepted

public boolean isAccepted()
Determines if this response accepts the request involved.

Returns:
true if the response accepts request involved, false otherwise.

getMessage

public java.lang.String getMessage()
Returns the explanation for rejection of the request involved.

Returns:
the explanation message if the request was rejected, null otherwise.