Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.service.protocol
Class AuthorizationResponse

java.lang.Object
  extended by net.java.sip.communicator.service.protocol.AuthorizationResponse

public class AuthorizationResponse
extends Object

This class is used to represent both incoming and outgoing AuthorizationResponse-s

An outgoing Authorization Response is to be created by the user interface when an authorization request has been received from the network. The user interface or any other bundle responsible of handling such responses is to implement the AuthoizationHandler interface and register itself with a protocol provider. Whenever a response needs to be sent the protocol provider would ask the the AuthorizationHandler to create one through the processAuthorizationRequest() method.

Incoming Authorization responses are delivered to the AuthorizationHandler implementation through the AuthorizationHandler.processAuthorizationResponse() method.

Author:
Emil Ivov

Nested Class Summary
static class AuthorizationResponse.AuthorizationResponseCode
          Authorization response codes represent unambiguous indication of the way a user or a remote party have acted upon an authorization request.
 
Field Summary
static AuthorizationResponse.AuthorizationResponseCode ACCEPT
          Indicates that the source authorization request which this response is about has been accepted and that the requestor may now proceed to adding the user to their contact list.
static AuthorizationResponse.AuthorizationResponseCode IGNORE
          Indicates that source authorization request which this response is about has been ignored and that no other indication will be sent to the requestor.
static AuthorizationResponse.AuthorizationResponseCode REJECT
          Indicates that source authorization request which this response is about has been rejected.
 
Constructor Summary
AuthorizationResponse(AuthorizationResponse.AuthorizationResponseCode responseCode, String reason)
          Creates an instance of an AuthorizationResponse with the specified responseCode and reason.
 
Method Summary
 String getReason()
          Returns a String containing additional explanations (might also be empty) of this response.
 AuthorizationResponse.AuthorizationResponseCode getResponseCode()
          Returns the response code that unambiguously represents the sense of this response.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACCEPT

public static final AuthorizationResponse.AuthorizationResponseCode ACCEPT
Indicates that the source authorization request which this response is about has been accepted and that the requestor may now proceed to adding the user to their contact list.


REJECT

public static final AuthorizationResponse.AuthorizationResponseCode REJECT
Indicates that source authorization request which this response is about has been rejected. A reason may also have been specified.


IGNORE

public static final AuthorizationResponse.AuthorizationResponseCode IGNORE
Indicates that source authorization request which this response is about has been ignored and that no other indication will be sent to the requestor.

Constructor Detail

AuthorizationResponse

public AuthorizationResponse(AuthorizationResponse.AuthorizationResponseCode responseCode,
                             String reason)
Creates an instance of an AuthorizationResponse with the specified responseCode and reason.

Parameters:
responseCode - AuthorizationResponseCode
reason - String
Method Detail

getReason

public String getReason()
Returns a String containing additional explanations (might also be empty) of this response.

Returns:
the reason the source user has given to explain this resonse and null or an empty string if no reason has been specified.

getResponseCode

public AuthorizationResponse.AuthorizationResponseCode getResponseCode()
Returns the response code that unambiguously represents the sense of this response.

Returns:
an AuthorizationResponseResponseCode instance determining the nature of the response.

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.