org.dbxml.core.security
Class PasswordCredentials
java.lang.Object
|
+--org.dbxml.core.security.PasswordCredentials
- All Implemented Interfaces:
- Credentials
- public class PasswordCredentials
- extends java.lang.Object
- implements Credentials
PasswordCredentials provides a Credentials implementation that uses usernames
and passwords stored in the Systemdatabase.
Constructor Summary |
PasswordCredentials(java.lang.String username,
java.lang.String password,
Database db)
Creates a new PasswordCredentials using the username and password provided. |
Method Summary |
boolean |
checkGroup(java.lang.String group)
Determines if these credentials have an association with the specified
group. |
java.util.ArrayList |
getGroups()
Returns the list of groups to which these credentials belong. |
java.lang.String |
getPassword()
Returns the password associated with these credentials |
java.lang.String |
getUsername()
Returns the username associated with these credentials |
void |
verify()
Verifies that the credentials are valid. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PasswordCredentials
public PasswordCredentials(java.lang.String username,
java.lang.String password,
Database db)
throws InvalidPasswordException,
UnknownUserException
- Creates a new PasswordCredentials using the username and password provided.
The username will be looked up in system/SysUsers and the password will be
compared to that stored in the record.
- Parameters:
username
- The username to authenticatepassword
- The password used to authenticate the user.db
- The Database instance in effect- Throws:
InvalidPasswordException
- Thrown when the password provided does
not match for the username.UnknownUserException
- Thrown when the username can not be found.
verify
public void verify()
throws InvalidCredentialsException
- Verifies that the credentials are valid.
- Specified by:
verify
in interface Credentials
- Throws:
InvalidCredentialsException
- Thrown if the credentials
are not valid.
checkGroup
public boolean checkGroup(java.lang.String group)
throws AccessDeniedException,
InvalidCredentialsException
- Determines if these credentials have an association with the specified
group.
- Specified by:
checkGroup
in interface Credentials
- Parameters:
group
- The group to check membership of- Returns:
- true if the group exists false otherwise.
- Throws:
AccessDeniedException
- Thrown when access to the resource is
denied.InvalidCredentialsException
- Thrown if the provided credentials
are not valid.
getGroups
public java.util.ArrayList getGroups()
- Returns the list of groups to which these credentials belong.
- Specified by:
getGroups
in interface Credentials
- Returns:
- the list of groups
getUsername
public java.lang.String getUsername()
- Returns the username associated with these credentials
- Returns:
- the username
getPassword
public java.lang.String getPassword()
- Returns the password associated with these credentials
- Returns:
- the password
Copyright (c) 1999-2001 The dbXML Group, All rights reserved