|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.lightdev.app.trec.server.sam.JDBCStoreAdministrator
public class JDBCStoreAdministrator
An implementation of interface UserDataStoreAdministrator for
use with databases through JDBC.
| Constructor Summary | |
|---|---|
JDBCStoreAdministrator(JDBCAdapter adapter)
create a new instance of a JDBCStoreAdministrator object |
|
| Method Summary | |
|---|---|
boolean |
backupSAM(String backupDirectory)
Create a backup of the SAM data store to file to a given backup directory. |
void |
changeRole(Role role)
change an existing role |
void |
changeUser(User user)
change a user in the UserDataStore this adapter maps to |
void |
createRole(Role role)
create a new role |
void |
createUser(User user,
String pw)
create a user in the UserDataStore this adapter maps to |
void |
deleteRole(Role role)
delete an existing role |
void |
deleteUser(User user)
delete a user from the UserDataStore this adapter maps to |
JDBCAdapter |
getAdapter()
get the JDBCAdapter of this data store |
Vector |
getAvailableBackups()
get the names of all SAM backups currently available on the server |
Role |
getRoleForId(String roleId)
get the role with the given id |
Role[] |
getRolesForName(String namePart)
get all roles whose name contains a given string |
Role[] |
getRolesForUser(User user)
get the roles that are granted to a given user |
User[] |
getUsersForName(String namePart)
get all users whose last name contains a given string |
User[] |
getUsersForRole(Role role)
get the users that are granted a given role |
void |
grantRole(String userId,
String roleId)
grant the given user a given role |
void |
newPw(String userId,
String newPw)
set a given password for a given user |
boolean |
restoreSAM(String backupDirectory)
Restore the SAM data store from a given directory. |
void |
revokeRole(String roleId)
revoke a given role from all users |
void |
revokeRole(String userId,
String roleId)
revoke a given role from a given user |
void |
revokeRoles(String userId)
revoke all roles of a user with a given user id |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JDBCStoreAdministrator(JDBCAdapter adapter)
adapter - the database adapter to use| Method Detail |
|---|
public boolean backupSAM(String backupDirectory)
throws Exception
Create a backup of the SAM data store to file to a given backup directory.
This method is not part of interface UserDataStoreAdministrator as the interface does not necessarily require a database as the data store. It is implemented here individually for the Light Development implementation of a SAM database in Derby. I.e., other implementations of a JDBCStoreAdministrator will need to override this method or otherwise re-implement a backup strategy.
backupDirectory - directory to backup to
Exception
public boolean restoreSAM(String backupDirectory)
throws Exception
Restore the SAM data store from a given directory.
As the SAM user data store not necessarily needs to be a database, this method is implemented only for the case that the standard Light Development implementation of a JDBCStoreAdministrator using an EmbeddedDerbyAdapter is running.
backupDirectory - the directory to restore from; the EmbeddedDerbyAdapter automatically
restores from the base directory it was constructed with and looks for the backup to restore
inside a subdirectory named as the given backupDirectory
Exceptionpublic Vector getAvailableBackups()
Exception
public Role getRoleForId(String roleId)
throws Exception
getRoleForId in interface UserDataStoreAdministratorroleId - the id to get the role for
Exception
public User[] getUsersForRole(Role role)
throws Exception
getUsersForRole in interface UserDataStoreAdministratorrole - the role to get the users for
Exception
public Role[] getRolesForUser(User user)
throws Exception
getRolesForUser in interface UserDataStoreAdministratoruser - the user to get roles for
Exception
public User[] getUsersForName(String namePart)
throws Exception
getUsersForName in interface UserDataStoreAdministratornamePart - the name part to contain
Exception
public Role[] getRolesForName(String namePart)
throws Exception
getRolesForName in interface UserDataStoreAdministratornamePart - the name part to contain
Exception
public void createUser(User user,
String pw)
throws Exception
createUser in interface UserDataStoreAdministratoruser - the user to createpw - the password of the user
Exception - if something went wrong during user creation
public void changeUser(User user)
throws Exception
changeUser in interface UserDataStoreAdministratoruser - the user to change
Exception - if something went wrong
public void deleteUser(User user)
throws Exception
deleteUser in interface UserDataStoreAdministratoruser - the user to delete
Exception - if something went wrong
public void newPw(String userId,
String newPw)
throws Exception
newPw in interface UserDataStoreAdministratoruserId - id of the user to set the password fornewPw - password to set for the given user
Exception - if something went wrong during password change
public void grantRole(String userId,
String roleId)
throws Exception
grantRole in interface UserDataStoreAdministratoruserId - id of the user to grant a roleroleId - id of role to grant to given user
Exception - if something went wrong
public void revokeRole(String userId,
String roleId)
throws Exception
revokeRole in interface UserDataStoreAdministratoruserId - id of user to revoke a role fromroleId - id of role to revoke from given user
Exception - if something went wrong
public void revokeRole(String roleId)
throws Exception
revokeRole in interface UserDataStoreAdministratorroleId - id of role to revoke
Exception - if something went wrong
public void revokeRoles(String userId)
throws Exception
revokeRoles in interface UserDataStoreAdministratoruserId - id of the user to revoke all roles of
Exception - ifsomething went wrong
public void createRole(Role role)
throws Exception
createRole in interface UserDataStoreAdministratorrole - the role to create
Exception - if something went wrong
public void changeRole(Role role)
throws Exception
changeRole in interface UserDataStoreAdministratorrole - the changes to apply
Exception - if something went wrong
public void deleteRole(Role role)
throws Exception
deleteRole in interface UserDataStoreAdministratorrole - the role to delete
Exception - if something went wrongpublic JDBCAdapter getAdapter()
JDBCAdapter of this data store
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||