public class WebStorage extends Object implements Storage, SecureStorage
| Constructor and Description |
|---|
WebStorage(StartupConfiguration config) |
| Modifier and Type | Method and Description |
|---|---|
Add |
createAdd(Category<?> into) |
<T extends Pojo> |
createQuery(Category<T> category) |
Remove |
createRemove() |
Replace |
createReplace(Category<?> into) |
Update |
createUpdate(Category<?> category) |
AuthToken |
generateToken()
Generates a token in the storage that can be used to authenticate cmd channel requests.
|
String |
getAgentId() |
Connection |
getConnection()
Returns the Connection object that may be used to manage connections
to this Storage.
|
long |
getCount(Category<?> category) |
InputStream |
loadFile(String name) |
void |
purge(String agentId)
Drop all data related to the currently running agent.
|
void |
registerCategory(Category<?> category) |
void |
removePojo(Remove remove) |
void |
saveFile(String name,
InputStream in) |
void |
setAgentId(UUID agentId) |
void |
setAuthConfig(String username,
String password) |
void |
setEndpoint(String endpoint) |
void |
shutdown() |
boolean |
verifyToken(AuthToken authToken)
Verifies the specified token in the storage.
|
public WebStorage(StartupConfiguration config) throws StorageException
StorageExceptionpublic void registerCategory(Category<?> category) throws StorageException
registerCategory in interface StorageStorageExceptionpublic <T extends Pojo> Query<T> createQuery(Category<T> category)
createQuery in interface Storagepublic Remove createRemove()
createRemove in interface Storagepublic Update createUpdate(Category<?> category)
createUpdate in interface Storagepublic String getAgentId()
getAgentId in interface Storagepublic Connection getConnection()
StoragegetConnection in interface Storagepublic long getCount(Category<?> category) throws StorageException
getCount in interface StorageStorageExceptionpublic InputStream loadFile(String name) throws StorageException
loadFile in interface StorageStorageExceptionpublic void purge(String agentId) throws StorageException
Storagepurge in interface StorageStorageExceptionpublic Replace createReplace(Category<?> into)
createReplace in interface Storagepublic void removePojo(Remove remove) throws StorageException
removePojo in interface StorageStorageExceptionpublic void saveFile(String name, InputStream in) throws StorageException
saveFile in interface StorageStorageExceptionpublic void setAgentId(UUID agentId)
setAgentId in interface Storagepublic void setEndpoint(String endpoint)
public AuthToken generateToken() throws StorageException
SecureStoragegenerateToken in interface SecureStorageStorageException - if authentication fails at this pointpublic boolean verifyToken(AuthToken authToken)
SecureStorageverifyToken in interface SecureStoragetrue if authentication succeeded, false otherwiseCopyright © 2013. All Rights Reserved.