public interface ITreeStorage
Modifier and Type | Method and Description |
---|---|
boolean |
canLoad(java.util.UUID uuid)
Method to check if node with given UUID can be loaded from this storage
|
void |
changeNodeId(java.util.UUID uuid,
java.lang.String id)
Change id of node
|
void |
clearCachedCache(java.util.UUID uid)
Clear inner caches for node with given UUID
|
void |
clearCaches()
Clear all inner caches
|
void |
createNode(java.util.UUID parentUUId,
java.util.UUID uuid,
java.lang.String id,
java.util.Map<java.lang.String,AttributeDefinition> attributes)
Add a new node to tree
|
void |
createNode(java.util.UUID parentNode,
java.util.UUID node,
java.lang.String type,
java.lang.String id)
Add a new node to tree
|
void |
createStorage(java.lang.String name)
Method to be called during new storage creation.
|
void |
deleteResource(java.util.UUID uuid,
java.lang.String resName)
Delete resource with given name from node
|
void |
deleteStorage()
Delete storage
|
java.util.Map<java.lang.String,AttributeDefinition> |
getAttributes(java.util.UUID uuid)
Get stored attributes of node with given UUID
|
ITreeStorage |
getBaseStorage()
Get base storage.
|
CacheStorage |
getCacheStorage()
Get the object related to cache data manipulations.
|
java.util.Collection<java.util.UUID> |
getChildren(java.util.UUID uuid)
Get list of children UUIDs for given node in tree
|
IStorageDeltaListener |
getDeltaTarget()
Get tree storage event listener
|
java.nio.file.Path |
getLocation()
Get location of storage if any.
|
java.lang.String |
getName()
Get name - string identifier of storage.
|
java.lang.String |
getNodeId(java.util.UUID uuid)
Get id of node with given UUUID
|
java.lang.String |
getNodeRawType(java.util.UUID uuid)
Get type of node
|
java.net.URI |
getNodeResourcePath(java.util.UUID uuid)
Get path for node with given UUID where resources are located
|
java.util.UUID |
getParent(java.util.UUID uuid)
Get UUID of parent element of node with given UUID in tree
|
java.io.File |
getResource(java.util.UUID uuid,
java.lang.String name)
Get resource from node with given UUID in form of File
|
java.io.InputStream |
getResourceContents(java.util.UUID uuid,
java.lang.String resName)
Get content of resource from node with given UUID if it exists
|
java.util.UUID |
getRootNode()
Get UUID of root node of tree
|
ITreeStorage |
getRootStorage()
Get the ancestor of node in baseStorage row that has no base storage.
|
java.util.Map<java.lang.String,Version> |
getVersions(java.util.UUID uuid)
Get versions objects related to node with given UUID
|
boolean |
isResourceExists(java.util.UUID uuid,
java.lang.String resName)
Method to check if some resource exists on node with given UUID
|
java.util.Set<java.lang.String> |
listResources(java.util.UUID uuid)
List names of resources from node with given UUID
|
void |
moveNodeTo(java.util.UUID uuid,
java.util.UUID parent)
Move node with given UUID to new parent
|
void |
remove(java.util.UUID uuid)
Remove attribute with given UUID
|
void |
saveAttributes(java.util.UUID uuid,
ChangesSet<Attribute> changed)
Save attributes for node with given UUID
Attributes are taken from New map of ChangesSet
|
void |
saveVersions(java.util.UUID uuid,
ChangesSet<Version> changes)
Save versions for given node.
|
void |
setDeltaTarget(IStorageDeltaListener deltaProcessor)
Adds tree storage event listener
|
void |
setResourceContents(java.util.UUID uuid,
java.lang.String resName,
java.io.InputStream in,
java.lang.Object data)
Set content of resource on node with given UUID.
|
void setDeltaTarget(IStorageDeltaListener deltaProcessor)
deltaProcessor
- event listenerIStorageDeltaListener getDeltaTarget()
void createNode(java.util.UUID parentNode, java.util.UUID node, java.lang.String type, java.lang.String id)
parentNode
- parent of node to be addnode
- UUID of new nodetype
- type of new nodeid
- text id of new nodejava.lang.String getNodeRawType(java.util.UUID uuid)
uuid
- UUID of nodejava.util.UUID getRootNode()
java.util.UUID getParent(java.util.UUID uuid)
uuid
- UUID of nodejava.util.Collection<java.util.UUID> getChildren(java.util.UUID uuid)
uuid
- UUID of nodevoid createNode(java.util.UUID parentUUId, java.util.UUID uuid, java.lang.String id, java.util.Map<java.lang.String,AttributeDefinition> attributes)
parentNode
- parent of node to be addnode
- UUID of new nodeid
- text id of new nodeattributes
- set of attributes in form of Key->Attributevoid remove(java.util.UUID uuid)
uuid
- UUID of node to be removejava.lang.String getNodeId(java.util.UUID uuid)
uuid
- UUID of nodevoid changeNodeId(java.util.UUID uuid, java.lang.String id)
uuid
- UUID of nodeid
- string identifierjava.util.Map<java.lang.String,AttributeDefinition> getAttributes(java.util.UUID uuid)
uuid
- UUID of nodevoid saveAttributes(java.util.UUID uuid, ChangesSet<Attribute> changed)
uuid
- UUID of nodechanged
- set of changed attributesITreeStorage getBaseStorage()
java.util.Map<java.lang.String,Version> getVersions(java.util.UUID uuid)
uuid
- UUID of nodevoid saveVersions(java.util.UUID uuid, ChangesSet<Version> changes)
uuid
- UUID of nodechanges
- set of changed versionsvoid moveNodeTo(java.util.UUID uuid, java.util.UUID parent)
uuid
- UUID of nodeparent
- UUID of new parentboolean canLoad(java.util.UUID uuid)
uuid
- UUID of nodeboolean isResourceExists(java.util.UUID uuid, java.lang.String resName)
uuid
- UUID of noderesName
- name of resource to checkjava.net.URI getNodeResourcePath(java.util.UUID uuid)
uuid
- UUID of nodejava.io.InputStream getResourceContents(java.util.UUID uuid, java.lang.String resName)
uuid
- UUID of noderesName
- name of resourcevoid setResourceContents(java.util.UUID uuid, java.lang.String resName, java.io.InputStream in, java.lang.Object data)
uuid
- UUID of noderesName
- name of resourcein
- new content of resourcedata
- additional datajava.util.Set<java.lang.String> listResources(java.util.UUID uuid)
uuid
- UUID of nodevoid deleteResource(java.util.UUID uuid, java.lang.String resName)
uuid
- UUID of noderesName
- name of resourcevoid createStorage(java.lang.String name)
name
- name of future storagevoid deleteStorage()
java.lang.String getName()
ITreeStorage getRootStorage()
void clearCachedCache(java.util.UUID uid)
uid
- UUID of nodevoid clearCaches()
java.io.File getResource(java.util.UUID uuid, java.lang.String name)
uuid
- UUID of nodename
- name of resourceCacheStorage getCacheStorage()
java.nio.file.Path getLocation()