public abstract class AbstractTreeStorage extends java.lang.Object implements ITreeStorage
Constructor and Description |
---|
AbstractTreeStorage() |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
canLoad(java.util.UUID uuid)
Method to check if node with given UUID can be loaded from this storage
|
abstract 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)
Deprecated.
|
abstract void |
createStorage(java.lang.String name)
Method to be called during new storage creation.
|
abstract void |
deleteResource(java.util.UUID uuid,
java.lang.String resName)
Delete resource with given name from node
|
abstract void |
deleteStorage()
Delete storage
|
java.util.Map<java.lang.String,AttributeDefinition> |
getAttributes(java.util.UUID uuid)
Get stored attributes of node with given UUID
|
CacheStorage |
getCacheStorage()
Get the object related to cache data manipulations.
|
abstract 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
|
abstract java.lang.String |
getName()
Get name - string identifier of storage.
|
abstract 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
|
abstract java.net.URI |
getNodeResourcePath(java.util.UUID uuid)
Get path for node with given UUID where resources are located
|
abstract java.util.UUID |
getParent(java.util.UUID uuid)
Get UUID of parent element of node with given UUID in tree
|
abstract java.io.InputStream |
getResourceContents(java.util.UUID uuid,
java.lang.String resName)
Get content of resource from node with given UUID if it exists
|
abstract 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.
|
abstract java.util.Map<java.lang.String,AttributeDefinition> |
getStorageAttributes(java.util.UUID uuid) |
java.util.Map<java.lang.String,Version> |
getVersions(java.util.UUID uuid)
Get versions objects related to node with given UUID
|
java.util.Map<java.util.UUID,java.util.Map<java.lang.String,Version>> |
getVersionsStorage() |
abstract boolean |
isResourceExists(java.util.UUID uuid,
java.lang.String resName)
Method to check if some resource exists on node with given UUID
|
abstract java.util.Set<java.lang.String> |
listResources(java.util.UUID uuid)
List names of resources from node with given UUID
|
abstract void |
moveNodeTo(java.util.UUID uuid,
java.util.UUID parent)
Move node with given UUID to new parent
|
abstract void |
remove(java.util.UUID uuid)
Remove attribute with given UUID
|
void |
saveAttributes(java.util.UUID uuid,
ChangesSet<Attribute> params)
Save attributes for node with given UUID
Attributes are taken from New map of ChangesSet
|
abstract void |
saveStorageAttributes(java.util.UUID uuid,
ChangesSet<Attribute> params) |
void |
saveVersions(java.util.UUID uuid,
ChangesSet<Version> changes)
Save versions for given node.
|
void |
setDeltaTarget(IStorageDeltaListener deltaTarget)
Adds tree storage event listener
|
abstract 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.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getBaseStorage, getLocation, getResource
public void setDeltaTarget(IStorageDeltaListener deltaTarget)
ITreeStorage
setDeltaTarget
in interface ITreeStorage
deltaTarget
- event listenerpublic IStorageDeltaListener getDeltaTarget()
ITreeStorage
getDeltaTarget
in interface ITreeStorage
@Deprecated public void createNode(java.util.UUID parentNode, java.util.UUID node, java.lang.String type, java.lang.String id)
ITreeStorage
createNode
in interface ITreeStorage
parentNode
- parent of node to be addnode
- UUID of new nodetype
- type of new nodeid
- text id of new nodepublic java.lang.String getNodeRawType(java.util.UUID uuid)
ITreeStorage
getNodeRawType
in interface ITreeStorage
uuid
- UUID of nodepublic java.util.Map<java.lang.String,Version> getVersions(java.util.UUID uuid)
ITreeStorage
getVersions
in interface ITreeStorage
uuid
- UUID of nodepublic void saveVersions(java.util.UUID uuid, ChangesSet<Version> changes)
ITreeStorage
saveVersions
in interface ITreeStorage
uuid
- UUID of nodechanges
- set of changed versionspublic ITreeStorage getRootStorage()
ITreeStorage
getRootStorage
in interface ITreeStorage
public abstract java.util.UUID getRootNode()
ITreeStorage
getRootNode
in interface ITreeStorage
public abstract java.util.UUID getParent(java.util.UUID uuid)
ITreeStorage
getParent
in interface ITreeStorage
uuid
- UUID of nodepublic abstract java.util.Collection<java.util.UUID> getChildren(java.util.UUID uuid)
ITreeStorage
getChildren
in interface ITreeStorage
uuid
- UUID of nodepublic final void createNode(java.util.UUID parentUUId, java.util.UUID uuid, java.lang.String id, java.util.Map<java.lang.String,AttributeDefinition> attributes)
ITreeStorage
createNode
in interface ITreeStorage
id
- text id of new nodeattributes
- set of attributes in form of Key->Attributepublic abstract void remove(java.util.UUID uuid)
ITreeStorage
remove
in interface ITreeStorage
uuid
- UUID of node to be removepublic abstract java.lang.String getNodeId(java.util.UUID uuid)
ITreeStorage
getNodeId
in interface ITreeStorage
uuid
- UUID of nodepublic abstract void changeNodeId(java.util.UUID uuid, java.lang.String id)
ITreeStorage
changeNodeId
in interface ITreeStorage
uuid
- UUID of nodeid
- string identifierpublic java.util.Map<java.lang.String,AttributeDefinition> getAttributes(java.util.UUID uuid)
ITreeStorage
getAttributes
in interface ITreeStorage
uuid
- UUID of nodepublic abstract java.util.Map<java.lang.String,AttributeDefinition> getStorageAttributes(java.util.UUID uuid)
public void saveAttributes(java.util.UUID uuid, ChangesSet<Attribute> params)
ITreeStorage
saveAttributes
in interface ITreeStorage
uuid
- UUID of nodeparams
- set of changed attributespublic abstract void saveStorageAttributes(java.util.UUID uuid, ChangesSet<Attribute> params)
public abstract void moveNodeTo(java.util.UUID uuid, java.util.UUID parent)
ITreeStorage
moveNodeTo
in interface ITreeStorage
uuid
- UUID of nodeparent
- UUID of new parentpublic abstract boolean canLoad(java.util.UUID uuid)
ITreeStorage
canLoad
in interface ITreeStorage
uuid
- UUID of nodepublic abstract boolean isResourceExists(java.util.UUID uuid, java.lang.String resName)
ITreeStorage
isResourceExists
in interface ITreeStorage
uuid
- UUID of noderesName
- name of resource to checkpublic abstract java.net.URI getNodeResourcePath(java.util.UUID uuid)
ITreeStorage
getNodeResourcePath
in interface ITreeStorage
uuid
- UUID of nodepublic abstract java.io.InputStream getResourceContents(java.util.UUID uuid, java.lang.String resName)
ITreeStorage
getResourceContents
in interface ITreeStorage
uuid
- UUID of noderesName
- name of resourcepublic abstract void setResourceContents(java.util.UUID uuid, java.lang.String resName, java.io.InputStream in, java.lang.Object data)
ITreeStorage
setResourceContents
in interface ITreeStorage
uuid
- UUID of noderesName
- name of resourcein
- new content of resourcedata
- additional datapublic abstract java.util.Set<java.lang.String> listResources(java.util.UUID uuid)
ITreeStorage
listResources
in interface ITreeStorage
uuid
- UUID of nodepublic abstract void deleteResource(java.util.UUID uuid, java.lang.String resName)
ITreeStorage
deleteResource
in interface ITreeStorage
uuid
- UUID of noderesName
- name of resourcepublic abstract void createStorage(java.lang.String name)
ITreeStorage
createStorage
in interface ITreeStorage
name
- name of future storagepublic abstract void deleteStorage()
ITreeStorage
deleteStorage
in interface ITreeStorage
public abstract java.lang.String getName()
ITreeStorage
getName
in interface ITreeStorage
public java.util.Map<java.util.UUID,java.util.Map<java.lang.String,Version>> getVersionsStorage()
public void clearCachedCache(java.util.UUID uid)
ITreeStorage
clearCachedCache
in interface ITreeStorage
uid
- UUID of nodepublic void clearCaches()
ITreeStorage
clearCaches
in interface ITreeStorage
public CacheStorage getCacheStorage()
ITreeStorage
getCacheStorage
in interface ITreeStorage