public abstract class DataManager
extends java.lang.Object
implements java.io.Serializable
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 |
---|
DataManager() |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
delete(java.lang.String oid)
Deletes an existing data object iff the object is not locked.
|
abstract boolean |
delete(java.lang.String oid,
java.lang.String lockKey)
Deletes an existing data object, assuming the caller had requested and
recieved the necessary lock.
|
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 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 boolean 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 boolean 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 key