Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.gui.main.authorization
Class AuthorizationHandlerImpl

java.lang.Object
  extended by net.java.sip.communicator.impl.gui.main.authorization.AuthorizationHandlerImpl
All Implemented Interfaces:
AuthorizationHandler

public class AuthorizationHandlerImpl
extends Object
implements AuthorizationHandler

The AuthorizationHandlerImpl is an implementation of the AuthorizationHandler interface, which is used by the protocol provider in order to make the user act upon requests coming from contacts that would like to add us to their contact list or simply track our presence status, or whenever a subscription request has failed for a particular contact because we need to first generate an authorization request demanding permission to subscibe.

Author:
Yana Stamcheva

Constructor Summary
AuthorizationHandlerImpl(MainFrame mainFrame)
           
 
Method Summary
 AuthorizationRequest createAuthorizationRequest(Contact contact)
          Implements the AuthorizationHandler.createAuthorizationRequest method.
 AuthorizationResponse processAuthorisationRequest(AuthorizationRequest req, Contact sourceContact)
          Implements the AuthorizationHandler.processAuthorisationRequest method.
 void processAuthorizationResponse(AuthorizationResponse response, Contact sourceContact)
          Implements the AuthorizationHandler.processAuthorizationResponse method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuthorizationHandlerImpl

public AuthorizationHandlerImpl(MainFrame mainFrame)
Method Detail

processAuthorisationRequest

public AuthorizationResponse processAuthorisationRequest(AuthorizationRequest req,
                                                         Contact sourceContact)
Implements the AuthorizationHandler.processAuthorisationRequest method.

Called by the protocol provider whenever someone would like to add us to their contact list.

Specified by:
processAuthorisationRequest in interface AuthorizationHandler
Parameters:
req - the authorization request that we should act upon.
sourceContact - a reference to the Contact demanding authorization
Returns:
a new authorization response instance indicating whether or not the request has been accepted and (if applicable) a reason for turning it down.

createAuthorizationRequest

public AuthorizationRequest createAuthorizationRequest(Contact contact)
Implements the AuthorizationHandler.createAuthorizationRequest method.

The method is called when the user has tried to add a contact to the contact list and this contact requires authorization.

Specified by:
createAuthorizationRequest in interface AuthorizationHandler
Parameters:
contact - the Contact whose authorization we'll be requesting.
Returns:
the AuthorizationRequest instance that the user interface has created, and which contains a reason phrase and/or a pre-request authorization grant.

processAuthorizationResponse

public void processAuthorizationResponse(AuthorizationResponse response,
                                         Contact sourceContact)
Implements the AuthorizationHandler.processAuthorizationResponse method.

The method will be called any whenever someone acts upone an authorization request that we have previously sent.

Specified by:
processAuthorizationResponse in interface AuthorizationHandler
Parameters:
response - the AuthorizationResponse that we have received.
sourceContact - a reference to the Contact demanding authorization

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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