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
StorageException
public void registerCategory(Category<?> category) throws StorageException
registerCategory
in interface Storage
StorageException
public <T extends Pojo> Query<T> createQuery(Category<T> category)
createQuery
in interface Storage
public Remove createRemove()
createRemove
in interface Storage
public Update createUpdate(Category<?> category)
createUpdate
in interface Storage
public String getAgentId()
getAgentId
in interface Storage
public Connection getConnection()
Storage
getConnection
in interface Storage
public long getCount(Category<?> category) throws StorageException
getCount
in interface Storage
StorageException
public InputStream loadFile(String name) throws StorageException
loadFile
in interface Storage
StorageException
public void purge(String agentId) throws StorageException
Storage
purge
in interface Storage
StorageException
public Replace createReplace(Category<?> into)
createReplace
in interface Storage
public void removePojo(Remove remove) throws StorageException
removePojo
in interface Storage
StorageException
public void saveFile(String name, InputStream in) throws StorageException
saveFile
in interface Storage
StorageException
public void setAgentId(UUID agentId)
setAgentId
in interface Storage
public void setEndpoint(String endpoint)
public AuthToken generateToken() throws StorageException
SecureStorage
generateToken
in interface SecureStorage
StorageException
- if authentication fails at this pointpublic boolean verifyToken(AuthToken authToken)
SecureStorage
verifyToken
in interface SecureStorage
true
if authentication succeeded, false
otherwiseCopyright © 2013. All rights reserved.