|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.gcube.common.core.persistence.GCUBEPersistenceDelegate<RESOURCEID,RESOURCE>
org.gcube.common.core.persistence.GCUBEFilePersistenceDelegate<RESOURCEID,RESOURCE>
RESOURCE - the resource type.RESOURCEID - the identifier of the resource type.public abstract class GCUBEFilePersistenceDelegate<RESOURCEID,RESOURCE extends GCUBEStatefulResource<RESOURCEID>>
A partial specialisation of GCUBEPersistenceDelegate suitable for file storage.
| Field Summary |
|---|
| Fields inherited from class org.gcube.common.core.persistence.GCUBEPersistenceDelegate |
|---|
logger |
| Constructor Summary | |
|---|---|
GCUBEFilePersistenceDelegate()
|
|
| Method Summary | |
|---|---|
protected abstract File |
getFileFromResource(RESOURCE resource)
Returns the file serialisation of a resource. |
protected abstract RESOURCEID |
getIDFromFileName(String s)
Returns a resource identifier from a string. |
Collection<RESOURCEID> |
getResourceIdentifiers()
Returns the identifiers of all the resources serialised by the delegate. |
protected File |
getStorageRoot()
Returns the root directory for file storage. |
protected abstract String |
getSuffix()
Returns the suffix for resource file serialisations. |
void |
initialise(GCUBEResourceHome<? super RESOURCEID,RESOURCEID,RESOURCE> home)
Initialises the delegate from the GCUBEResourceHome of the associated resources. |
protected void |
onLoad(RESOURCE resource,
boolean firstLoad)
Invoked by GCUBEPersistenceDelegate.load(GCUBEStatefulResource, boolean) to deserialise a resource. |
protected void |
onLoad(RESOURCE resource,
ObjectInputStream stream)
Deserialises the state of resource from a ObjectInputStream. |
protected void |
onRemove(RESOURCE resource)
Invoked by GCUBEPersistenceDelegate.remove(GCUBEStatefulResource) to remove the serialisation of a resource. |
protected void |
onStore(RESOURCE resource)
Invoked by GCUBEPersistenceDelegate.store(GCUBEStatefulResource) to serialise a resource. |
protected void |
onStore(RESOURCE resource,
ObjectOutputStream stream)
Serialises the state of a resource into a ObjectOutputStream. |
| Methods inherited from class org.gcube.common.core.persistence.GCUBEPersistenceDelegate |
|---|
load, remove, store |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GCUBEFilePersistenceDelegate()
| Method Detail |
|---|
protected File getStorageRoot()
public void initialise(GCUBEResourceHome<? super RESOURCEID,RESOURCEID,RESOURCE> home)
throws Exception
GCUBEResourceHome of the associated resources.
initialise in class GCUBEPersistenceDelegate<RESOURCEID,RESOURCE extends GCUBEStatefulResource<RESOURCEID>>home - the home.
Exception - if the delegate could not be initialised.
protected void onLoad(RESOURCE resource,
boolean firstLoad)
throws Exception
GCUBEPersistenceDelegate.load(GCUBEStatefulResource, boolean) to deserialise a resource.
Implement in accordance with resource and serialisation semantics.
onLoad in class GCUBEPersistenceDelegate<RESOURCEID,RESOURCE extends GCUBEStatefulResource<RESOURCEID>>firstLoad - true if the resource has not been previously loaded since the container last booted, false otherwise.
Exception - if the resource could not be deserialised.GCUBEPersistenceDelegate.load(GCUBEStatefulResource, boolean)
protected void onStore(RESOURCE resource)
throws Exception
GCUBEPersistenceDelegate.store(GCUBEStatefulResource) to serialise a resource.
Implement in accordance with serialisation and resource semantics.
onStore in class GCUBEPersistenceDelegate<RESOURCEID,RESOURCE extends GCUBEStatefulResource<RESOURCEID>>Exception - if the resource could not be serialised.GCUBEPersistenceDelegate.store(GCUBEStatefulResource)
protected void onLoad(RESOURCE resource,
ObjectInputStream stream)
throws Exception
ObjectInputStream.
Extends in accordance with resource semantics.
stream - the stream.
Exception - if the stream could not be processed.
protected void onStore(RESOURCE resource,
ObjectOutputStream stream)
throws Exception
ObjectOutputStream.
Extend in accordance with resource semantics.
stream - the stream.
Exception - if the stream could not be processed.
protected void onRemove(RESOURCE resource)
throws IOException
GCUBEPersistenceDelegate.remove(GCUBEStatefulResource) to remove the serialisation of a resource.
Implement in accordance with serialisation and resource semantics.
onRemove in class GCUBEPersistenceDelegate<RESOURCEID,RESOURCE extends GCUBEStatefulResource<RESOURCEID>>IOExceptionGCUBEPersistenceDelegate.remove(GCUBEStatefulResource)public Collection<RESOURCEID> getResourceIdentifiers()
getResourceIdentifiers in class GCUBEPersistenceDelegate<RESOURCEID,RESOURCE extends GCUBEStatefulResource<RESOURCEID>>protected abstract File getFileFromResource(RESOURCE resource)
protected abstract String getSuffix()
protected abstract RESOURCEID getIDFromFileName(String s)
s - the string.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||