public class DataStore
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
DataStore.DataItem |
| Constructor and Description |
|---|
DataStore(java.lang.String serverName,
MnodeStore mnodeStore) |
| Modifier and Type | Method and Description |
|---|---|
void |
addOrphanListener(MnodeOrphanListener listener) |
void |
destroy() |
long |
getCount() |
protected void |
init() |
boolean |
isClosed() |
boolean |
isDataAvailable(long id,
long dataTime)
Checks if we have the data
|
boolean |
load(long id,
long valueDataTime,
WriteStream os)
Reads the object from the data store.
|
java.sql.Blob |
loadBlob(long id,
long valueDataTime)
Reads the object from the data store.
|
java.io.InputStream |
openInputStream(long id,
long dataTime)
Reads the object from the data store.
|
boolean |
remove(long id,
long time)
Removes the data, returning true on success
|
void |
removeOrphanListener(MnodeOrphanListener listener) |
DataStore.DataItem |
save(java.io.InputStream is,
int length)
Saves the data, returning true on success.
|
DataStore.DataItem |
save(StreamSource source,
int length)
Saves the data, returning true on success.
|
java.lang.String |
toString() |
void |
validateDatabase()
Clears the expired data
|
public DataStore(java.lang.String serverName,
MnodeStore mnodeStore)
throws java.lang.Exception
java.lang.Exceptionprotected void init()
throws java.lang.Exception
java.lang.Exceptionpublic void addOrphanListener(MnodeOrphanListener listener)
public void removeOrphanListener(MnodeOrphanListener listener)
public boolean load(long id,
long valueDataTime,
WriteStream os)
id - the hash identifier for the dataos - the WriteStream to hold the datapublic java.sql.Blob loadBlob(long id,
long valueDataTime)
id - the hash identifier for the dataos - the WriteStream to hold the datapublic boolean isDataAvailable(long id,
long dataTime)
id - the hash identifier for the datapublic java.io.InputStream openInputStream(long id,
long dataTime)
id - the hash identifier for the dataos - the WriteStream to hold the datapublic DataStore.DataItem save(StreamSource source, int length) throws java.io.IOException
id - the object's unique id.is - the input stream to the serialized objectlength - the length object the serialized objectjava.io.IOExceptionpublic DataStore.DataItem save(java.io.InputStream is, int length) throws java.io.IOException
id - the object's unique id.is - the input stream to the serialized objectlength - the length object the serialized objectjava.io.IOExceptionpublic boolean remove(long id,
long time)
id - the data's unique id.public void validateDatabase()
public long getCount()
public boolean isClosed()
public void destroy()
public java.lang.String toString()
toString in class java.lang.Object