|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.james.jcr.JCRUsersRepository
public class JCRUsersRepository
| Field Summary | |
|---|---|
protected javax.jcr.Credentials |
credentials
Login credentials for accessing the repository. |
protected org.apache.commons.logging.Log |
logger
|
protected java.lang.String |
path
Path (relative to root) of the mail repository within the workspace. |
protected javax.jcr.Repository |
repository
JCR content repository used as the mail repository. |
protected java.lang.String |
workspace
Name of the workspace used as the mail repository. |
| Fields inherited from interface org.apache.james.api.user.UsersRepository |
|---|
ROLE, USER |
| Constructor Summary | |
|---|---|
JCRUsersRepository()
For setter injection. |
|
JCRUsersRepository(javax.jcr.Repository repository)
Minimal constructor for injection. |
|
JCRUsersRepository(javax.jcr.Repository repository,
javax.jcr.Credentials credentials,
java.lang.String workspace,
java.lang.String path,
org.apache.commons.logging.Log logger)
Maximal constructor for injection. |
|
| Method Summary | |
|---|---|
void |
addUser(java.lang.String name,
java.lang.Object attributes)
Deprecated. James 2.4 user is always added using username/password and eventually modified by retrieving it later. |
boolean |
addUser(java.lang.String username,
java.lang.String password)
Adds a user to the repository with the specified password |
boolean |
addUser(User user)
Deprecated. James 2.4 user should be added using username/password because specific implementations of UsersRepository will support specific implementations of users object. |
boolean |
contains(java.lang.String name)
Returns whether or not this user is in the repository |
boolean |
containsCaseInsensitive(java.lang.String name)
Deprecated. James 2.4 now caseSensitive is a property of the repository implementations and the contains will search according to this property. |
int |
countUsers()
Returns a count of the users in the repository. |
javax.jcr.Credentials |
getCredentials()
Returns the login credentials for accessing the repository. |
org.apache.commons.logging.Log |
getLogger()
Gets the current logger. |
java.lang.String |
getPath()
Returns the path of the mail repository within the workspace. |
java.lang.String |
getRealName(java.lang.String name)
Returns the user name of the user matching name on an equalsIgnoreCase basis. |
javax.jcr.Repository |
getRepository()
Retuns the JCR content repository used as the mail repository. |
User |
getUserByName(java.lang.String username)
Get the user object with the specified user name. |
User |
getUserByNameCaseInsensitive(java.lang.String name)
Deprecated. James 2.4 now caseSensitive is a property of the repository implementations and the getUserByName will search according to this property. |
java.lang.String |
getWorkspace()
Returns the name of the workspace used as the mail repository. |
java.util.Iterator |
list()
List users in repository. |
protected javax.jcr.Session |
login()
Logs into a new session. |
protected javax.jcr.NodeIterator |
query(javax.jcr.Session session,
java.lang.String xpath)
|
void |
removeUser(java.lang.String username)
Removes a user from the repository |
void |
setCredentials(javax.jcr.Credentials credentials)
Sets the login credentials for accessing the repository. |
void |
setLogger(org.apache.commons.logging.Log logger)
Sets the current logger. |
void |
setPath(java.lang.String path)
Sets the path of the mail repository within the workspace. |
void |
setRepository(javax.jcr.Repository repository)
Sets the JCR content repository to be used as the mail repository. |
void |
setWorkspace(java.lang.String workspace)
Sets the name of the workspace used as the mail repository. |
boolean |
test(java.lang.String username,
java.lang.String password)
Test if user with name 'name' has password 'password'. |
protected java.lang.String |
toSafeName(java.lang.String key)
|
boolean |
updateUser(User user)
Update the repository with the specified user object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected org.apache.commons.logging.Log logger
protected javax.jcr.Repository repository
protected javax.jcr.Credentials credentials
null (the default) to use default credentials.
protected java.lang.String workspace
null (the default) to use the default workspace.
protected java.lang.String path
| Constructor Detail |
|---|
public JCRUsersRepository()
public JCRUsersRepository(javax.jcr.Repository repository,
javax.jcr.Credentials credentials,
java.lang.String workspace,
java.lang.String path,
org.apache.commons.logging.Log logger)
repository - not nullcredentials - login credentials for accessing the repository
or null to use default credentialsworkspace - name of the workspace used as the mail repository.
or null to use default workspacepath - path (relative to root) of the user node within the workspace,
or null to use default.public JCRUsersRepository(javax.jcr.Repository repository)
repository - not null| Method Detail |
|---|
public boolean addUser(User user)
addUser in interface UsersRepositoryuser - the user to be added
public void addUser(java.lang.String name,
java.lang.Object attributes)
addUser in interface UsersRepositoryname - the name of the user to be addedattributes - see decription
public boolean addUser(java.lang.String username,
java.lang.String password)
addUser in interface UsersRepositoryusername - the username of the user to be addedpassword - the password of the user to add
public User getUserByName(java.lang.String username)
getUserByName in interface UsersRepositoryname - the name of the user to retrieve
public User getUserByNameCaseInsensitive(java.lang.String name)
getUserByNameCaseInsensitive in interface UsersRepositoryname - the name of the user to retrieve
public java.lang.String getRealName(java.lang.String name)
getRealName in interface UsersRepositoryname - the name to case-correct
public boolean updateUser(User user)
updateUser in interface UsersRepositorypublic void removeUser(java.lang.String username)
removeUser in interface UsersRepositoryname - the user to remove from the repositorypublic boolean contains(java.lang.String name)
contains in interface UsersRepositoryname - the name to check in the repository
public boolean containsCaseInsensitive(java.lang.String name)
containsCaseInsensitive in interface UsersRepositoryname - the name to check in the repository
public boolean test(java.lang.String username,
java.lang.String password)
test in interface UsersRepositoryname - the name of the user to be testedpassword - the password to be tested
public int countUsers()
countUsers in interface UsersRepositorypublic java.util.Iterator list()
list in interface UsersRepositorypublic final org.apache.commons.logging.Log getLogger()
public final void setLogger(org.apache.commons.logging.Log logger)
logger - the logger to set, not nullpublic javax.jcr.Repository getRepository()
public void setRepository(javax.jcr.Repository repository)
repository - JCR content repositorypublic javax.jcr.Credentials getCredentials()
null if using the default credentialspublic void setCredentials(javax.jcr.Credentials credentials)
credentials - login credentials,
or null to use the default credentialspublic java.lang.String getWorkspace()
null if using the default workspacepublic void setWorkspace(java.lang.String workspace)
workspace - workspace name,
or null to use the default workspacepublic java.lang.String getPath()
public void setPath(java.lang.String path)
path - repository path
protected javax.jcr.Session login()
throws javax.jcr.LoginException,
javax.jcr.NoSuchWorkspaceException,
javax.jcr.RepositoryException
javax.jcr.LoginException - when login fails
javax.jcr.NoSuchWorkspaceException - when workspace does not exist
javax.jcr.RepositoryException - when access failsprotected java.lang.String toSafeName(java.lang.String key)
protected javax.jcr.NodeIterator query(javax.jcr.Session session,
java.lang.String xpath)
throws javax.jcr.RepositoryException,
javax.jcr.query.InvalidQueryException
javax.jcr.RepositoryException
javax.jcr.query.InvalidQueryException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||