|
DLESE Tools v1.6.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.dlese.dpc.datamgr.ListenerDataManager
public abstract class ListenerDataManager
Provides an abstract implementation of a common interface for applications
needing to work with a data store. Implementers of DataListener
register with a DataManager
instance. An instance of data is
uniquely identified using an object identifier. Applications must request
locks to restrict writing of data.
Constructor Summary | |
---|---|
ListenerDataManager()
|
Method Summary | |
---|---|
abstract void |
addListener(DataListener listener)
Add a DataListener to this DataManager . |
abstract void |
delete(String oid)
Deletes an existing data object iff the object is not locked. |
abstract void |
delete(String oid,
String lockKey)
Deletes an existing data object, assuming the caller had requested and recieved the necessary lock. |
protected abstract void |
fireDataAddedEvent(List dataToAdd)
Construct the DataEvent object and invoke the appropriate method of all the listeners to this DataManager. |
protected abstract void |
fireDataChangedEvent(List dataToChange)
Construct the DataEvent object and invoke the appropriate method of all the listeners to this DataManager. |
protected abstract void |
fireDataRemovedEvent(List dataToRemove)
Construct the DataEvent object and invoke the appropriate method of all the listeners to this DataManager. |
abstract List |
get(List oids)
Retrieves a List of data objects. |
abstract Object |
get(String oid)
Retrieves a single data object. |
abstract boolean |
isLocked(String oid)
Determine whether a given object is locked. |
abstract boolean |
isValidLock(String oid,
String lockKey)
Determine whether a given object is locked with the given key. |
abstract String |
lock(String oid)
Request a lock for a data object. |
abstract boolean |
oidExists(String oid)
Determines whether an object with the given oid exists in the DataManager. |
abstract Object |
put(String oid,
Object obj)
Adds a new object of data. |
abstract Object |
remove(String oid)
Removes an existing data object iff the object is not locked. |
abstract Object |
remove(String oid,
String lockKey)
Removes an existing data object, assuming the caller had requested and recieved the necessary lock. |
abstract void |
removeListener(DataListener listener)
Remove a DataListener from this DataManager . |
abstract boolean |
unlock(String oid,
String lockKey)
Remove the lock on a data object. |
abstract Object |
update(String oid,
Object obj)
Updates a new object of data iff the object is not locked. |
abstract Object |
update(String oid,
Object obj,
String lockKey)
Updates a new object of data, assuming the caller had requested and recieved the necessary lock. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ListenerDataManager()
Method Detail |
---|
public abstract Object get(String oid) throws OIDDoesNotExistException
oid
- The data identifier
Object
of data
OIDDoesNotExistException
public abstract List get(List oids) throws OIDDoesNotExistException
List
of data objects.
oids
- List
of data identifiers
List
of corresponding data objects
OIDDoesNotExistException
public abstract Object put(String oid, Object obj) throws OIDAlreadyExistsException, ObjectNotSupportedException
oid
- The unique identifier that references the new data objectobj
- The new data object
OIDAlreadyExistsException
ObjectNotSupportedException
public abstract Object remove(String oid, String lockKey) throws OIDDoesNotExistException, InvalidLockException
oid
- The unique identifier that references the data object to be removedlockKey
- The key corresponding to the lock on this data object
OIDDoesNotExistException
InvalidLockException
public abstract Object remove(String oid) throws OIDDoesNotExistException, LockNotAvailableException
oid
- The unique identifier that references the data object to be removed
OIDDoesNotExistException
LockNotAvailableException
public abstract void delete(String oid, String lockKey) throws OIDDoesNotExistException, InvalidLockException
remove()
except no object is returned and thus is more efficient
if an object is not required.
oid
- The unique identifier that references the data object to be deletedlockKey
- The key corresponding to the lock on this data object
OIDDoesNotExistException
InvalidLockException
public abstract void delete(String oid) throws OIDDoesNotExistException, LockNotAvailableException
remove()
except no object is returned and thus is more efficient.
After successful completion the object is deleted from the DataManager.
oid
- The unique identifier that references the data object to be deleted
OIDDoesNotExistException
LockNotAvailableException
public abstract Object update(String oid, Object obj, String lockKey) throws OIDDoesNotExistException, ObjectNotSupportedException, InvalidLockException
oid
- The unique identifier that references the data object to be updatedobj
- The new updated data objectlockKey
- The key corresponding to the lock on this data object
OIDDoesNotExistException
ObjectNotSupportedException
InvalidLockException
public abstract Object update(String oid, Object obj) throws OIDDoesNotExistException, ObjectNotSupportedException, LockNotAvailableException
oid
- The unique identifier that references the data object to be updatedobj
- The new updated data object
OIDDoesNotExistException
ObjectNotSupportedException
LockNotAvailableException
public abstract String lock(String oid) throws OIDDoesNotExistException, LockNotAvailableException
oid
- The unique identifier that references the data object to be locked
OIDDoesNotExistException
LockNotAvailableException
public abstract boolean unlock(String oid, String lockKey) throws OIDDoesNotExistException, InvalidLockException
oid
- The unique identifier that references the locked data objectlockKey
- The key corresponding to the lock on this data object
OIDDoesNotExistException
InvalidLockException
public abstract boolean oidExists(String oid)
oid
- The unique identifier that references the data object
public abstract boolean isLocked(String oid)
oid
- The unique identifier that references the data object
public abstract boolean isValidLock(String oid, String lockKey)
oid
- The unique identifier that references the data objectlockKey
- The lock key
public abstract void addListener(DataListener listener)
DataListener
to this DataManager
.
listener
- The listener to addpublic abstract void removeListener(DataListener listener)
DataListener
from this DataManager
.
listener
- The listener to removeprotected abstract void fireDataAddedEvent(List dataToAdd)
dataToAdd
- The list of OIDs for data added to this managerprotected abstract void fireDataChangedEvent(List dataToChange)
dataToChange
- The list of OIDs for data changed by this managerprotected abstract void fireDataRemovedEvent(List dataToRemove)
dataToRemove
- The list of OIDs for data removed by this manager
|
DLESE Tools v1.6.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |