@Service public interface Storage
Modifier and Type | Method and Description |
---|---|
Connection |
getConnection()
Returns the Connection object that may be used to manage connections
to this Storage.
|
InputStream |
loadFile(String filename)
Load the file with the given name and return the data as an InputStream.
|
<T extends Pojo> |
prepareStatement(StatementDescriptor<T> desc)
Prepares the given statement for execution.
|
void |
purge(String agentId)
Drop all data related to the specified agent.
|
void |
registerCategory(Category<?> category)
Register the category into the Storage.
|
void |
saveFile(String filename,
InputStream data)
Save the contents of the input stream as the given name.
|
void |
shutdown()
Shutdown the storage
|
void registerCategory(Category<?> category)
StorageException
- If the category can not be registered for some reason<T extends Pojo> PreparedStatement<T> prepareStatement(StatementDescriptor<T> desc) throws DescriptorParsingException
desc
- The statement descriptor to prepare.PreparedStatement
if the given statement descriptor was
known and did not fail to parse.DescriptorParsingException
- If the descriptor string failed to parse.IllegalDescriptorException
- If storage refused to prepare a statement descriptor for
security reasons.Connection getConnection()
void purge(String agentId)
agentId
- The id of the agentStorageException
- If the purge operation failsvoid saveFile(String filename, InputStream data)
filename
- the name to save this data stream as. This must be unique
across all machines and processes using the storage or it will
overwrite data.data
- the data to saveStorageException
- If the save operation failsInputStream loadFile(String filename)
InputStream
or null
if not found.StorageException
- If the load operation failsvoid shutdown()
StorageException
- If the shutdown operation failsCopyright © 2014. All rights reserved.