|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.keridwen.core.data.storage.service.impl.DefaultDataStorageService
public class DefaultDataStorageService
Constructor Summary | |
---|---|
DefaultDataStorageService()
|
Method Summary | ||
---|---|---|
boolean |
addDataPacketListener(DataPacketId packetId,
DataPacketListener listener)
Adds a listener on a data packet with given Id. |
|
boolean |
addDataStorageListener(DataStorageListener listener)
Adds a listener on this data storage. |
|
Set<DataPacketId> |
getDataListSafe(Class<?> objectClass)
Gets the list of ids for the objects of the given type. |
|
Set<DataPacketId> |
getDataListUnsafe(Class<?> objectClass)
Gets the list of ids for the objects of the given type. |
|
|
getDataSafe(DataPacketId packetId)
Gets the data object corresponding to the given unique id. |
|
|
getDataSafe(String objectName)
Gets the data object corresponding to the given name. |
|
|
getDataUnsafe(DataPacketId packetId)
Gets the data object corresponding to the given unique id. |
|
|
getDataUnsafe(String objectName)
Gets the data object corresponding to the given name. |
|
int |
getNbData()
Get the total number of stored data (safe+unsafe). |
|
String |
getPacketInformation(DataPacketId packetId)
Gets the information of the packet with the given id. |
|
Boolean |
isReadLocked(DataPacketId packetId)
Checks if the data packet with the given id is read locked. |
|
Boolean |
isWriteLocked(DataPacketId packetId)
Checks if the data packet with the given id is write locked. |
|
void |
onStartModule()
|
|
void |
onStopModule()
|
|
boolean |
removeDataPacketListener(DataPacketId packetId,
DataPacketListener listener)
Removes a listener from a data packet with given Id. |
|
boolean |
removeDataStorageListener(DataStorageListener listener)
Removes a listener from this data storage. |
|
boolean |
setDataSafe(Serializable serializableObject,
DataPacketId packetId)
Sets the object with the given unique id in the data storage. |
|
DataPacketId |
setDataSafe(String name,
Serializable serializableObject)
Sets the object with the given name in the data storage. |
|
|
setDataUnsafe(String name,
ObjectType object)
Sets the object with the given name in the data storage. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultDataStorageService()
Method Detail |
---|
public void onStartModule()
onStartModule
in interface DataStorageService
public void onStopModule()
onStopModule
in interface DataStorageService
public int getNbData()
DataStorage
getNbData
in interface DataStorage
public <ObjectType> DataPacketId setDataUnsafe(String name, ObjectType object) throws DataIOException
DataStorage
setDataUnsafe
in interface DataStorage
ObjectType
- the type of the object to setname
- the object nameobject
- the object to set
DataIOException
- if the data writting failedpublic DataPacketId setDataSafe(String name, Serializable serializableObject) throws DataIOException, DataConcurrencyException
DataStorage
setDataSafe
in interface DataStorage
name
- the object nameserializableObject
- the object to set
DataIOException
- if the data writting failed
DataConcurrencyException
- in case of concurrent access to the datapublic boolean setDataSafe(Serializable serializableObject, DataPacketId packetId) throws DataIOException, DataConcurrencyException
DataStorage
setDataSafe
in interface DataStorage
serializableObject
- the object to setpacketId
- the unique id of the object to set
DataIOException
- if the data writting failed
DataConcurrencyException
- in case of concurrent access to the datapublic <ObjectType> ObjectType getDataUnsafe(DataPacketId packetId) throws DataIOException
DataStorage
getDataUnsafe
in interface DataStorage
packetId
- the unique id of the object to retrieve
DataIOException
- in case data reading failedpublic <ObjectType extends Serializable> ObjectType getDataSafe(String objectName) throws DataIOException, DataConcurrencyException
DataStorage
getDataSafe
in interface DataStorage
objectName
- the name of the object to retrieve
DataIOException
- in case data reading failed
DataConcurrencyException
- in case of concurrent access to the datapublic <ObjectType> ObjectType getDataUnsafe(String objectName) throws DataIOException
DataStorage
getDataUnsafe
in interface DataStorage
objectName
- the name of the object to retrieve
DataIOException
- in case data reading failedpublic <ObjectType extends Serializable> ObjectType getDataSafe(DataPacketId packetId) throws DataIOException, DataConcurrencyException
DataStorage
getDataSafe
in interface DataStorage
packetId
- the unique id of the object to retrieve
DataIOException
- in case data reading failed
DataConcurrencyException
- in case of concurrent access to the datapublic Set<DataPacketId> getDataListSafe(Class<?> objectClass)
DataStorage
getDataListSafe
in interface DataStorage
objectClass
- the type of object to fetch
public Set<DataPacketId> getDataListUnsafe(Class<?> objectClass)
DataStorage
getDataListUnsafe
in interface DataStorage
objectClass
- the type of object to fetch
public boolean addDataPacketListener(DataPacketId packetId, DataPacketListener listener)
DataStorage
addDataPacketListener
in interface DataStorage
packetId
- the id of the packet to listenpublic boolean removeDataPacketListener(DataPacketId packetId, DataPacketListener listener)
DataStorage
removeDataPacketListener
in interface DataStorage
packetId
- the id of the packet to stop listenningpublic String getPacketInformation(DataPacketId packetId)
DataStorage
getPacketInformation
in interface DataStorage
packetId
- the id of the packet
public Boolean isWriteLocked(DataPacketId packetId)
DataStorage
isWriteLocked
in interface DataStorage
packetId
- the id of the packet to check
public Boolean isReadLocked(DataPacketId packetId)
DataStorage
isReadLocked
in interface DataStorage
packetId
- the id of the packet to check
public boolean addDataStorageListener(DataStorageListener listener)
DataStorage
addDataStorageListener
in interface DataStorage
listener
- the listener to addpublic boolean removeDataStorageListener(DataStorageListener listener)
DataStorage
removeDataStorageListener
in interface DataStorage
listener
- the listener to remove
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |