|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ados.hestia.utils.io.SmartStore
public class SmartStore
Automatically switch Memory based IStore File based IStore.
FileStore
,
MemoryStore
,
This is used to prevent using uncontroling memory resources.
If Store with big data size will be found then automatically
MemoryStore will be converted to FileStore and futher FileStore
will be used.
,
Serialized FormNested Class Summary | |
---|---|
protected class |
SmartStore.SmartStoreOutStream
|
Field Summary | |
---|---|
protected File |
m_baseFolder
Temporary folder where FileStore will be allocated. |
protected String |
m_id
|
protected String |
m_repositoryID
|
protected IStore |
m_store
|
protected static int |
MEMORY_LIMIT
|
Constructor Summary | |
---|---|
SmartStore(String repositoryID,
File baseFolder)
|
Method Summary | |
---|---|
OutputStream |
createStream()
Create output stream to write data. |
protected IStore |
getActiveStore()
|
String |
getID()
Returns id of store. |
long |
getSize()
Returns size of data at store. |
InputStream |
openSharedStream()
Open shared stream to read data. |
InputStream |
openStream()
Open ordinary stream to read data. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final int MEMORY_LIMIT
protected IStore m_store
protected String m_id
protected String m_repositoryID
protected File m_baseFolder
Constructor Detail |
---|
public SmartStore(String repositoryID, File baseFolder)
Method Detail |
---|
public OutputStream createStream() throws IOException
IStore
createStream
in interface IStore
IOException
- if stream can not be openedcom.ados.hestia.store.IStore#createStream()
protected IStore getActiveStore() throws IOException
IOException
public long getSize()
IStore
getSize
in interface IStore
com.ados.hestia.store.IStore#getSize()
public InputStream openSharedStream() throws IOException
IStore
openSharedStream
in interface IStore
IOException
- if stream can not be openedcom.ados.hestia.store.IStore#openSharedStream()
public InputStream openStream() throws IOException
IStore
openStream
in interface IStore
IOException
- if stream can not be openedcom.ados.hestia.store.IStore#openStream()
public String getID()
IStore
getID
in interface IStore
com.ados.hestia.store.IStore#getID()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |