Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.service.protocol
Interface SecurityAuthority

All Known Implementing Classes:
DefaultSecurityAuthority

public interface SecurityAuthority

Implemented by the user interface, this interface allows a protocol provider to asynchronously demand passwords necessary for authentication against various realms.

Or in other (simpler words) this is a callback or a hook that the UI would give a protocol provider so that the protocol provider could requestCredentials() when necessary (when a password is not available for a server, or once it has changed, or re-demand one after a faulty authentication)

Author:
Emil Ivov, Yana Stamcheva

Field Summary
static int AUTHENTICATION_REQUIRED
          Indicates that the reason for obtaining credentials is that an authentication is required.
static int CONNECTION_FAILED
          Indicates that the reason for obtaining credentials is that the last time a wrong user name has been provided.
static int WRONG_PASSWORD
          Indicates that the reason for obtaining credentials is that the last time a wrong password has been provided.
static int WRONG_USERNAME
          Indicates that the reason for obtaining credentials is that the last time a wrong user name has been provided.
 
Method Summary
 boolean isUserNameEditable()
          Indicates if the user name is currently editable, i.e.
 UserCredentials obtainCredentials(String realm, UserCredentials defaultValues)
          Returns a UserCredentials object associated with the specified realm, by specifying the reason of this operation.
 UserCredentials obtainCredentials(String realm, UserCredentials defaultValues, int reasonCode)
          Returns a UserCredentials object associated with the specified realm, by specifying the reason of this operation.
 void setUserNameEditable(boolean isUserNameEditable)
          Sets the userNameEditable property, which should indicate to the implementations of this interface if the user name could be changed by user or not.
 

Field Detail

AUTHENTICATION_REQUIRED

static final int AUTHENTICATION_REQUIRED
Indicates that the reason for obtaining credentials is that an authentication is required.

See Also:
Constant Field Values

WRONG_PASSWORD

static final int WRONG_PASSWORD
Indicates that the reason for obtaining credentials is that the last time a wrong password has been provided.

See Also:
Constant Field Values

WRONG_USERNAME

static final int WRONG_USERNAME
Indicates that the reason for obtaining credentials is that the last time a wrong user name has been provided.

See Also:
Constant Field Values

CONNECTION_FAILED

static final int CONNECTION_FAILED
Indicates that the reason for obtaining credentials is that the last time a wrong user name has been provided.

See Also:
Constant Field Values
Method Detail

obtainCredentials

UserCredentials obtainCredentials(String realm,
                                  UserCredentials defaultValues,
                                  int reasonCode)
Returns a UserCredentials object associated with the specified realm, by specifying the reason of this operation.

Parameters:
realm - The realm that the credentials are needed for.
defaultValues - the values to propose the user by default
reasonCode - indicates the reason for which we're obtaining the credentials.
Returns:
The credentials associated with the specified realm or null if none could be obtained.

obtainCredentials

UserCredentials obtainCredentials(String realm,
                                  UserCredentials defaultValues)
Returns a UserCredentials object associated with the specified realm, by specifying the reason of this operation.

Parameters:
realm - The realm that the credentials are needed for.
defaultValues - the values to propose the user by default
Returns:
The credentials associated with the specified realm or null if none could be obtained.

setUserNameEditable

void setUserNameEditable(boolean isUserNameEditable)
Sets the userNameEditable property, which should indicate to the implementations of this interface if the user name could be changed by user or not.

Parameters:
isUserNameEditable - indicates if the user name could be changed by user in the implementation of this interface.

isUserNameEditable

boolean isUserNameEditable()
Indicates if the user name is currently editable, i.e. could be changed by user or not.

Returns:
true if the user name could be changed, false - otherwise.

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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