|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.binding.value.support.AbstractPropertyChangePublisher
org.springframework.richclient.command.AbstractCommand
org.springframework.richclient.command.ActionCommand
org.springframework.richclient.command.support.ApplicationWindowAwareCommand
org.springframework.richclient.security.LoginCommand
public class LoginCommand
Provides a login interface to the user.
Presents a dialog to the user to collect login credentials. It then invokes the
ApplicationSecurityManager.doLogin(org.acegisecurity.Authentication)
method to validate the credentials. The
ApplicationSecurityManager is responsible for updating the security context and firing
appropriate security events.
The default user name can be specified as a configuration parameter. This is useful
when combined with
PropertyPlaceholderConfigurer
to
install the current (system) username.
If the login is unsuccesful, a message is presented to the user and they are offered another chance to login.
The closeOnCancel
property controls what happens if the user cancels the
login dialog. If closeOnCancel is true (the default), if there is no valid
authentication in place (from a previous login) then the application is closed. If it
is false or an authentication token is available, then no action is taken other than
closing the dialog.
The clearPasswordOnFailure
controls the handling of the password field
after a login failure. If clearPasswordOnFailure is true
(the default),
then the password field will be cleared after the failure is reported.
A typical configuration for this component might look like this:
<bean id="placeholderConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/> <bean id="loginCommand" class="org.springframework.richclient.security.LoginCommand"> <property name="displaySuccess" value="false"/> <property name="defaultUserName" value="${user.name}"/> </bean>
LoginForm
,
LoginDetails
,
ApplicationSecurityManager
Field Summary |
---|
Fields inherited from class org.springframework.richclient.command.ActionCommand |
---|
ACTION_COMMAND_PARAMETER_KEY, ACTION_COMMAND_PROPERTY, ACTION_EVENT_PARAMETER_KEY, MODIFIERS_PARAMETER_KEY |
Fields inherited from class org.springframework.richclient.command.AbstractCommand |
---|
ENABLED_PROPERTY_NAME, VISIBLE_PROPERTY_NAME |
Fields inherited from class org.springframework.binding.value.support.AbstractPropertyChangePublisher |
---|
logger |
Fields inherited from interface org.springframework.richclient.core.Authorizable |
---|
AUTHORIZED_PROPERTY |
Constructor Summary | |
---|---|
LoginCommand()
Constructor. |
Method Summary | |
---|---|
protected LoginForm |
createLoginForm()
Construct the Form to place in the login dialog. |
protected void |
doExecuteCommand()
Execute the login command. |
String |
getDefaultUserName()
Get the default user name. |
protected ApplicationDialog |
getDialog()
Get the dialog in use, if available. |
boolean |
isClearPasswordOnFailure()
Get the "clear password on failure" setting. |
boolean |
isCloseOnCancel()
Get the "close on cancel" setting. |
protected void |
postLogin()
Called to give subclasses control after a successful login. |
void |
setClearPasswordOnFailure(boolean clearPasswordOnFailure)
Indicates if the password field should be cleared after a login failure. |
void |
setCloseOnCancel(boolean closeOnCancel)
Indicates if the application should be closed if the user cancels the login operation. |
void |
setDefaultUserName(String defaultUserName)
Set the default user name. |
void |
setDisplaySuccess(boolean displaySuccessMessage)
Indicates whether an information message is displayed to the user upon successful authentication. |
Methods inherited from class org.springframework.richclient.command.support.ApplicationWindowAwareCommand |
---|
getApplicationWindow, getParentWindowControl, setApplicationWindow |
Methods inherited from class org.springframework.richclient.command.ActionCommand |
---|
addCommandInterceptor, addParameter, execute, execute, getActionAdapter, getActionCommand, getModifiers, getParameter, getParameter, getParameters, isDisplaysInputDialog, onButtonAttached, onPostExecute, onPreExecute, removeCommandInterceptor, setActionCommand, setDefaultButton, setDefaultButtonIn, setDisplaysInputDialog |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public LoginCommand()
Method Detail |
---|
public void setDisplaySuccess(boolean displaySuccessMessage)
displaySuccessMessage
- displays an information message upon successful login if
true, otherwise falseprotected void doExecuteCommand()
doExecuteCommand
in class ActionCommand
protected LoginForm createLoginForm()
protected ApplicationDialog getDialog()
protected void postLogin()
public boolean isCloseOnCancel()
public void setCloseOnCancel(boolean closeOnCancel)
closeOnCancel
- public boolean isClearPasswordOnFailure()
public void setClearPasswordOnFailure(boolean clearPasswordOnFailure)
clearPasswordOnFailure
- public String getDefaultUserName()
public void setDefaultUserName(String defaultUserName)
defaultUserName
- to use as default, null indicates no default
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |