|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ados.hestia.utils.io.DBStore
public class DBStore
This realize IStore interface using database to store data.
com.ados.hestia.db.Processor
,
Serialized FormField Summary | |
---|---|
protected DBStoreKey |
m_key
|
protected static HashMap<String,Processor> |
m_processors
Store correlation beetween id and processor. |
protected String |
m_repositoryID
|
static int |
MEM_SWITCH_LIMIT
|
Constructor Summary | |
---|---|
|
DBStore(String repositoryID)
Construct empty DBStore (data size is 0). |
protected |
DBStore(String repositoryID,
String storeID)
Read Store description from DB. |
|
DBStore(String repositoryID,
String storeID,
InputStream stream)
Construct DBStore. |
Method Summary | |
---|---|
OutputStream |
createStream()
Create output stream to write data. |
protected byte[] |
getContent()
Read content of Store to memory. |
String |
getID()
Returns id of store. |
Processor |
getProcessor()
Returns processor that is responsible for database access. Used repository identification to lookup at static map |
long |
getSize()
Returns size of data at store. |
protected void |
initProxy(InputStream stream)
Init stream that does not support mark. |
InputStream |
openSharedStream()
Open shared stream to read data. |
InputStream |
openStream()
Open ordinary stream to read data. |
static void |
registerProcessor(String repositoryID,
Processor processor)
Staticly register processor to work. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MEM_SWITCH_LIMIT
protected DBStoreKey m_key
protected String m_repositoryID
protected static HashMap<String,Processor> m_processors
Constructor Detail |
---|
public DBStore(String repositoryID) throws IOException
repositoryID
- identification of repository that owns this DBStore.
IOException
- if store cannot be allocated at database.public DBStore(String repositoryID, String storeID, InputStream stream) throws IOException
repositoryID
- identification of repository that owns this DBStore.storeID
- store identification across repository.stream
- stream to fill initial content of DBStore.
IOException
- if stream cannot be read or store cannot be allocated.protected DBStore(String repositoryID, String storeID) throws IOException
repositoryID
- identification of repository that owns this DBStore.storeID
- store identification across repository. Must be present at database.
IOException
- if entry does not exist or cannot be read.Method Detail |
---|
public static void registerProcessor(String repositoryID, Processor processor)
id
- repository identification.processor
- processor corresponded Processor for repository.public Processor getProcessor() throws IOException
IOException
- if processor is not available for provided repository.protected void initProxy(InputStream stream) throws IOException
stream
- stream to fill content.
IOException
- if error with stream occured.public String getID()
getID
in interface IStore
public InputStream openStream() throws IOException
openStream
in interface IStore
IOException
- if stream can not be openedprotected byte[] getContent() throws IOException, ProcessorException
IOException
- if data cannot be readed.
ProcessorException
- if processor is not available or database access failed.public InputStream openSharedStream() throws IOException
openSharedStream
in interface IStore
IOException
- if stream can not be openedpublic OutputStream createStream() throws IOException
createStream
in interface IStore
IOException
- if stream can not be openedpublic long getSize()
getSize
in interface IStore
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |