public interface IStorageService
Provide persistent service for ISObject
| Modifier and Type | Interface and Description |
|---|---|
static class |
IStorageService.f |
| Modifier and Type | Field and Description |
|---|---|
static String |
CONF_CONTEXT_PATH |
static String |
CONF_ID |
static String |
CONF_KEY_GEN |
static String |
DEFAULT |
static osgl.version.Version |
VERSION |
| Modifier and Type | Method and Description |
|---|---|
String |
contextPath()
alias of
getContextPath() |
ISObject |
forceGet(String key)
Deprecated.
|
ISObject |
get(String key)
Retrieve the stuff from the storage by key
|
String |
getContextPath()
Return the context path.
|
ISObject |
getFull(String key)
Force retrieving the stuff with content from storage without regarding to the configuration
|
String |
getKey() |
String |
getKey(String key) |
ISObject |
getLazy(String key,
Map<String,String> attrs)
Returns lazy SObject with attributes set.
|
String |
getStaticWebEndpoint()
Return the static web endpoint configured
|
String |
getUrl(String key)
Return the URL to access a stored resource by key
|
String |
id()
Return the ID of the service.
|
boolean |
isManaged(ISObject sobj)
Report if a
storage object is managed by this service |
ISObject |
loadContent(ISObject sobj)
Load content of an sobject.
|
ISObject |
put(String key,
ISObject stuff)
Update the stuff in the storage.
|
void |
remove(String key)
Remove the file from the storage by key and return it to caller.
|
IStorageService |
subFolder(String path)
Returns a storage service whose root is a sub folder of this storage service
|
static final osgl.version.Version VERSION
static final String DEFAULT
static final String CONF_KEY_GEN
static final String CONF_CONTEXT_PATH
static final String CONF_ID
String id()
Return the ID of the service.
String contextPath()
alias of getContextPath()
ISObject get(String key)
Retrieve the stuff from the storage by key
If file cannot be find by key, then null is returned
key - ISObject getLazy(String key, Map<String,String> attrs)
Returns lazy SObject with attributes set. This method is useful when user application choose to store attributes and key of SObject into database, and lazy load SObject content later one by calling loadContent(ISObject)
key - attrs - ISObject forceGet(String key)
Force retrieving the stuff with content from storage without regarding to the configuration
key - getFull(String)ISObject getFull(String key)
Force retrieving the stuff with content from storage without regarding to the configuration
key - loadContent(ISObject)ISObject loadContent(ISObject sobj)
Load content of an sobject. If the content is already loaded, then the object should be returned directly
sobj - ISObject put(String key, ISObject stuff) throws org.osgl.exception.UnexpectedIOException
Update the stuff in the storage. If the existing file cannot be find in the storage then it will be added.
key - stuff - org.osgl.exception.UnexpectedIOExceptionboolean isManaged(ISObject sobj)
Report if a storage object is managed by this service
sobj - the sobjecttrue if the sobject is managed by this servicevoid remove(String key)
Remove the file from the storage by key and return it to caller.
key - String getContextPath()
Return the context path. A context path is the path from where all the storage should happen. By default context path is ""
String getStaticWebEndpoint()
Return the static web endpoint configured
String getUrl(String key)
Return the URL to access a stored resource by key
key - String getKey()
IStorageService subFolder(String path)
Returns a storage service whose root is a sub folder of this storage service
path - the path to sub folderCopyright © 2013–2017 OSGL (Open Source General Library). All rights reserved.