org.alfresco.service.cmr.remote
Interface AVMRemote

All Known Implementing Classes:
AVMRemoteImpl, AVMRemoteLocal

public interface AVMRemote

Remote interface for Alfresco Versioning Model (AVM).
For the in-process API, see: AVMService.

Because the AVM is a versioning repository, fully explicit references to the nodes within it consist of an absolute AVM path, and a version ID. Absolute AVM paths are of the form:  <store-name>:<store-relative-path>.

For example:  mystore:/www/avm_webapps/ROOT/x/y/z.html

Within AVMService, whenever an API takes a path and a name, the path is the parent directory in which the name appears. Whenever just a path is needed by an API, it is an absolute path to a file or directory.

The special version ID -1 (negative one) refers to the latest read/write version at the given absolute AVM path. Non-negative version ID values refer to read-only snapshots of a store. For this reason, the version ID -1 is implicit for all write operations. Sometimes, -1 is referred to as the HEAD version (a term that should be already be familiar to users of other versioning systems like CVS and SVN).

Snapshots can be created explicitly via a call to createSnapshot, or implicitly by various APIs in this interface and in AVMSyncService. Although a new snapshot of a store will have version a ID one higher than the previous snapshot in that store, the history of an AMV store does not necessarily contain a continuous range of version ID values, because purgeVersion may have been called. Regardless of whether purgeVersion has been called, the AVM never recycles version ID values within a store.


Method Summary
 void addAspect(java.lang.String path, org.alfresco.service.namespace.QName aspectName)
          Add an aspect to an AVM node.
 void createBranch(int version, java.lang.String srcPath, java.lang.String dstPath, java.lang.String name)
          Create a branch from a given version and path.
 void createDirectory(java.lang.String path, java.lang.String name)
          Create a new directory.
 java.io.OutputStream createFile(java.lang.String path, java.lang.String name)
          Create a new "plain" (non-layered) file within a path.
 void createLayeredDirectory(java.lang.String targetPath, java.lang.String parent, java.lang.String name)
          Create a new layered directory.
 void createLayeredFile(java.lang.String targetPath, java.lang.String parent, java.lang.String name)
          Deprecated.  
 java.util.Map createSnapshot(java.lang.String store, java.lang.String tag, java.lang.String description)
          Snapshot the given AVMStore.
 void createStore(java.lang.String name)
          Create a new AVMStore.
 void deleteNodeProperties(java.lang.String path)
          Delete all the properties attached to an AVM node.
 void deleteNodeProperty(java.lang.String path, org.alfresco.service.namespace.QName name)
          Delete a property.
 void deleteStoreProperty(java.lang.String store, org.alfresco.service.namespace.QName name)
          Delete a property on a store by name.
 org.alfresco.util.Pair getAPath(AVMNodeDescriptor desc)
          Get a single valid path to a given node.
 java.util.Set getAspects(int version, java.lang.String path)
          Get all the aspects on an AVM node.
 AVMNodeDescriptor getCommonAncestor(AVMNodeDescriptor left, AVMNodeDescriptor right)
          Get the common ancestor of two nodes if a common ancestor exists.
 java.util.List getDeleted(int version, java.lang.String path)
          Non-recursively get the names of nodes that have been deleted in a directory identified by a version ID and a path
 java.util.SortedMap getDirectoryListing(AVMNodeDescriptor dir)
          Get a non-recursive directory listing of a directory node identified by a node descriptor.
 java.util.SortedMap getDirectoryListing(int version, java.lang.String path)
          Get a non-recursive listing of a directory identified by its version ID and path.
 java.util.SortedMap getDirectoryListingDirect(int version, java.lang.String path)
          Get a non-recursive listing of nodes contained by a directory identified by its version ID and path, but exclude all nodes that are only contained "indirectly" via layering.
 java.io.InputStream getFileInputStream(AVMNodeDescriptor desc)
          Get an InputStream for reading the contents of a file node identified by its descriptor.
 java.io.InputStream getFileInputStream(int version, java.lang.String path)
          Get an InputStream for reading the contents of a file identified by its version ID and AVM path.
 java.io.OutputStream getFileOutputStream(java.lang.String path)
          Get an output stream to write to a file identified by an AVM path.
 java.util.List getHistory(AVMNodeDescriptor desc, int count)
          Get a list of up to count nodes in the history chain of a node.
 java.lang.String getIndirectionPath(int version, java.lang.String path)
          Get the indirection path for a node in a layered context whether that indirection path is primary or non-primary (or seen via transparency).
 int getLatestSnapshotID(java.lang.String storeName)
          Get the latest snapshot ID of a store.
 LayeringDescriptor getLayeringInfo(int version, java.lang.String path)
          Get layering information about a path.
 int getNextVersionID(java.lang.String storeName)
          Gets the ID that the next snapshotted version of a store will have.
 java.util.Map getNodeProperties(int version, java.lang.String path)
          Get all the properties associated with a node that is identified by a version ID and a path.
 PropertyValue getNodeProperty(int version, java.lang.String path, org.alfresco.service.namespace.QName name)
          Get a property of a node by QName.
 AVMStoreDescriptor getStore(java.lang.String name)
          Get a descriptor for an AVMStore.
 java.util.Map getStoreProperties(java.lang.String store)
          Get all the properties associated with a store.
 PropertyValue getStoreProperty(java.lang.String store, org.alfresco.service.namespace.QName name)
          Get a property from a store.
 AVMNodeDescriptor getStoreRoot(int version, java.lang.String name)
          A convenience method for getting the specified root directory of an AVMStore (e.g.: "mysite:/").
 java.util.List getStores()
          Get the descriptors of all AVMStores in the repository.
 java.util.List getStoreVersions(java.lang.String name)
          Get the set of versions in an AVMStore.
 java.util.List getStoreVersions(java.lang.String name, java.util.Date from, java.util.Date to)
          Get AVMStore version descriptors by creation date.
 boolean hasAspect(int version, java.lang.String path, org.alfresco.service.namespace.QName aspectName)
          Determines whether a node has a particular aspect.
 AVMNodeDescriptor lookup(AVMNodeDescriptor dir, java.lang.String name)
          Lookup a node identified by the directory node that contains it, and its name.
 AVMNodeDescriptor lookup(AVMNodeDescriptor dir, java.lang.String name, boolean includeDeleted)
          Lookup a node identified by the directory that contains it, and its name; optionally, the lookup can retrive the descriptor of a node even if it has been deleted from its containing directory.
 AVMNodeDescriptor lookup(int version, java.lang.String path)
          Lookup a node identified by version ID and path.
 AVMNodeDescriptor lookup(int version, java.lang.String path, boolean includeDeleted)
          Lookup a node identified by version ID and path; optionally, if the node is deleted, its descriptor can still be retrieved.
 void makePrimary(java.lang.String path)
          Make a directory into a primary indirection node.
 void purgeStore(java.lang.String name)
          Purge an AVMStore.
 void purgeVersion(int version, java.lang.String name)
          Purge a version from an AVMStore.
 java.util.Map queryStorePropertyKey(java.lang.String store, org.alfresco.service.namespace.QName keyPattern)
          Deprecated.  
 java.util.Map queryStoresPropertyKey(org.alfresco.service.namespace.QName keyPattern)
          Deprecated.  
 void removeAspect(java.lang.String path, org.alfresco.service.namespace.QName aspectName)
          Remove an aspect and its properties from a node.
 void removeNode(java.lang.String parent, java.lang.String name)
          Remove a file or directory from its parent directory.
 void rename(java.lang.String srcParent, java.lang.String srcName, java.lang.String dstParent, java.lang.String dstName)
          Rename a file or directory.
 void renameStore(java.lang.String sourceName, java.lang.String destName)
          Rename a store.
 void retargetLayeredDirectory(java.lang.String path, java.lang.String target)
          Retarget a layered directory.
 void revert(java.lang.String path, AVMNodeDescriptor toRevertTo)
          Revert a HEAD path to a given version.
 void setEncoding(java.lang.String path, java.lang.String encoding)
          Set the encoding.
 void setGuid(java.lang.String path, java.lang.String guid)
          Set the GUID on a node.
 void setMimeType(java.lang.String path, java.lang.String mimeType)
          Set the mime type.
 void setNodeProperties(java.lang.String path, java.util.Map properties)
          Set a collection of properties on a node.
 void setNodeProperty(java.lang.String path, org.alfresco.service.namespace.QName name, PropertyValue value)
          Set a property on a node.
 void setOpacity(java.lang.String path, boolean opacity)
          Set the opacity of a layered directory.
 void setStoreProperties(java.lang.String store, java.util.Map props)
          Set a group of properties on a store.
 void setStoreProperty(java.lang.String store, org.alfresco.service.namespace.QName name, PropertyValue value)
          Set a property on a store.
 void uncover(java.lang.String dirPath, java.lang.String name)
          If a layered directory dirPath has a deleted entry of the given name, remove that name from the deleted list, so that if a layer below it contains an entry of this name, it can be seen via transparency from dirPath.
 

Method Detail

getFileInputStream

java.io.InputStream getFileInputStream(int version,
                                       java.lang.String path)
Get an InputStream for reading the contents of a file identified by its version ID and AVM path. This method can be used for either plain or layered files.

Parameters:
version - The version ID to look in.
path - The absolute path to the file.
Returns:
An InputStream for the designated file.
Throws:
AVMNotFoundException
AVMWrongTypeException

getFileInputStream

java.io.InputStream getFileInputStream(AVMNodeDescriptor desc)
Get an InputStream for reading the contents of a file node identified by its descriptor. This method can be used for either plain or layered files.

Parameters:
desc - The descriptor.
Returns:
An InputStream.
Throws:
AVMNotFoundException

getFileOutputStream

java.io.OutputStream getFileOutputStream(java.lang.String path)
Get an output stream to write to a file identified by an AVM path. This file must already exist. This method can be used for either plain or layered files. To create a plain file, see: createFile. To create a layered file, see: createLayeredFile.

Parameters:
path - The absolute path to the file.
Throws:
AVMNotFoundException
AVMWrongTypeException

getDirectoryListing

java.util.SortedMap getDirectoryListing(int version,
                                        java.lang.String path)
Get a non-recursive listing of a directory identified by its version ID and path. If path does not refer to a directory node, AVMWrongTypeException is thrown.

Parameters:
version - The version ID to look in.
path - The absolute AVM path to the file.
Returns:
A Map of names to descriptors.
Throws:
AVMNotFoundException
AVMWrongTypeException

getDirectoryListingDirect

java.util.SortedMap getDirectoryListingDirect(int version,
                                              java.lang.String path)
Get a non-recursive listing of nodes contained by a directory identified by its version ID and path, but exclude all nodes that are only contained "indirectly" via layering.

If this function is called on a "plain" (non-layered) directory, it is equivalent to getDirectoryListing.

Parameters:
version - The version to look up.
path - The full path to get listing for.
Returns:
A Map of names to descriptors.
Throws:
AVMNotFoundException
AVMWrongTypeException

getDirectoryListing

java.util.SortedMap getDirectoryListing(AVMNodeDescriptor dir)
Get a non-recursive directory listing of a directory node identified by a node descriptor.

Parameters:
dir - The directory node descriptor.
Returns:
A sorted Map of names to node descriptors.
Throws:
AVMNotFoundException
AVMWrongTypeException

getDeleted

java.util.List getDeleted(int version,
                          java.lang.String path)
Non-recursively get the names of nodes that have been deleted in a directory identified by a version ID and a path

Parameters:
version - The version to look under.
path - The path of the directory.
Returns:
A List of names.
Throws:
AVMNotFoundException
AVMWrongTypeException

createFile

java.io.OutputStream createFile(java.lang.String path,
                                java.lang.String name)
Create a new "plain" (non-layered) file within a path. This function fails if the file already exists, or if the directory identified by path does not exist.

Parameters:
path - The path of the directory containing the created file.
name - The name of the new file
Returns:
An opaque handle to a server side output stream.
Throws:
AVMNotFound
AVMExists
AVMWrongType

createDirectory

void createDirectory(java.lang.String path,
                     java.lang.String name)
Create a new directory. If path is within a layer, the new directory will be a layered directory; otherwise, the new directory will be a plain directory.

Parameters:
path - The simple absolute path to the parent.
name - The name to give the directory.
Throws:
AVMNotFound
AVMExists
AVMWrongType

createLayeredFile

void createLayeredFile(java.lang.String targetPath,
                       java.lang.String parent,
                       java.lang.String name)
Deprecated. 

Create a new layered file.

Note: the target of the indirection does not need to exist at the time the layered file node is created.

Parameters:
targetPath - The absolute path of the underlying file being pointed at
parent - The absolute path of the directory containing layered file to be created
name - The name of the layered file to be created
Throws:
AVMNotFound
AVMExists
AVMWrongType

createLayeredDirectory

void createLayeredDirectory(java.lang.String targetPath,
                            java.lang.String parent,
                            java.lang.String name)
Create a new layered directory. In whatever context this is created, this will be a layered directory that has a primary indirection.

Note: a "primary" indirection is one in which the target is explicitly set; "non-primary" indirect nodes compute their effective target dynamically on the basis of their relative position to the closest "primary" indirect node that contains them. Therefore, changing the target of a "primary" layered directory node immediately alters the indirection targets computed by the "non-primary" layered nodes it contains.

Note: the target of the indirection does not need to exist at the time the layered directory node is created.

Parameters:
targetPath - The absolute path to the underlying directory that the layered directory being created will point at.
parent - The absolute path to directory containing the layered directory being created.
name - The name of the layered directory being created
Throws:
AVMNotFound
AVMExists
AVMWrongType

retargetLayeredDirectory

void retargetLayeredDirectory(java.lang.String path,
                              java.lang.String target)
Retarget a layered directory. Change the target pointed to by a layered directory node. This has the side effect of making the layered directory a primary indirection if the layered directory's indirection was "non-primary".

Parameters:
path - Path to the layered directory.
target - The new indirection target of the layered directory
Throws:
AVMNotFoundException
AVMWrongTypeException

createStore

void createStore(java.lang.String name)
Create a new AVMStore. All stores are top level objects within the AVM repository. The AVM is a forest of versioned trees; each versioned tree is contained within a AVM store with a unique name. If a store is removed via purgeStore, the name of the deleted store can be reused in a later call to createStore.

The store name must be non-null, cannot be the empty string, and must not contain characters that are illegal in normal file names.

Parameters:
name - The name of the new AVMStore.
Throws:
AVMExistsException

createBranch

void createBranch(int version,
                  java.lang.String srcPath,
                  java.lang.String dstPath,
                  java.lang.String name)
Create a branch from a given version and path. As a side effect, an automatic snapshot is taken of the store that contains the node that is being branched from.

Parameters:
version - The version number from which to make the branch.
srcPath - The path to the node to branch from.
dstPath - The path to the directory to contain the new branch.
name - The name to give the new branch.
Throws:
AVMNotFoundException
AVMExistsException
AVMWrongTypeException

removeNode

void removeNode(java.lang.String parent,
                java.lang.String name)
Remove a file or directory from its parent directory. In a layered context, the newly deleted node will hide a file of the same name in the corresponding layer below.

If instead you want to make the file in the lower layer visible via transparency, see: uncover. If you want to perform a removal and an uncover operation atomically, see: makeTransparent.

Caution: this removes directories even if they are not empty.

Note: developers of records management systems must also be aware that the AVMNode corresponding to the parent directory and name provided might still be accessible via different path lookups after this function has completed; this because branching and versioning operations create manifestations of nodes in a manner that is similar to a UNIX hard link. If you need to discover every possible path that could retrieve the associated AVMNode, see: getPaths, getHeadPaths, and getPathsInStoreHead.

Parameters:
parent - The absolute path to the parent directory.
name - The name of the child to remove.
Throws:
AVMNotFoundException
AVMWrongTypeException

rename

void rename(java.lang.String srcParent,
            java.lang.String srcName,
            java.lang.String dstParent,
            java.lang.String dstName)
Rename a file or directory. There are a number of things to note about the interaction of rename and layering:

Note: if instead you want to rename an AVM store, see renameStore.

Parameters:
srcParent - The absolute path to the parent directory.
srcName - The name of the node in the src directory.
dstParent - The absolute path to the destination directory.
dstName - The name that the node will have in the destination directory.
Throws:
AVMNotFoundException
AVMExistsException

uncover

void uncover(java.lang.String dirPath,
             java.lang.String name)
If a layered directory dirPath has a deleted entry of the given name, remove that name from the deleted list, so that if a layer below it contains an entry of this name, it can be seen via transparency from dirPath.

Note: if you are looking for an atomic operation that first deletes an object, then performs an "uncover" operation to make it transparent, see makeTransparent.

Parameters:
dirPath - The path to the layered directory.
name - The name to uncover.
Throws:
AVMNotFoundException
AVMWrongTypeException

getNextVersionID

int getNextVersionID(java.lang.String storeName)
Gets the ID that the next snapshotted version of a store will have.

Note: unless the operations that require this value to be valid are performed within a transaction, this value can become "stale".

Parameters:
storeName - The name of the AVMStore.
Returns:
The next version ID of the AVMStore.
Throws:
AVMNotFoundException

getLatestSnapshotID

int getLatestSnapshotID(java.lang.String storeName)
Get the latest snapshot ID of a store. Note: All stores have at least one snapshot ID: 0; this is the "empty" snapshot taken when the store is first created.

Parameters:
storeName - The store name.
Returns:
The ID of the latest extant version of the store.
Throws:
AVMNotFoundException

createSnapshot

java.util.Map createSnapshot(java.lang.String store,
                             java.lang.String tag,
                             java.lang.String description)
Snapshot the given AVMStore. When files have been modified since the previous snapshot, a new snapshot version is created; otherwise, no extra snapshot is actually taken.

When no snapshot is actually taken, but either 'tag' or 'store' are non-null, they will override the value for the last snapshot (i.e.: the old values will be discarded); however, if both 'tag' and 'description' are null then invoking createSnapshot when no files have been modified becomes a true no-op.

Parameters:
store - The name of the AVMStore to snapshot.
tag - The short description.
description - The thick description.
Returns:
A Map of all implicitly or explicitly snapshotted stores to last version id.
Throws:
AVMNotFoundException

getStoreVersions

java.util.List getStoreVersions(java.lang.String name)
Get the set of versions in an AVMStore. The version ID values within this list will always be may appear out of order, and may contain missing values (due to the possibility that purgeStore operations have been performed). Because the number of versions that a store can contain may become large, this call can be a resource-intensive, and may even causing Out of Memory exceptions.

Parameters:
name - The name of the AVMStore.
Returns:
A Set of version descriptors.
Throws:
AVMNotFoundException

getStoreVersions

java.util.List getStoreVersions(java.lang.String name,
                                java.util.Date from,
                                java.util.Date to)
Get AVMStore version descriptors by creation date. Either from or to can be null but not both.

The order of the values returned is not guaranteed, nor are the version IDs necessarily free of "missing" values (due to the possibility that purgeStore operations have been performed).

Note: for portability, all dates are stored as 64-bit longs, with a time resolution of one millisecond. Therefore, aliasing/wrapping are not a concern unless you need to plan 292.4 million years ahead. If so, please contact your system administrator.

Parameters:
name - The name of the AVMStore.
from - Earliest date of version to include.
to - Latest date of version to include.
Returns:
The Set of version descriptors that match.
Throws:
AVMNotFoundException

getStores

java.util.List getStores()
Get the descriptors of all AVMStores in the repository.

Returns:
A List of all AVMStores.

getStore

AVMStoreDescriptor getStore(java.lang.String name)
Get a descriptor for an AVMStore.

Parameters:
name - The AVMStore's name.
Returns:
A Descriptor, or null if not found.

getStoreRoot

AVMNodeDescriptor getStoreRoot(int version,
                               java.lang.String name)
A convenience method for getting the specified root directory of an AVMStore (e.g.: "mysite:/").

Parameters:
version - The version to look up.
name - The name of the AVMStore.
Returns:
A descriptor for the specified root.
Throws:
AVMNotFoundException

lookup

AVMNodeDescriptor lookup(int version,
                         java.lang.String path)
Lookup a node identified by version ID and path.

Parameters:
version - The version ID to look under.
path - The simple absolute path to the parent directory.
Returns:
An AVMNodeDescriptor, or null if the node does not exist.

lookup

AVMNodeDescriptor lookup(int version,
                         java.lang.String path,
                         boolean includeDeleted)
Lookup a node identified by version ID and path; optionally, if the node is deleted, its descriptor can still be retrieved.

Parameters:
version - The version ID to look under.
path - The simple absolute path to the parent directory.
includeDeleted - Whether to allow a deleted node to be retrieved
Returns:
An AVMNodeDescriptor, or null if the version does not exist.

lookup

AVMNodeDescriptor lookup(AVMNodeDescriptor dir,
                         java.lang.String name)
Lookup a node identified by the directory node that contains it, and its name.

Parameters:
dir - The descriptor for the directory node.
name - The name to lookup.
Returns:
The descriptor for the child.
Throws:
AVMWrongTypeException - If dir does not refer to a directory.

lookup

AVMNodeDescriptor lookup(AVMNodeDescriptor dir,
                         java.lang.String name,
                         boolean includeDeleted)
Lookup a node identified by the directory that contains it, and its name; optionally, the lookup can retrive the descriptor of a node even if it has been deleted from its containing directory.

Parameters:
dir - The descriptor for the directory node.
name - The name to lookup.
includeDeleted - Whether to allow a deleted node to be retrieved via the lookup
Returns:
The descriptor for the child, null if the child doesn't exist.
Throws:
AVMNotFoundException
AVMWrongTypeException

getAPath

org.alfresco.util.Pair getAPath(AVMNodeDescriptor desc)
Get a single valid path to a given node.

Parameters:
desc - The descriptor of the node to which a version and path will be fetched.
Returns:
version and path.
Throws:
AVMNotFoundException

getIndirectionPath

java.lang.String getIndirectionPath(int version,
                                    java.lang.String path)
Get the indirection path for a node in a layered context whether that indirection path is primary or non-primary (or seen via transparency). If you call getIndirectionPath on a layered node, you'll fetch its explicitly set target; if you call this function on a non-primary indirection node or a node seen via transparency, you'll get back the path to the corresponding node in the underlying target.

For example, if "mysite--alice:/www" is a layered directory that targets "mysite:/www", and "mysite--alice" contains no content directly, then if the path path "mysite:/www/avm_webapps/ROOT/x/y/z" is valid, calling getIndirectionPath on "mysite--alice:/www/avm_webapps/ROOT/x/y/z" will yield "mysite:/www/avm_webapps/ROOT/x/y/z".

Parameters:
version - The version number to get.
path - The path to the node of interest.
Returns:
The indirection path, or null if the path is not in a layered context.
Throws:
AVMNotFoundException
AVMWrongTypeException

purgeStore

void purgeStore(java.lang.String name)
Purge an AVMStore. This completely removes an AVMStore.

Note: while the store being purged disappears from view immediately, any nodes that become unreachable as a result are deleted asynchronously.

Parameters:
name - The name of the AVMStore.
Throws:
AVMNotFoundException

purgeVersion

void purgeVersion(int version,
                  java.lang.String name)
Purge a version from an AVMStore. Deletes everything that lives in the given version only.

Parameters:
version - The version to purge.
name - The name of the AVMStore from which to purge it.
Throws:
AVMNotFoundException - If name or version do not exist.

makePrimary

void makePrimary(java.lang.String path)
Make a directory into a primary indirection node.

Parameters:
path - The full path.
Throws:
AVMNotFoundException
AVMWrongTypeException

getHistory

java.util.List getHistory(AVMNodeDescriptor desc,
                          int count)
Get a list of up to count nodes in the history chain of a node. The initial element of the list returned will be desc (as long as the count is non-zero).

Parameters:
desc - The descriptor for a node to find ancestors for.
count - maximum number of ancestors to return in the list (the value -1 means "no limit -- return them all")
Returns:
A List of ancestors starting with the most recent.
Throws:
AVMNotFoundException

setOpacity

void setOpacity(java.lang.String path,
                boolean opacity)
Set the opacity of a layered directory. An opaque layered directory hides the contents of its indirection.

Parameters:
path - The path to the layered directory.
Throws:
AVMNotFoundException
AVMWrongTypeException

getCommonAncestor

AVMNodeDescriptor getCommonAncestor(AVMNodeDescriptor left,
                                    AVMNodeDescriptor right)
Get the common ancestor of two nodes if a common ancestor exists. This function is useful for detecting and merging conflicts.

Parameters:
left - The first node.
right - The second node.
Returns:
The common ancestor. There are four possible results. Null means that there is no common ancestor. Left returned means that left is strictly an ancestor of right. Right returned means that right is strictly an ancestor of left. Any other non null return is the common ancestor and indicates that left and right are in conflict.
Throws:
AVMNotFoundException

getLayeringInfo

LayeringDescriptor getLayeringInfo(int version,
                                   java.lang.String path)
Get layering information about a path. The LayeringDescriptor returned can be used to determine whether a node is in the background (and if so, which AVM store contains it directly), or if it is directly contained by the AVM store referenced by path.

Parameters:
version - The version to look under.
path - The absolute AVM path.
Returns:
A LayeringDescriptor.
Throws:
AVMNotFoundException
AVMWrongTypeException

setNodeProperty

void setNodeProperty(java.lang.String path,
                     org.alfresco.service.namespace.QName name,
                     PropertyValue value)
Set a property on a node.

Parameters:
path - The path to the node to set the property on.
name - The QName of the property.
value - The property to set.
Throws:
AVMNotFoundException
AVMWrongTypeException

setNodeProperties

void setNodeProperties(java.lang.String path,
                       java.util.Map properties)
Set a collection of properties on a node.

Parameters:
path - The path to the node.
properties - The Map of properties to set.
Throws:
AVMNotFoundException
AVMWrongTypeException

getNodeProperty

PropertyValue getNodeProperty(int version,
                              java.lang.String path,
                              org.alfresco.service.namespace.QName name)
Get a property of a node by QName.

Parameters:
version - The version to look under.
path - The path to the node.
name - The QName.
Returns:
The PropertyValue or null if it doesn't exist.
Throws:
AVMNotFoundException
AVMWrongTypeException

getNodeProperties

java.util.Map getNodeProperties(int version,
                                java.lang.String path)
Get all the properties associated with a node that is identified by a version ID and a path.

Parameters:
version - The version to look under.
path - The path to the node.
Returns:
A Map of QNames to PropertyValues.
Throws:
AVMNotFoundException

deleteNodeProperty

void deleteNodeProperty(java.lang.String path,
                        org.alfresco.service.namespace.QName name)
Delete a property.

Note: to remove an apsect, see: removeAspect

Parameters:
path - The path to the node.
name - The QName of the property to delete.
Throws:
AVMNotFoundException

deleteNodeProperties

void deleteNodeProperties(java.lang.String path)
Delete all the properties attached to an AVM node.

Note: to remove an apsect, see: removeAspect

Parameters:
path - The path to the node.
Throws:
AVMNotFoundException

setStoreProperty

void setStoreProperty(java.lang.String store,
                      org.alfresco.service.namespace.QName name,
                      PropertyValue value)
Set a property on a store. If the property exists it will be overwritten.

Parameters:
store - The store to set the property on.
name - The name of the property.
value - The value of the property.
Throws:
AVMNotFoundException

setStoreProperties

void setStoreProperties(java.lang.String store,
                        java.util.Map props)
Set a group of properties on a store. Existing properties will be overwritten.

Parameters:
store - The name of the store.
props - A Map of the properties to set.
Throws:
AVMNotFoundException

getStoreProperty

PropertyValue getStoreProperty(java.lang.String store,
                               org.alfresco.service.namespace.QName name)
Get a property from a store.

Parameters:
store - The name of the store.
name - The name of the property.
Returns:
A PropertyValue or null if non-existent.
Throws:
AVMNotFoundException

getStoreProperties

java.util.Map getStoreProperties(java.lang.String store)
Get all the properties associated with a store.

Parameters:
store - The name of the store.
Returns:
A Map of the stores properties.
Throws:
AVMNotFoundException

queryStorePropertyKey

java.util.Map queryStorePropertyKey(java.lang.String store,
                                    org.alfresco.service.namespace.QName keyPattern)
Deprecated. 

Queries a given store for properties with keys that match a given pattern.

Parameters:
store - The name of the store.
keyPattern - The sql 'like' pattern, inserted into a QName.
Returns:
A Map of the matching key value pairs.

queryStoresPropertyKey

java.util.Map queryStoresPropertyKey(org.alfresco.service.namespace.QName keyPattern)
Deprecated. 

Queries a given store for properties with keys that match a given pattern.

Parameters:
store - The name of the store.
keyPattern - The sql 'like' pattern, inserted into a QName.
Returns:
A Map of the matching key value pairs.

deleteStoreProperty

void deleteStoreProperty(java.lang.String store,
                         org.alfresco.service.namespace.QName name)
Delete a property on a store by name.

Note: to remove an apsect, see: removeAspect

Parameters:
store - The name of the store.
name - The name of the property to delete.
Throws:
AVMNotFoundException

addAspect

void addAspect(java.lang.String path,
               org.alfresco.service.namespace.QName aspectName)
Add an aspect to an AVM node.

Parameters:
path - The path to the node.
aspectName - The QName of the aspect.
Throws:
AVMNotFoundException
AVMExistsException

getAspects

java.util.Set getAspects(int version,
                         java.lang.String path)
Get all the aspects on an AVM node.

Parameters:
version - The version to look under.
path - The path to the node.
Returns:
A Set of the QNames of the aspects.
Throws:
AVMNotFoundException

removeAspect

void removeAspect(java.lang.String path,
                  org.alfresco.service.namespace.QName aspectName)
Remove an aspect and its properties from a node.

Parameters:
path - The path to the node.
aspectName - The name of the aspect.
Throws:
AVMNotFoundException

hasAspect

boolean hasAspect(int version,
                  java.lang.String path,
                  org.alfresco.service.namespace.QName aspectName)
Determines whether a node has a particular aspect.

Parameters:
version - The version to look under.
path - The path to the node.
aspectName - The aspect name to check.
Returns:
Whether the given node has the given aspect.
Throws:
AVMNotFoundException

renameStore

void renameStore(java.lang.String sourceName,
                 java.lang.String destName)
Rename a store.

Parameters:
sourceName - The original name.
destName - The new name.
Throws:
AVMNotFoundException
AVMExistsException

revert

void revert(java.lang.String path,
            AVMNodeDescriptor toRevertTo)
Revert a HEAD path to a given version. This works by cloning the version to revert to, and then linking that new version into HEAD. The reverted version will have the previous HEAD version as ancestor.

Parameters:
path - The path to the node to revert.
toRevertTo - The descriptor of the version to revert to.
Throws:
AVMNotFoundException

setGuid

void setGuid(java.lang.String path,
             java.lang.String guid)
Set the GUID on a node. The GUID of a node uniquely identifies the state of a node, i.e. its content, metadata, and aspects.

Parameters:
path - The path to the node.
guid - The GUID to set.

setMimeType

void setMimeType(java.lang.String path,
                 java.lang.String mimeType)
Set the mime type.

Parameters:
path - The path of the file.
mimeType - The mime type.

setEncoding

void setEncoding(java.lang.String path,
                 java.lang.String encoding)
Set the encoding.

Parameters:
path - The path of the file.
encoding - The encoding.


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.