|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.device.api.wlan.hotspot.HotspotCredentialsAgent
public abstract class HotspotCredentialsAgent
HotspotCredentialsAgent is an abstract class that must be extended by the class that manages a
hotspot client's credentials.
The client must pass an instance of this class to its HotspotClient.HotspotClient(net.rim.device.api.wlan.hotspot.HotspotCredentialsAgent, net.rim.device.api.wlan.hotspot.HotspotAuthenticationAgent, int)
constructor. The client can either
extend this class itself or use system's implementation by calling HotspotCredentialsAgent.getSystemHotspotCredentialsAgent()
.
HotspotCredentialsAgent.getCredentialsControlPreference()
HotspotCredentialsAgent.getPassword()
HotspotCredentialsAgent.getUsername()
HotspotCredentialsAgent.setCredentialsControlPreference(int)
HotspotCredentialsAgent.setPassword(java.lang.String)
HotspotCredentialsAgent.setUsername(java.lang.String)
HotspotCredentialsAgent.validateCredentials(java.lang.String, java.lang.String)
. Default implementation will return valid credentials for any input.HotspotCredentialsAgent.getSystemHotspotCredentialsAgent()
to retrieve new instance of system's implementation.HotspotClientRegistry
.
Field Summary | ||
---|---|---|
|
static int |
PREFERENCE_DEFAULT
The default setting of the credentials agent's preferences bitmask. |
|
static int |
PREFERENCE_HIDDEN_PASSWORD
When this bit of the preferences bitmask is set, the password field is invisible. |
|
static int |
PREFERENCE_HIDDEN_USERNAME
When this bit of the preferences bitmask is set, the username field is invisible. |
|
static int |
PREFERENCE_IMMUTABLE_PASSWORD
When this bit of the preferences bitmask is set, the user is not allowed to modify their password. |
|
static int |
PREFERENCE_IMMUTABLE_USERNAME
When this bit of the preferences bitmask is set, the user is not allowed to modify their username. |
Constructor Summary | ||
---|---|---|
|
HotspotCredentialsAgent()
Creates a new instance of HotspotCredentialsAgent. |
Method Summary | ||
---|---|---|
|
abstract int |
getCredentialsControlPreference()
Returns the credentials agent's preferences bitmask (int), which indicates which credentials the user may see and which they can modify. |
|
abstract String |
getPassword()
Retrieves the password for login. |
|
static HotspotCredentialsAgent |
getSystemHotspotCredentialsAgent()
Retrieves new instance of the system implementation of this abstract class. |
|
abstract String |
getUsername()
Retrieves the user's username for login. |
|
protected abstract void |
setCredentialsControlPreference(int control)
Sets the credentials agent's preferences bitmask, which indicates which credentials the user may see and which they can modify. |
|
abstract void |
setPassword(String password)
Sets a new password. |
|
abstract void |
setUsername(String username)
Sets a new username. |
|
boolean |
validateCredentials(String username,
String password)
Validates the credentials entered into the UI by the user. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int PREFERENCE_DEFAULT
public static final int PREFERENCE_IMMUTABLE_USERNAME
public static final int PREFERENCE_IMMUTABLE_PASSWORD
public static final int PREFERENCE_HIDDEN_USERNAME
public static final int PREFERENCE_HIDDEN_PASSWORD
Constructor Detail |
---|
public HotspotCredentialsAgent()
Method Detail |
---|
public abstract String getUsername() throws HotspotException
HotspotException
- thrown with HotspotException#CREDENTIALS_STORAGE_UNAVAILABLE
when the credentials storage is unavailable.public abstract String getPassword() throws HotspotException
HotspotException
- thrown with HotspotException#CREDENTIALS_STORAGE_UNAVAILABLE
when the credentials storage is unavailable.public abstract int getCredentialsControlPreference()
By default, the user can both see and modify their username and password.
PREFERENCE_
constants in this class.protected abstract void setCredentialsControlPreference(int control)
The parameter must be a bitmask assembled using the PREFERENCE_
constants:
HotspotCredentialsAgent.PREFERENCE_IMMUTABLE_USERNAME
bit is set then the user will not be allow to modify the username.HotspotCredentialsAgent.PREFERENCE_IMMUTABLE_PASSWORD
bit is set then the user will not be allow to modify the password.HotspotCredentialsAgent.PREFERENCE_HIDDEN_USERNAME
bit is set then the user interface will not show the username field to the user.HotspotCredentialsAgent.PREFERENCE_HIDDEN_PASSWORD
bit is set then the user interface will not show the password field to the user.HotspotCredentialsAgent.PREFERENCE_DEFAULT
may be used for default credentials bitmask.
The resulting credentials preferences bitmask can be retrieved using HotspotCredentialsAgent.getCredentialsControlPreference()
.
control
- bitmask for permitted credentials control.public boolean validateCredentials(String username, String password)
true
.
The client may require the user's credentials to be in a specific format (i.e. email for username). Credentials will be updated through the UI only if they are valid.
username
- new username.password
- new password.
true
if credentials are valid, false
if credentials are invalid.public abstract void setUsername(String username) throws HotspotException
username
- new username.
HotspotException
- thrown with HotspotException#CREDENTIALS_STORAGE_UNAVAILABLE
when the credentials storage is unavailable.public abstract void setPassword(String password) throws HotspotException
password
- new password.
HotspotException
- thrown with HotspotException#CREDENTIALS_STORAGE_UNAVAILABLE
when if the credentials storage is unavailable.public static HotspotCredentialsAgent getSystemHotspotCredentialsAgent()
null
if Wi-Fi framework is not on the device.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.