|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Store
A place to store data as bytes and ByteBuffers. Stores can represent data thats persisted in memory, on disk, or persisted to RAM and sync'd to the file system (mapped). Granting access to opening and creating stores is implementation dependent.
FileStore
,
MappedStore
,
MemoryStore
Method Summary | |
---|---|
int |
capacity()
Returns the size or capacity of the store in bytes. |
int |
capacity(int newCapacity)
Sets the stores size or capacity in bytes. |
void |
close()
Closes this store if not closed already. |
StoreAccess |
create(StoreAccess initialAccess,
int initialCapacity)
Creates the store by opening it with the given access and setting the initial capacity. |
void |
delete()
Removes this store from any persisted medium. |
boolean |
exists()
Whether the store exists. |
void |
flush()
Explicitly writes the data to the store. |
void |
get(int location,
byte[] bytes)
Reads an array of bytes from the store at the given location. |
void |
get(int location,
byte[] bytes,
int offset,
int length)
Reads from the store and puts it in a section in the array of bytes. |
void |
get(int location,
java.nio.ByteBuffer buffer)
Reads a ByteBuffer to the store at the given location. |
byte[] |
get(int location,
int size)
Returns an array of bytes read from the store at the given location. |
StoreAccess |
getAccess()
Returns the current access of this store to its persisted medium if any exists. |
java.lang.String |
getName()
Returns the name of the store. |
boolean |
isAutoFlush()
Whether the store automatically flushes data immediately after its written to the store. |
boolean |
isAutoLoad()
Whether the store automatically loads data immediately before its read from the store. |
boolean |
isAutoOpen()
Whether the store automatically opens with the default or last access if some action needs to be done to the store. |
boolean |
isClosed()
Whether the store is closed. |
boolean |
isOpen()
Whether the store is open. |
void |
load()
Explicitly loads the data from the store into memory. |
StoreAccess |
open(StoreAccess initialAccess)
Explicitly opens this store for reading and writing. |
void |
put(int location,
byte[] bytes)
Writes the array of bytes to the store at the given location. |
void |
put(int location,
byte[] bytes,
int offset,
int length)
Writes a section in the array of bytes to the store at the given location. |
void |
put(int location,
java.nio.ByteBuffer buffer)
Writes a ByteBuffer to the store at the given location. |
StoreAccess |
setAccess(StoreAccess newAccess)
Sets the access of this store to its persisted medium. |
void |
setAutoFlush(boolean autoFlush)
Sets whether the store automatically flushes data immediately after its written to the store. |
void |
setAutoLoad(boolean autoLoad)
Set whether the store automatically loads data immediately before its read from the store. |
void |
setAutoOpen(boolean autoOpen)
Sets whether the store automatically opens with the default or last access if some actions need to be done to the store. |
Method Detail |
---|
java.lang.String getName()
StoreAccess create(StoreAccess initialAccess, int initialCapacity) throws StoreIOException, StoreAccessException
initialAccess
- The requested access to the store.initialCapacity
- The new capacity of the store.
StoreIOException
- An error occurred in the implementation. See attached exception.
StoreAccessException
- The store does not have sufficient access to perform the operation.StoreAccess open(StoreAccess initialAccess) throws StoreIOException
initialAccess
- The requested access to the store.
StoreIOException
- An error occurred in the implementation. See attached exception.void load() throws StoreIOException, StoreClosedException
StoreIOException
- An error occurred in the implementation. See attached exception.
StoreClosedException
- The store is closed. If auto open is set to true this still may be
thrown if there was an error opening the store.void flush() throws StoreIOException, StoreClosedException
StoreIOException
- An error occurred in the implementation. See attached exception.
StoreClosedException
- The store is closed. If auto open is set to true this still may be
thrown if there was an error opening the store.void close() throws StoreIOException
StoreIOException
- An error occurred in the implementation. See attached exception.void delete() throws StoreIOException, StoreAccessException
StoreIOException
- An error occurred in the implementation. See attached exception.
StoreAccessException
- The store does not have sufficient access to perform the operation.boolean exists()
int capacity()
int capacity(int newCapacity) throws StoreIOException, StoreClosedException, StoreAccessException
newCapacity
- The desired capacity of the store.
StoreIOException
- An error occurred in the implementation. See attached exception.
StoreClosedException
- The store is closed. If auto open is set to true this still may be
thrown if there was an error opening the store.
StoreAccessException
- The store does not have sufficient access to perform the operation.StoreAccess getAccess()
StoreAccess setAccess(StoreAccess newAccess)
newAccess
- The requested access to the store.
boolean isClosed()
boolean isOpen()
boolean isAutoOpen()
void setAutoOpen(boolean autoOpen)
autoOpen
- True if the store should automatically open, otherwise false.boolean isAutoFlush()
void setAutoFlush(boolean autoFlush)
autoFlush
- True if the store should automatically flush, otherwise false.boolean isAutoLoad()
void setAutoLoad(boolean autoLoad)
autoLoad
- True if the store should automatically load, otherwise false.void put(int location, byte[] bytes) throws StoreIOException, StoreClosedException, StoreAccessException
location
- The location in the store, the offset of bytes from the beginning.bytes
- The array of bytes to write.
StoreIOException
- An error occurred in the implementation. See attached exception.
StoreClosedException
- The store is closed. If auto open is set to true this still may be
thrown if there was an error opening the store.
StoreAccessException
- The store does not have sufficient access to perform the operation.void put(int location, byte[] bytes, int offset, int length) throws StoreIOException, StoreClosedException, StoreAccessException
location
- The location in the store, the offset of bytes from the beginning.bytes
- The array of bytes to write.offset
- The offset into the array of bytes.length
- The number of bytes to write starting at the offset in the array.
StoreIOException
- An error occurred in the implementation. See attached exception.
StoreClosedException
- The store is closed. If auto open is set to true this still may be
thrown if there was an error opening the store.
StoreAccessException
- The store does not have sufficient access to perform the operation.void put(int location, java.nio.ByteBuffer buffer) throws StoreIOException, StoreClosedException, StoreAccessException
location
- The location in the store, the offset of bytes from the beginning.buffer
- The buffer of data to write. The bytes written to the store are the
bytes that exist between the buffers position and limit.
StoreIOException
- An error occurred in the implementation. See attached exception.
StoreClosedException
- The store is closed. If auto open is set to true this still may be
thrown if there was an error opening the store.
StoreAccessException
- The store does not have sufficient access to perform the operation.void get(int location, byte[] bytes) throws StoreIOException, StoreClosedException, StoreAccessException
location
- The location in the store, the offset of bytes from the beginning.bytes
- The array of bytes to read into.
StoreIOException
- An error occurred in the implementation. See attached exception.
StoreClosedException
- The store is closed. If auto open is set to true this still may be
thrown if there was an error opening the store.
StoreAccessException
- The store does not have sufficient access to perform the operation.void get(int location, byte[] bytes, int offset, int length) throws StoreIOException, StoreClosedException, StoreAccessException
location
- The location in the store, the offset of bytes from the beginning.bytes
- The array of bytes to read into.offset
- The offset into the array of bytes.length
- The number of bytes to read starting at the offset in the array.
StoreIOException
- An error occurred in the implementation. See attached exception.
StoreClosedException
- The store is closed. If auto open is set to true this still may be
thrown if there was an error opening the store.
StoreAccessException
- The store does not have sufficient access to perform the operation.void get(int location, java.nio.ByteBuffer buffer) throws StoreIOException, StoreClosedException, StoreAccessException
location
- The location in the store, the offset of bytes from the beginning.buffer
- The buffer of data to write. The bytes written to the store are the
bytes that exist between the buffers position and limit.
StoreIOException
- An error occurred in the implementation. See attached exception.
StoreClosedException
- The store is closed. If auto open is set to true this still may be
thrown if there was an error opening the store.
StoreAccessException
- The store does not have sufficient access to perform the operation.byte[] get(int location, int size) throws StoreIOException, StoreClosedException, StoreAccessException
location
- The location in the store, the offset of bytes from the beginning.size
- The number of bytes to read and return.
StoreIOException
- An error occurred in the implementation. See attached exception.
StoreClosedException
- The store is closed. If auto open is set to true this still may be
thrown if there was an error opening the store.
StoreAccessException
- The store does not have sufficient access to perform the operation.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |