public abstract class ListenerDataManager
extends java.lang.Object
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 and Description |
---|
ListenerDataManager() |
Modifier and Type | Method and Description |
---|---|
abstract void |
addListener(DataListener listener)
Add a
DataListener to this DataManager . |
abstract void |
delete(java.lang.String oid)
Deletes an existing data object iff the object is not locked.
|
abstract void |
delete(java.lang.String oid,
java.lang.String lockKey)
Deletes an existing data object, assuming the caller had requested and
recieved the necessary lock.
|
protected abstract void |
fireDataAddedEvent(java.util.List dataToAdd)
Construct the DataEvent object and invoke the appropriate method
of all the listeners to this DataManager.
|
protected abstract void |
fireDataChangedEvent(java.util.List dataToChange)
Construct the DataEvent object and invoke the appropriate method
of all the listeners to this DataManager.
|
protected abstract void |
fireDataRemovedEvent(java.util.List dataToRemove)
Construct the DataEvent object and invoke the appropriate method
of all the listeners to this DataManager.
|
abstract java.util.List |
get(java.util.List oids)
Retrieves a
List of data objects. |
abstract java.lang.Object |
get(java.lang.String oid)
Retrieves a single data object.
|
abstract boolean |
isLocked(java.lang.String oid)
Determine whether a given object is locked.
|
abstract boolean |
isValidLock(java.lang.String oid,
java.lang.String lockKey)
Determine whether a given object is locked with the given key.
|
abstract java.lang.String |
lock(java.lang.String oid)
Request a lock for a data object.
|
abstract boolean |
oidExists(java.lang.String oid)
Determines whether an object with the given oid exists in the
DataManager.
|
abstract java.lang.Object |
put(java.lang.String oid,
java.lang.Object obj)
Adds a new object of data.
|
abstract java.lang.Object |
remove(java.lang.String oid)
Removes an existing data object iff the object is not locked.
|
abstract java.lang.Object |
remove(java.lang.String oid,
java.lang.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(java.lang.String oid,
java.lang.String lockKey)
Remove the lock on a data object.
|
abstract java.lang.Object |
update(java.lang.String oid,
java.lang.Object obj)
Updates a new object of data iff the object is not locked.
|
abstract java.lang.Object |
update(java.lang.String oid,
java.lang.Object obj,
java.lang.String lockKey)
Updates a new object of data, assuming the caller had requested and
recieved the necessary lock.
|
public abstract java.lang.Object get(java.lang.String oid) throws OIDDoesNotExistException
oid
- The data identifierObject
of dataOIDDoesNotExistException
public abstract java.util.List get(java.util.List oids) throws OIDDoesNotExistException
List
of data objects.oids
- List
of data identifiersList
of corresponding data objectsOIDDoesNotExistException
public abstract java.lang.Object put(java.lang.String oid, java.lang.Object obj) throws OIDAlreadyExistsException, ObjectNotSupportedException
oid
- The unique identifier that references the new data objectobj
- The new data objectOIDAlreadyExistsException
ObjectNotSupportedException
public abstract java.lang.Object remove(java.lang.String oid, java.lang.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 objectOIDDoesNotExistException
InvalidLockException
public abstract java.lang.Object remove(java.lang.String oid) throws OIDDoesNotExistException, LockNotAvailableException
oid
- The unique identifier that references the data object to be removedOIDDoesNotExistException
LockNotAvailableException
public abstract void delete(java.lang.String oid, java.lang.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 objectOIDDoesNotExistException
InvalidLockException
public abstract void delete(java.lang.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 deletedOIDDoesNotExistException
LockNotAvailableException
public abstract java.lang.Object update(java.lang.String oid, java.lang.Object obj, java.lang.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 objectOIDDoesNotExistException
ObjectNotSupportedException
InvalidLockException
public abstract java.lang.Object update(java.lang.String oid, java.lang.Object obj) throws OIDDoesNotExistException, ObjectNotSupportedException, LockNotAvailableException
oid
- The unique identifier that references the data object to be updatedobj
- The new updated data objectOIDDoesNotExistException
ObjectNotSupportedException
LockNotAvailableException
public abstract java.lang.String lock(java.lang.String oid) throws OIDDoesNotExistException, LockNotAvailableException
oid
- The unique identifier that references the data object to be lockedOIDDoesNotExistException
LockNotAvailableException
public abstract boolean unlock(java.lang.String oid, java.lang.String lockKey) throws OIDDoesNotExistException, InvalidLockException
oid
- The unique identifier that references the locked data objectlockKey
- The key corresponding to the lock on this data objectOIDDoesNotExistException
InvalidLockException
public abstract boolean oidExists(java.lang.String oid)
oid
- The unique identifier that references the data objectpublic abstract boolean isLocked(java.lang.String oid)
oid
- The unique identifier that references the data objectpublic abstract boolean isValidLock(java.lang.String oid, java.lang.String lockKey)
oid
- The unique identifier that references the data objectlockKey
- The lock keypublic 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(java.util.List dataToAdd)
dataToAdd
- The list of OIDs for data added to this managerprotected abstract void fireDataChangedEvent(java.util.List dataToChange)
dataToChange
- The list of OIDs for data changed by this managerprotected abstract void fireDataRemovedEvent(java.util.List dataToRemove)
dataToRemove
- The list of OIDs for data removed by this manager