gr.uoa.di.madgik.grs.store.buffer
Interface IBufferStore

All Known Implementing Classes:
CacheBufferStore, FileBufferStore

public interface IBufferStore

This interface defines the way a storage based IBuffer holder behaves in order to provide permanent storage to a set of incoming locators. Based on the order specified using the IBufferStore.MultiplexType, the data of the incoming IBuffers are persisted using the technology chosen by the interface implementations. The data persisted through this procedure are accessible to recreate a new IBuffer using the BufferStoreReader

Author:
gpapanikos

Nested Class Summary
static class IBufferStore.MultiplexType
          Indicates the way that the incoming locators are read and their data persisted in the underlying storage device
 
Method Summary
 void associateStoreReader(BufferStoreReader reader)
          Associates a BufferStoreReader with the IBufferStore that is has been initialized to access.
 void dispose()
          Disposes all the resources that are internally managed by the IBufferStore
 java.util.ArrayList<BufferStoreEntry> getEntries()
          Retrieves the BufferStoreEntrys that represent the status for all incoming locators and their respective readers and status as well as their persistency location and IRecordStores
 long getInactivityTimeout()
          The timeout of the inactivity period after which the IBufferStore is eligible for disposal.
 java.util.concurrent.TimeUnit getInactivityTimeUnit()
          The time unit used to define the timeout of the inactivity period after which the IBufferStore is eligible for disposal.
 java.lang.String getKey()
          Retrieves the key by which this IBufferStore is registered and referenced through a GRSRegistry
 long getLastActivityTime()
          Retrieves the last activity time over this IBufferStore
 java.net.URI[] getLocators()
          Retrieves the locators over which the IBufferStore operates
 java.lang.Object getModificationObject()
          Retrieves a synchronization object that can be used in a standard wait / notify block to notify requesters of when an additional object has been made available in the underlying storage from the input readers
 IBufferStore.MultiplexType getMultiplexType()
          Retrieves the IBufferStore.MultiplexType indicating the way the input locators are used and in which order their data is received
 long getReaderTimeout()
          Retrieves the timeout that should be used by the readers utilized to access the input locators.
 java.util.concurrent.TimeUnit getReaderTimeoutTimeUnit()
          Retrieves the timeout unit that should be used by the readers utilized to access the input locators.
 void initialize()
          Make any needed initialization before the store() is called to start the storing procedure
 void markActivity()
          Update the last activity time to the current time
 void setKey(java.lang.String key)
          Sets the key by which this IBufferStore is registered and referenced through a GRSRegistry
 void setLocators(java.net.URI[] locators)
          Sets the incoming locators that should be stored
 void setMultiplexType(IBufferStore.MultiplexType multiplex)
          Sets the IBufferStore.MultiplexType indicating the way the input locators are used and in which order their data is received
 void setReaderTimeout(long timeout)
          Sets the timeout that should be used by the readers utilized to access the input locators.
 void setReaderTimeoutTimeUnit(java.util.concurrent.TimeUnit unit)
          Sets the timeout unit that should be used by the readers utilized to access the input locators.
 void store()
          Start retrieving data from the input locators and storing them according to the specific IBufferStore implementation
 

Method Detail

associateStoreReader

void associateStoreReader(BufferStoreReader reader)
Associates a BufferStoreReader with the IBufferStore that is has been initialized to access. On disposal of the IBufferStore, the associated BufferStoreReaders are also disposed

Parameters:
reader - the reader to associate

setKey

void setKey(java.lang.String key)
Sets the key by which this IBufferStore is registered and referenced through a GRSRegistry

Parameters:
key - the key

getKey

java.lang.String getKey()
Retrieves the key by which this IBufferStore is registered and referenced through a GRSRegistry

Returns:
the key

getModificationObject

java.lang.Object getModificationObject()
Retrieves a synchronization object that can be used in a standard wait / notify block to notify requesters of when an additional object has been made available in the underlying storage from the input readers

Returns:
the synchronization object

getMultiplexType

IBufferStore.MultiplexType getMultiplexType()
Retrieves the IBufferStore.MultiplexType indicating the way the input locators are used and in which order their data is received

Returns:
the type of multiplex

setMultiplexType

void setMultiplexType(IBufferStore.MultiplexType multiplex)
                      throws GRS2BufferStoreException
Sets the IBufferStore.MultiplexType indicating the way the input locators are used and in which order their data is received

Parameters:
multiplex - the type of multiplex
Throws:
GRS2BufferStoreException - The status of the IBufferStore does not allow this operation to be completed

getLocators

java.net.URI[] getLocators()
Retrieves the locators over which the IBufferStore operates

Returns:
the locators

setLocators

void setLocators(java.net.URI[] locators)
                 throws GRS2BufferStoreException
Sets the incoming locators that should be stored

Parameters:
locators - the locators which data should be stored
Throws:
GRS2BufferStoreException - The status of the IBufferStore does not allow this operation to be completed

getEntries

java.util.ArrayList<BufferStoreEntry> getEntries()
Retrieves the BufferStoreEntrys that represent the status for all incoming locators and their respective readers and status as well as their persistency location and IRecordStores

Returns:
the list of persistency entries per incoming locator

getReaderTimeout

long getReaderTimeout()
Retrieves the timeout that should be used by the readers utilized to access the input locators. This value is interpreted in conjunction with getReaderTimeoutTimeUnit()

Returns:
the timeout

setReaderTimeout

void setReaderTimeout(long timeout)
Sets the timeout that should be used by the readers utilized to access the input locators. This value is interpreted in conjunction with setReaderTimeoutTimeUnit(TimeUnit)

Parameters:
timeout - the timeout

getReaderTimeoutTimeUnit

java.util.concurrent.TimeUnit getReaderTimeoutTimeUnit()
Retrieves the timeout unit that should be used by the readers utilized to access the input locators. This value is interpreted in conjunction with getReaderTimeout()

Returns:
the timeout time unit

setReaderTimeoutTimeUnit

void setReaderTimeoutTimeUnit(java.util.concurrent.TimeUnit unit)
Sets the timeout unit that should be used by the readers utilized to access the input locators. This value is interpreted in conjunction with setReaderTimeout(long)

Parameters:
unit - the timeout time unit

getInactivityTimeout

long getInactivityTimeout()
The timeout of the inactivity period after which the IBufferStore is eligible for disposal. This value is to be interpreted in conjunction with the value of getInactivityTimeUnit()

Returns:
the timeout value

getInactivityTimeUnit

java.util.concurrent.TimeUnit getInactivityTimeUnit()
The time unit used to define the timeout of the inactivity period after which the IBufferStore is eligible for disposal. This value is to be interpreted in conjunction with the value of getInactivityTimeout()

Returns:
the time unit of the timeout

getLastActivityTime

long getLastActivityTime()
Retrieves the last activity time over this IBufferStore

Returns:
the last activity time

markActivity

void markActivity()
Update the last activity time to the current time


initialize

void initialize()
                throws GRS2BufferStoreException
Make any needed initialization before the store() is called to start the storing procedure

Throws:
GRS2BufferStoreException - The initialization could not be performed

store

void store()
Start retrieving data from the input locators and storing them according to the specific IBufferStore implementation


dispose

void dispose()
Disposes all the resources that are internally managed by the IBufferStore