📄 basesecurityservice.html
字号:
public <A HREF="../../../../../org/apache/turbine/om/security/User.html">User</A> <B>getAuthenticatedUser</B>(java.lang.String username, java.lang.String password) throws <A HREF="../../../../../org/apache/turbine/util/security/DataBackendException.html">DataBackendException</A>, <A HREF="../../../../../org/apache/turbine/util/security/UnknownEntityException.html">UnknownEntityException</A>, <A HREF="../../../../../org/apache/turbine/util/security/PasswordMismatchException.html">PasswordMismatchException</A></PRE><DL><DD>Authenticates an user, and constructs an User object to represent him/her.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../../../org/apache/turbine/services/security/SecurityService.html#getAuthenticatedUser(java.lang.String, java.lang.String)">getAuthenticatedUser</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/turbine/services/security/SecurityService.html">SecurityService</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>username</CODE> - The user name.<DD><CODE>password</CODE> - The user password.<DT><B>Returns:</B><DD>An authenticated Turbine User.<DT><B>Throws:</B><DD><CODE><A HREF="../../../../../org/apache/turbine/util/security/PasswordMismatchException.html">PasswordMismatchException</A></CODE> - if the supplied password was incorrect.<DD><CODE><A HREF="../../../../../org/apache/turbine/util/security/UnknownEntityException.html">UnknownEntityException</A></CODE> - if the user's account does not exist in the database.<DD><CODE><A HREF="../../../../../org/apache/turbine/util/security/DataBackendException.html">DataBackendException</A></CODE> - if there is a problem accessing the storage.</DL></DD></DL><HR><A NAME="getUser(java.lang.String)"><!-- --></A><H3>getUser</H3><PRE>public <A HREF="../../../../../org/apache/turbine/om/security/User.html">User</A> <B>getUser</B>(java.lang.String username) throws <A HREF="../../../../../org/apache/turbine/util/security/DataBackendException.html">DataBackendException</A>, <A HREF="../../../../../org/apache/turbine/util/security/UnknownEntityException.html">UnknownEntityException</A></PRE><DL><DD>Constructs an User object to represent a registered user of the application.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../../../org/apache/turbine/services/security/SecurityService.html#getUser(java.lang.String)">getUser</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/turbine/services/security/SecurityService.html">SecurityService</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>username</CODE> - The user name.<DT><B>Returns:</B><DD>A Turbine User.<DT><B>Throws:</B><DD><CODE><A HREF="../../../../../org/apache/turbine/util/security/UnknownEntityException.html">UnknownEntityException</A></CODE> - if the user's account does not exist in the database.<DD><CODE><A HREF="../../../../../org/apache/turbine/util/security/DataBackendException.html">DataBackendException</A></CODE> - if there is a problem accessing the storage.</DL></DD></DL><HR><A NAME="getUsers(org.apache.torque.util.Criteria)"><!-- --></A><H3>getUsers</H3><PRE>public <A HREF="../../../../../org/apache/turbine/om/security/User.html">User</A>[] <B>getUsers</B>(org.apache.torque.util.Criteria criteria) throws <A HREF="../../../../../org/apache/turbine/util/security/DataBackendException.html">DataBackendException</A></PRE><DL><DD>Retrieve a set of users that meet the specified criteria. As the keys for the criteria, you should use the constants that are defined in <A HREF="../../../../../org/apache/turbine/om/security/User.html"><CODE>User</CODE></A> interface, plus the names of the custom attributes you added to your user representation in the data storage. Use verbatim names of the attributes - without table name prefix in case of DB implementation.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../../../org/apache/turbine/services/security/SecurityService.html#getUsers(org.apache.torque.util.Criteria)">getUsers</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/turbine/services/security/SecurityService.html">SecurityService</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>criteria</CODE> - The criteria of selection.<DT><B>Returns:</B><DD>a List of users meeting the criteria.<DT><B>Throws:</B><DD><CODE><A HREF="../../../../../org/apache/turbine/util/security/DataBackendException.html">DataBackendException</A></CODE> - if there is a problem accessing the storage.</DL></DD></DL><HR><A NAME="getAnonymousUser()"><!-- --></A><H3>getAnonymousUser</H3><PRE>public <A HREF="../../../../../org/apache/turbine/om/security/User.html">User</A> <B>getAnonymousUser</B>() throws <A HREF="../../../../../org/apache/turbine/util/security/UnknownEntityException.html">UnknownEntityException</A></PRE><DL><DD>Constructs an User object to represent an anonymous user of the application.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../../../org/apache/turbine/services/security/SecurityService.html#getAnonymousUser()">getAnonymousUser</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/turbine/services/security/SecurityService.html">SecurityService</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>An anonymous Turbine User.<DT><B>Throws:</B><DD><CODE><A HREF="../../../../../org/apache/turbine/util/security/UnknownEntityException.html">UnknownEntityException</A></CODE> - if the implementation of User interface could not be determined, or does not exist.</DL></DD></DL><HR><A NAME="saveUser(org.apache.turbine.om.security.User)"><!-- --></A><H3>saveUser</H3><PRE>public void <B>saveUser</B>(<A HREF="../../../../../org/apache/turbine/om/security/User.html">User</A> user) throws <A HREF="../../../../../org/apache/turbine/util/security/UnknownEntityException.html">UnknownEntityException</A>, <A HREF="../../../../../org/apache/turbine/util/security/DataBackendException.html">DataBackendException</A></PRE><DL><DD>Saves User's data in the permanent storage. The user account is required to exist in the storage.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../../../org/apache/turbine/services/security/SecurityService.html#saveUser(org.apache.turbine.om.security.User)">saveUser</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/turbine/services/security/SecurityService.html">SecurityService</A></CODE></DL></DD><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../../../../org/apache/turbine/util/security/UnknownEntityException.html">UnknownEntityException</A></CODE> - if the user's account does not exist in the database.<DD><CODE><A HREF="../../../../../org/apache/turbine/util/security/DataBackendException.html">DataBackendException</A></CODE> - if there is a problem accessing the storage.</DL></DD></DL><HR><A NAME="addUser(org.apache.turbine.om.security.User, java.lang.String)"><!-- --></A><H3>addUser</H3><PRE>public void <B>addUser</B>(<A HREF="../../../../../org/apache/turbine/om/security/User.html">User</A> user, java.lang.String password) throws <A HREF="../../../../../org/apache/turbine/util/security/DataBackendException.html">DataBackendException</A>, <A HREF="../../../../../org/apache/turbine/util/security/EntityExistsException.html">EntityExistsException</A></PRE><DL><DD>Creates new user account with specified attributes.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../../../org/apache/turbine/services/security/SecurityService.html#addUser(org.apache.turbine.om.security.User, java.lang.String)">addUser</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/turbine/services/security/SecurityService.html">SecurityService</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>user</CODE> - the object describing account to be created.<DT><B>Throws:</B><DD><CODE><A HREF="../../../../../org/apache/turbine/util/security/DataBackendException.html">DataBackendException</A></CODE> - if there was an error accessing the data backend.<DD><CODE><A HREF="../../../../../org/apache/turbine/util/security/EntityExistsException.html">EntityExistsException</A></CODE> - if the user account already exists.</DL></DD></DL><HR><A NAME="removeUser(org.apache.turbine.om.security.User)"><!-- --></A><H3>removeUser</H3><PRE>public void <B>removeUser</B>(<A HREF="../../../../../org/apache/turbine/om/security/User.html">User</A> user) throws <A HREF="../../../../../org/apache/turbine/util/security/DataBackendException.html">DataBackendException</A>, <A HREF="../../../../../org/apache/turbine/util/security/UnknownEntityException.html">UnknownEntityException</A></PRE><DL><DD>Removes an user account from the system.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../../../org/apache/turbine/services/security/SecurityService.html#removeUser(org.apache.turbine.om.security.User)">removeUser</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/turbine/services/security/SecurityService.html">SecurityService</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>user</CODE> - the object describing the account to be removed.<DT><B>Throws:</B><DD><CODE><A HREF="../../../../../org/apache/turbine/util/security/DataBackendException.html">DataBackendException</A></CODE> - if there was an error accessing the data backend.<DD><CODE><A HREF="../../../../../org/apache/turbine/util/security/UnknownEntityException.html">UnknownEntityException</A></CODE> - if the user account is not present.</DL></DD></DL><HR><A NAME="changePassword(org.apache.turbine.om.security.User, java.lang.String, java.lang.String)"><!-- --></A><H3>changePassword</H3><PRE>public void <B>changePassword</B>(<A HREF="../../../../../org/apache/turbine/om/security/User.html">User</A> user, java.lang.String oldPassword, java.lang.String newPassword) throws <A HREF="../../../../../org/apache/turbine/util/security/PasswordMismatchException.html">PasswordMismatchException</A>, <A HREF="../../../../../org/apache/turbine/util/security/UnknownEntityException.html">UnknownEntityException</A>, <A HREF="../../../../../org/apache/turbine/util/security/DataBackendException.html">DataBackendException</A></PRE><DL><DD>Change the password for an User.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../../../org/apache/turbine/services/security/SecurityService.html#changePassword(org.apache.turbine.om.security.User, java.lang.String, java.lang.String)">changePassword</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/turbine/services/security/SecurityService.html">SecurityService</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>user</CODE> - an User to change password for.<DD><CODE>oldPassword</CODE> - the current password supplied by the user.<DD><CODE>newPassword</CODE> - the current password requested by the user.<DT><B>Throws:</B><DD><CODE><A HREF="../../../../../org/apache/turbine/util/security/PasswordMismatchException.html">PasswordMismatchException</A></CODE> - if the supplied password was incorrect.<DD><CODE><A HREF="../../../../../org/apache/turbine/util/security/UnknownEntityException.html">UnknownEntityException</A></CODE> - if the user's record does not exist in the database.<DD><CODE><A HREF="../../../../../org/apache/turbine/util/security/DataBackendException.html">DataBackendException</A></CODE> - if there is a problem accessing the storage.</DL></DD></DL><HR><A NAME="forcePassword(org.apache.turbine.om.security.User, java.lang.String)"><!-- --></A><H3>forcePassword</H3><PRE>public void <B>forcePassword</B>(<A HREF="../../../../../org/apache/turbine/om/security/User.html">User</A> user, java.lang.String password) throws <A HREF="../../../../../org/apache/turbine/util/security/UnknownEntityException.html">UnknownEntityException</A>, <A HREF="../../../../../org/apache/turbine/util/security/DataBackendException.html">DataBackendException</A></PRE><DL><DD>Forcibly sets new password for an User. This is supposed by the administrator to change the forgotten or compromised passwords. Certain implementatations of this feature would require administrative level access to the authenticating server / program.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../../../org/apache/turbine/services/security/SecurityService.html#forcePassword(org.apache.turbine.om.security.User, java.lang.String)">forcePassword</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/turbine/services/security/SecurityService.html">SecurityService</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>user</CODE> - an User to change password for.<DD><CODE>password</CODE> - the new password.<DT><B>Throws:</B><DD><CODE><A HREF="../../../../../org/apache/turbine/util/security/UnknownEntityException.html">UnknownEntityException</A></CODE> - if the user's record does not exist in the database.<DD><CODE><A HREF="../../../../../org/apache/turbine/util/security/DataBackendException.html">DataBackendException</A></CODE> - if there is a problem accessing the storage.</DL></DD></DL><HR><A NAME="lockShared()"><!-- --></A><H3>lockShared</H3><PRE>protected void <B>lockShared</B>()</PRE><DL><DD>Acquire a shared lock on the security information repository. Methods that read security information need to invoke this method at the beginning of their body.<DD><DL></DL></DD></DL><HR><A NAME="unlockShared()"><!-- --></A><H3>unlockShared</H3><PRE>protected void <B>unlockShared</B>()</PRE><DL><DD>Release a shared lock on the security information repository.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -