de.fzj.unicore.wsrflite.persistence
Interface Store

All Superinterfaces:
IPersistenceProperties
All Known Implementing Classes:
AbstractStore, InMemory, Persistence

public interface Store
extends IPersistenceProperties

Persistent storage interface

Author:
schuller, daivandy

Field Summary
 
Fields inherited from interface de.fzj.unicore.wsrflite.persistence.IPersistenceProperties
WSRF_PERSIST_CLASSNAME, WSRF_PERSIST_STORAGE_DIRECTORY
 
Method Summary
 WSRFInstance getForUpdate(String uniqueID, long time, TimeUnit timeUnit)
          get and lock a live instance from storage.
 Map<String,Calendar> getTerminationTimes()
          gets current termination times for all ws-resources in this store
 String[] getUniqueIDs()
          retrieve a list of all unique ids
 void init(String serviceName)
          initialise the store
 void persist(WSRFInstance inst)
          persist a single wsrf instance
 void purgePersistentData()
          Fully deletes persistent data, for example after service undeployment
 WSRFInstance read(String uniqueID)
          read an instance from storage.
 void remove(String uniqueID)
          Delete an instance, and cleanup the persistence.
 void setTerminationTime(String uniqueID, Calendar c)
          sets termination time for a ws-resource
 void shutdown()
          shutdown the store
 int size()
          returns the number of instances in this store
 void unlock(WSRFInstance wsrfInstance)
          clear lock for the given instance
 

Method Detail

init

void init(String serviceName)
initialise the store

Parameters:
serviceName - The name of the service that is persisted

shutdown

void shutdown()
shutdown the store


persist

void persist(WSRFInstance inst)
persist a single wsrf instance

Parameters:
inst -

getUniqueIDs

String[] getUniqueIDs()
retrieve a list of all unique ids

Returns:

read

WSRFInstance read(String uniqueID)
read an instance from storage.

Returns:
null if instance does not exist

getForUpdate

WSRFInstance getForUpdate(String uniqueID,
                          long time,
                          TimeUnit timeUnit)
                          throws TimeoutException
get and lock a live instance from storage.
This is necessary to aquire write permission

Parameters:
uniqueID - - the id of the instance to read
time - - the maximum time to wait when aquiring a lock
timeUnit - - the time units
Throws:
TimeoutException

unlock

void unlock(WSRFInstance wsrfInstance)
clear lock for the given instance

Parameters:
wsrfInstance -

remove

void remove(String uniqueID)
Delete an instance, and cleanup the persistence. A held lock will be released and deleted.

Parameters:
uniqueID -

size

int size()
returns the number of instances in this store

Returns:

setTerminationTime

void setTerminationTime(String uniqueID,
                        Calendar c)
                        throws Exception
sets termination time for a ws-resource

Parameters:
String - uniqueID - ws-resource id
Calendar - c - termination time for this ws-resource. May be null to indicate infinite lifetime
Throws:
Exception

getTerminationTimes

Map<String,Calendar> getTerminationTimes()
gets current termination times for all ws-resources in this store

Returns:
Map terminationTimes

purgePersistentData

void purgePersistentData()
Fully deletes persistent data, for example after service undeployment



Copyright © 2010. All Rights Reserved.