org.sakaiproject.component.legacy.alias
Class DbAliasService.DbStorageOld

java.lang.Object
  extended byorg.sakaiproject.util.storage.BaseDbSingleStorage
      extended byorg.sakaiproject.component.legacy.alias.DbAliasService.DbStorageOld
All Implemented Interfaces:
BaseAliasService.Storage
Enclosing class:
DbAliasService

protected class DbAliasService.DbStorageOld
extends BaseDbSingleStorage
implements BaseAliasService.Storage

This is how to access the old chef_alias table (CTools through 2.0.7)


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
DbAliasService.DbStorageOld(StorageUser user)
          Construct.
 
Method Summary
 void cancel(AliasEdit edit)
          Cancel the changes and release the lock.
 boolean check(String id)
          Check if an alias with this id exists.
 void commit(AliasEdit edit)
          Commit the changes and release the lock.
 int count()
          Count all the aliases.
 int countSearch(String criteria)
          Count all the aliases with id or target matching criteria.
 AliasEdit edit(String id)
          Get a lock on the alias with this id, or null if a lock cannot be gotten.
 AliasEdit get(String id)
          Get the alias with this id, or null if not found.
 List getAll()
          Get all the alias.
 List getAll(int first, int last)
          Get all the alias in record range.
 List getAll(String target)
          Get all the alias that point at this target.
 List getAll(String target, int first, int last)
          Get all the alias that point at this target, in record range.
 AliasEdit put(String id)
          Add a new alias with this id.
 void readProperties(AliasEdit edit, ResourcePropertiesEdit props)
          Read properties from storage into the edit's properties.
 void remove(AliasEdit edit)
          Remove this alias.
 List search(String criteria, int first, int last)
          Search for aliases with id or target 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.alias.BaseAliasService.Storage
close, open
 

Constructor Detail

DbAliasService.DbStorageOld

public DbAliasService.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: BaseAliasService.Storage
Check if an alias with this id exists.

Specified by:
check in interface BaseAliasService.Storage
Parameters:
id - The alias id (case insensitive).
Returns:
true if an alias by this id exists, false if not.

get

public AliasEdit get(String id)
Description copied from interface: BaseAliasService.Storage
Get the alias with this id, or null if not found.

Specified by:
get in interface BaseAliasService.Storage
Parameters:
id - The alias id (case insensitive).
Returns:
The alias with this id, or null if not found.

getAll

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

Specified by:
getAll in interface BaseAliasService.Storage
Parameters:
first - The first record position to return.
last - The last record position to return.
Returns:
The List (BaseAliasEdit) of all alias.

getAll

public List getAll()
Description copied from interface: BaseAliasService.Storage
Get all the alias.

Specified by:
getAll in interface BaseAliasService.Storage
Returns:
The List (BaseAliasEdit) of all alias.

count

public int count()
Description copied from interface: BaseAliasService.Storage
Count all the aliases.

Specified by:
count in interface BaseAliasService.Storage
Returns:
The count of all aliases.

put

public AliasEdit put(String id)
Description copied from interface: BaseAliasService.Storage
Add a new alias with this id.

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

edit

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

Specified by:
edit in interface BaseAliasService.Storage
Parameters:
id - The alias id (case insensitive).
Returns:
The locked Alias with this id, or null if this records cannot be locked.

commit

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

Specified by:
commit in interface BaseAliasService.Storage

cancel

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

Specified by:
cancel in interface BaseAliasService.Storage

remove

public void remove(AliasEdit edit)
Description copied from interface: BaseAliasService.Storage
Remove this alias.

Specified by:
remove in interface BaseAliasService.Storage

getAll

public List getAll(String target)
Description copied from interface: BaseAliasService.Storage
Get all the alias that point at this target.

Specified by:
getAll in interface BaseAliasService.Storage
Returns:
The List (BaseAliasEdit) of all alias that point at this target

getAll

public List getAll(String target,
                   int first,
                   int last)
Description copied from interface: BaseAliasService.Storage
Get all the alias that point at this target, in record range.

Specified by:
getAll in interface BaseAliasService.Storage
Parameters:
first - The first record position to return.
last - The last record position to return.
Returns:
The List (BaseAliasEdit) of all alias that point at this target, in record range.

search

public List search(String criteria,
                   int first,
                   int last)
Search for aliases with id or target matching criteria, in range.

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

countSearch

public int countSearch(String criteria)
Count all the aliases with id or target matching criteria.

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

readProperties

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

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