R
- the raw value typepublic static class NullImplementation.NullPersistenceManager<R> extends Object implements com.oracle.datagrid.persistence.PersistenceManager<R>, com.oracle.datagrid.persistence.PersistenceTools
PersistenceManager
that does nothing.Modifier and Type | Field and Description |
---|---|
static NullImplementation.NullPersistenceManager |
INSTANCE
Singleton instance of a NullPersistenceManager.
|
Constructor and Description |
---|
NullPersistenceManager() |
Modifier and Type | Method and Description |
---|---|
void |
close(String sId)
Close the associated PersistentStore and release exclusive access to
the associated resources.
|
com.oracle.datagrid.persistence.PersistentStore |
createStore(String sId)
Create a
PersistentStore associated with the specified
identifier. |
boolean |
delete(String sId,
boolean fSafe)
Remove the PersistentStore associated with the specified identifier.
|
String |
getName()
Return the name of this manager.
|
com.oracle.datagrid.persistence.OfflinePersistenceInfo |
getPersistenceInfo()
Return summary information regarding the available
PersistentStore s
under the context of the PersistenceManager (snapshot or archived
snapshot). |
com.oracle.datagrid.persistence.PersistenceTools |
getPersistenceTools()
Return an instance of
PersistenceTools allowing offline operations
to be performed against the associated PersistenceManager and appropriate
PersistentStore . |
com.oracle.datagrid.persistence.PersistenceStatistics |
getStatistics()
Return a
PersistenceStatistics object representing the available
PersistentStore s under the context of the associated PersistenceManager (snapshot or archived snapshot). |
String[] |
list()
Return the identifiers of the PersistentStores known to this manager.
|
String[] |
listOpen()
Return the identifiers of PersistentStores that are currently open.
|
com.oracle.datagrid.persistence.PersistentStore<R> |
open(String sId,
com.oracle.datagrid.persistence.PersistentStore<R> store)
Open or create a
PersistentStore associated with the specified
identifier and based on the provided store . |
com.oracle.datagrid.persistence.PersistentStore<R> |
open(String sId,
com.oracle.datagrid.persistence.PersistentStore<R> store,
Collector<Object> collector)
Open or create a
PersistentStore associated with the specified
identifier and based on the provided store . |
void |
read(String sId,
InputStream in)
Read the PersistenceStore associated with the specified identifier
from the given input stream, making it available to this manager.
|
void |
release()
Release all resources held by this manager.
|
void |
validate()
Validate the available
PersistentStore s under the context of the
associated PersistenceManager (snapshot or archived snapshot). |
void |
write(String sId,
OutputStream out)
Write the PersistentStore associated with the specified identifier to
the given output stream.
|
public static final NullImplementation.NullPersistenceManager INSTANCE
public String getName()
getName
in interface com.oracle.datagrid.persistence.PersistenceManager<R>
public com.oracle.datagrid.persistence.PersistentStore createStore(String sId)
com.oracle.datagrid.persistence.PersistenceManager
PersistentStore
associated with the specified
identifier.
Creation of a store suggests its registration but has no usage
until it transitions into a state of open. The implementation may
choose to forgo any resource allocation until the caller
opens
the same identifier.
createStore
in interface com.oracle.datagrid.persistence.PersistenceManager<R>
sId
- a unique identifier of the storepublic com.oracle.datagrid.persistence.PersistentStore<R> open(String sId, com.oracle.datagrid.persistence.PersistentStore<R> store)
PersistentStore
associated with the specified
identifier and based on the provided store
.
Upon a new store being created the provided store should be used as the basis for the new store such that the extents and associated data is available in the returned store. This provides an opportunity for an implementation to optimize initializing the new store based upon knowledge of the storage mechanics.
open
in interface com.oracle.datagrid.persistence.PersistenceManager<R>
sId
- a unique identifier for the storestore
- the PersistenceStore the new store should be based uponpublic com.oracle.datagrid.persistence.PersistentStore<R> open(String sId, com.oracle.datagrid.persistence.PersistentStore<R> store, Collector<Object> collector)
PersistentStore
associated with the specified
identifier and based on the provided store
.
Upon a new store being created the provided store should be used as the basis for the new store such that the extents and associated data is available in the returned store. This provides an opportunity for an implementation to optimize initializing the new store based upon knowledge of the storage mechanics.
Providing a Collector
allows the open operation to be performed
asynchronously. This may be desirable when the calling thread can not
be blocked on IO operations that are required when creating a new store
based on an old store (storeFrom
). Open is only non-blocking when
both an old store and a Collector are provided. Upon completion
of an asynchronous open request the provided Collector is called with
either a String (GUID) or an AsyncPersistenceException, thus notifying
the collector of success of failure respectively.
Note: the behavior of a returned store that has not been opened is undefined.
open
in interface com.oracle.datagrid.persistence.PersistenceManager<R>
sId
- a unique identifier for the storestore
- the PersistenceStore the new store should be based uponcollector
- the Collector to notify once the store has been opened
or failed to open; the collector will either receive
a String (GUID) or an AsyncPersistenceExceptionpublic void close(String sId)
close
in interface com.oracle.datagrid.persistence.PersistenceManager<R>
sId
- a unique identifier of the store to closepublic boolean delete(String sId, boolean fSafe)
delete
in interface com.oracle.datagrid.persistence.PersistenceManager<R>
sId
- a unique identifier of the store to removefSafe
- if true, remove the store by moving it to a restorable
location (if possible) rather than deleting itpublic String[] list()
list
in interface com.oracle.datagrid.persistence.PersistenceManager<R>
public String[] listOpen()
listOpen
in interface com.oracle.datagrid.persistence.PersistenceManager<R>
public void read(String sId, InputStream in) throws IOException
read
in interface com.oracle.datagrid.persistence.PersistenceManager<R>
sId
- a unique identifier of the store to readin
- the stream to read fromIOException
- if an error occurred while reading from the streampublic void write(String sId, OutputStream out) throws IOException
write
in interface com.oracle.datagrid.persistence.PersistenceManager<R>
sId
- a unique identifier of the store to writeout
- the stream to write toIOException
- if an error occurred while writing to the streampublic void release()
release
in interface com.oracle.datagrid.persistence.PersistenceManager<R>
public com.oracle.datagrid.persistence.PersistenceTools getPersistenceTools()
PersistenceTools
allowing offline operations
to be performed against the associated PersistenceManager and appropriate
PersistentStore
.getPersistenceTools
in interface com.oracle.datagrid.persistence.PersistenceManager<R>
public com.oracle.datagrid.persistence.OfflinePersistenceInfo getPersistenceInfo()
com.oracle.datagrid.persistence.PersistenceTools
PersistentStore
s
under the context of the PersistenceManager
(snapshot or archived
snapshot).getPersistenceInfo
in interface com.oracle.datagrid.persistence.PersistenceTools
public void validate()
com.oracle.datagrid.persistence.PersistenceTools
PersistentStore
s under the context of the
associated PersistenceManager
(snapshot or archived snapshot).validate
in interface com.oracle.datagrid.persistence.PersistenceTools
public com.oracle.datagrid.persistence.PersistenceStatistics getStatistics()
com.oracle.datagrid.persistence.PersistenceTools
PersistenceStatistics
object representing the available
PersistentStore
s under the context of the associated PersistenceManager
(snapshot or archived snapshot).getStatistics
in interface com.oracle.datagrid.persistence.PersistenceTools