|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jdesktop.beans.AbstractBean
org.jdesktop.swingx.auth.LoginService
public abstract class LoginService
LoginService is the abstract base class for all classes implementing a login mechanism. It allows you to customize the threading behaviour used to perform the login. Subclasses need to override the authenticate method. Subclasses may implement the getUserRoles() method to return a meaningful value this method will be called once upon a successful login to determine the user roles. It is not defined as abstract to simplify the task of implementing a login service for those who do not require this functionality.
Asynchronous login behavior requires the SwingWorker. For Java 5.0,
users will need the
SwingWorker BackPort.
| Constructor Summary | |
|---|---|
LoginService()
|
|
LoginService(String server)
|
|
| Method Summary | |
|---|---|
void |
addLoginListener(LoginListener listener)
Adds a LoginListener to the list of listeners |
abstract boolean |
authenticate(String name,
char[] password,
String server)
This method is intended to be implemented by clients wishing to authenticate a user with a given password. |
void |
cancelAuthentication()
Notifies the LoginService that an already running authentication request should be cancelled. |
String |
getServer()
|
boolean |
getSynchronous()
Get the synchronous property |
String[] |
getUserRoles()
Called immediately after a successful authentication. |
void |
removeLoginListener(LoginListener listener)
Removes a LoginListener from the list of listeners |
void |
setServer(String server)
|
void |
setSynchronous(boolean synchronous)
Sets the synchronous property |
void |
startAuthentication(String user,
char[] password,
String server)
This method starts the authentication process and is either synchronous or asynchronous based on the synchronous property |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LoginService()
public LoginService(String server)
| Method Detail |
|---|
public abstract boolean authenticate(String name,
char[] password,
String server)
throws Exception
name - usernamepassword - passwordserver - server (optional)
true on authentication success
Exceptionpublic String[] getUserRoles()
nullpublic void cancelAuthentication()
public void startAuthentication(String user,
char[] password,
String server)
throws Exception
user - userpassword - passwordserver - server
Exceptionpublic boolean getSynchronous()
public void setSynchronous(boolean synchronous)
synchronous - synchronous propertypublic void addLoginListener(LoginListener listener)
listener - listenerpublic void removeLoginListener(LoginListener listener)
listener - listenerpublic String getServer()
public void setServer(String server)
server - The server to set.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||