org.gcube.common.core.persistence
Class GCUBEWSLiteFilePersistenceDelegate<LOCAL extends GCUBELocalResource,RESOURCE extends GCUBEWSLiteResource<LOCAL>>

java.lang.Object
  extended by org.gcube.common.core.persistence.GCUBEPersistenceDelegate<RESOURCEID,RESOURCE>
      extended by org.gcube.common.core.persistence.GCUBEFilePersistenceDelegate<GCUBEWSResourceKey,RESOURCE>
          extended by org.gcube.common.core.persistence.GCUBEWSFilePersistenceDelegate<RESOURCE>
              extended by org.gcube.common.core.persistence.GCUBEWSLiteFilePersistenceDelegate<LOCAL,RESOURCE>
Type Parameters:
RESOURCE - the type of the GCUBEWSResourceLite manager by the delegatate.

public class GCUBEWSLiteFilePersistenceDelegate<LOCAL extends GCUBELocalResource,RESOURCE extends GCUBEWSLiteResource<LOCAL>>
extends GCUBEWSFilePersistenceDelegate<RESOURCE>

Specialisation of GCUBEWSFilePersistenceDelegate for GCUBEWSResourceLite.

Author:
Fabio Simeoni (University of Strathclyde).

Field Summary
protected static String WSLITE_FILE_SUFFIX
          The suffix of file serialisation of resource.
 
Fields inherited from class org.gcube.common.core.persistence.GCUBEWSFilePersistenceDelegate
ctxt, WSRESOURCE_FILE_SUFFIX
 
Fields inherited from class org.gcube.common.core.persistence.GCUBEPersistenceDelegate
logger
 
Constructor Summary
GCUBEWSLiteFilePersistenceDelegate()
           
 
Method Summary
protected  String getSuffix()
          Returns the suffix for resource file serialisations.
 void initialise(GCUBEResourceHome<? super GCUBEWSResourceKey,GCUBEWSResourceKey,RESOURCE> home)
          Initialises the delegate from the GCUBEResourceHome of the associated resources.
protected  void onLoad(RESOURCE resource, ObjectInputStream stream)
          Deserialises the state of resource from a ObjectInputStream.
 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.GCUBEWSFilePersistenceDelegate
getFileFromResource, getIDFromFileName
 
Methods inherited from class org.gcube.common.core.persistence.GCUBEFilePersistenceDelegate
getResourceIdentifiers, getStorageRoot, onLoad, onRemove
 
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
 

Field Detail

WSLITE_FILE_SUFFIX

protected static final String WSLITE_FILE_SUFFIX
The suffix of file serialisation of resource.

See Also:
Constant Field Values
Constructor Detail

GCUBEWSLiteFilePersistenceDelegate

public GCUBEWSLiteFilePersistenceDelegate()
Method Detail

initialise

public void initialise(GCUBEResourceHome<? super GCUBEWSResourceKey,GCUBEWSResourceKey,RESOURCE> home)
                throws Exception
Initialises the delegate from the GCUBEResourceHome of the associated resources.

Overrides:
initialise in class GCUBEWSFilePersistenceDelegate<RESOURCE extends GCUBEWSLiteResource<LOCAL>>
Parameters:
home - the home.
Throws:
Exception - if the delegate could not be initialised.

onLoad

protected void onLoad(RESOURCE resource,
                      ObjectInputStream stream)
               throws Exception
Deserialises the state of resource from a ObjectInputStream. Extends in accordance with resource semantics.

Overrides:
onLoad in class GCUBEWSFilePersistenceDelegate<RESOURCE extends GCUBEWSLiteResource<LOCAL>>
stream - the stream.
Throws:
Exception - if the stream could not be processed.

onStore

public void onStore(RESOURCE resource)
             throws Exception
Invoked by GCUBEPersistenceDelegate.store(GCUBEStatefulResource) to serialise a resource. Implement in accordance with serialisation and resource semantics.

Overrides:
onStore in class GCUBEFilePersistenceDelegate<GCUBEWSResourceKey,RESOURCE extends GCUBEWSLiteResource<LOCAL>>
Throws:
Exception - if the resource could not be serialised.
See Also:
GCUBEPersistenceDelegate.store(GCUBEStatefulResource)

onStore

protected void onStore(RESOURCE resource,
                       ObjectOutputStream stream)
                throws Exception
Serialises the state of a resource into a ObjectOutputStream. Extend in accordance with resource semantics.

Overrides:
onStore in class GCUBEWSFilePersistenceDelegate<RESOURCE extends GCUBEWSLiteResource<LOCAL>>
stream - the stream.
Throws:
Exception - if the stream could not be processed.

getSuffix

protected String getSuffix()
Returns the suffix for resource file serialisations.

Overrides:
getSuffix in class GCUBEWSFilePersistenceDelegate<RESOURCE extends GCUBEWSLiteResource<LOCAL>>
Returns:
the suffix


Copyright © 2012. All Rights Reserved.