org.sakaiproject.component.legacy.user
Class DbUserService.DbStorageOld

java.lang.Object
  extended byorg.sakaiproject.util.storage.BaseDbSingleStorage
      extended byorg.sakaiproject.component.legacy.user.DbUserService.DbStorageOld
All Implemented Interfaces:
BaseUserDirectoryService.Storage
Enclosing class:
DbUserService

protected class DbUserService.DbStorageOld
extends BaseDbSingleStorage
implements BaseUserDirectoryService.Storage

Covers for the BaseXmlFileStorage, providing User and UserEdit parameters


Field Summary
 
Fields inherited from class org.sakaiproject.util.storage.BaseDbSingleStorage
m_caseInsensitive, m_locks, m_locksAreInDb, m_locksAreInTable, m_resourceEntryTagName, m_resourceTableIdField, m_resourceTableName, m_resourceTableOtherFields, m_sql, m_user
 
Constructor Summary
DbUserService.DbStorageOld(StorageUser user)
          Construct.
 
Method Summary
 void cancel(UserEdit edit)
          Cancel the changes and release the lock.
 boolean check(String id)
          Check if a user by this id exists.
 void commit(UserEdit edit)
          Commit the changes and release the lock.
 int count()
          Count all the users.
 int countSearch(String criteria)
          Count all the users with id or email, first or last name matching criteria.
 UserEdit edit(String id)
          Get a lock on the user with this id, or null if a lock cannot be gotten.
 Collection findUsersByEmail(String email)
          Get the users with this email, or return empty if none found.
 UserEdit get(String id)
          Get the user with this id, or null if not found.
 List getAll()
          Get all users.
 List getAll(int first, int last)
          Get all the users in record range.
 UserEdit put(String id)
          Add a new user with this id.
 void readProperties(UserEdit edit, ResourcePropertiesEdit props)
          Read properties from storage into the edit's properties.
 void remove(UserEdit edit)
          Remove this user.
 List search(String criteria, int first, int last)
          Search for users with id or email, first or last name matching criteria, in range.
 
Methods inherited from class org.sakaiproject.util.storage.BaseDbSingleStorage
cancelResource, caseId, checkResource, close, commitDeleteResource, commitResource, countAllResources, countSelectedResourcesWhere, editResource, getAllResources, getAllResources, getAllResourcesWhere, getAllResourcesWhereLike, getResource, getSelectedResources, getSelectedResourcesWhere, insertDeleteFields, insertFields, isEmpty, loadResources, open, putDeleteResource, putResource, readResource, removeResource, setCaseInsensitivity, updateSet, valuesParams
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.sakaiproject.component.legacy.user.BaseUserDirectoryService.Storage
close, open
 

Constructor Detail

DbUserService.DbStorageOld

public DbUserService.DbStorageOld(StorageUser user)
Construct.

Parameters:
user - The StorageUser class to call back for creation of Resource and Edit objects.
Method Detail

check

public boolean check(String id)
Description copied from interface: BaseUserDirectoryService.Storage
Check if a user by this id exists.

Specified by:
check in interface BaseUserDirectoryService.Storage
Parameters:
id - The user id.
Returns:
true if a user by this id exists, false if not.

get

public UserEdit get(String id)
Description copied from interface: BaseUserDirectoryService.Storage
Get the user with this id, or null if not found.

Specified by:
get in interface BaseUserDirectoryService.Storage
Parameters:
id - The user id.
Returns:
The user with this id, or null if not found.

getAll

public List getAll()
Description copied from interface: BaseUserDirectoryService.Storage
Get all users.

Specified by:
getAll in interface BaseUserDirectoryService.Storage
Returns:
The List (UserEdit) of all users.

count

public int count()
Description copied from interface: BaseUserDirectoryService.Storage
Count all the users.

Specified by:
count in interface BaseUserDirectoryService.Storage
Returns:
The count of all users.

getAll

public List getAll(int first,
                   int last)
Description copied from interface: BaseUserDirectoryService.Storage
Get all the users in record range.

Specified by:
getAll in interface BaseUserDirectoryService.Storage
Parameters:
first - The first record position to return.
last - The last record position to return.
Returns:
The List (BaseUserEdit) of all users.

search

public List search(String criteria,
                   int first,
                   int last)
Description copied from interface: BaseUserDirectoryService.Storage
Search for users with id or email, first or last name matching criteria, in range.

Specified by:
search in interface BaseUserDirectoryService.Storage
Parameters:
criteria - The search criteria.
first - The first record position to return.
last - The last record position to return.
Returns:
The List (BaseUserEdit) of all alias.

countSearch

public int countSearch(String criteria)
Count all the users with id or email, first or last name matching criteria.

Specified by:
countSearch in interface BaseUserDirectoryService.Storage
Parameters:
criteria - The search criteria.
Returns:
The count of all aliases with id or target matching criteria.

put

public UserEdit put(String id)
Description copied from interface: BaseUserDirectoryService.Storage
Add a new user with this id.

Specified by:
put in interface BaseUserDirectoryService.Storage
Parameters:
id - The user id.
Returns:
The locked User object with this id, or null if the id is in use.

edit

public UserEdit edit(String id)
Description copied from interface: BaseUserDirectoryService.Storage
Get a lock on the user with this id, or null if a lock cannot be gotten.

Specified by:
edit in interface BaseUserDirectoryService.Storage
Parameters:
id - The user id.
Returns:
The locked User with this id, or null if this records cannot be locked.

commit

public void commit(UserEdit edit)
Description copied from interface: BaseUserDirectoryService.Storage
Commit the changes and release the lock.

Specified by:
commit in interface BaseUserDirectoryService.Storage
Parameters:
edit - The user to commit.

cancel

public void cancel(UserEdit edit)
Description copied from interface: BaseUserDirectoryService.Storage
Cancel the changes and release the lock.

Specified by:
cancel in interface BaseUserDirectoryService.Storage
Parameters:
edit - The user to commit.

remove

public void remove(UserEdit edit)
Description copied from interface: BaseUserDirectoryService.Storage
Remove this user.

Specified by:
remove in interface BaseUserDirectoryService.Storage
Parameters:
edit - The user to remove.

findUsersByEmail

public Collection findUsersByEmail(String email)
Get the users with this email, or return empty if none found.

Specified by:
findUsersByEmail in interface BaseUserDirectoryService.Storage
Returns:
The Collection (User) of users with this email, or an empty collection if none found.

readProperties

public void readProperties(UserEdit edit,
                           ResourcePropertiesEdit props)
Read properties from storage into the edit's properties.

Specified by:
readProperties in interface BaseUserDirectoryService.Storage
Parameters:
edit - The user to read properties for.