org.alfresco.repo.avm
Class AVMRemoteTransportService

java.lang.Object
  extended by org.alfresco.repo.avm.AVMRemoteTransportService
All Implemented Interfaces:
java.lang.Runnable, AVMRemoteTransport

public class AVMRemoteTransportService
extends java.lang.Object
implements AVMRemoteTransport, java.lang.Runnable

Implementation of AVMRemoteTransport for the server side. It's job is to validate the authentication ticket passed with each method call, and to manage remote InputStreams and OutputStreams.


Constructor Summary
AVMRemoteTransportService()
          Default constructor.
 
Method Summary
 void addAspect(java.lang.String ticket, java.lang.String path, org.alfresco.service.namespace.QName aspectName)
          Add an aspect to an AVM node.
 void closeInputHandle(java.lang.String ticket, java.lang.String handle)
          Close an input stream.
 void closeOutputHandle(java.lang.String ticket, java.lang.String handle)
          Close the server side output stream designated by the handle.
 void createBranch(java.lang.String ticket, int version, java.lang.String srcPath, java.lang.String dstPath, java.lang.String name)
          Create a new branch.
 void createDirectory(java.lang.String ticket, java.lang.String path, java.lang.String name)
          Create a directory.
 java.lang.String createFile(java.lang.String ticket, java.lang.String path, java.lang.String name)
          Create a file and return a handle to an output stream.
 void createLayeredDirectory(java.lang.String ticket, java.lang.String targetPath, java.lang.String parent, java.lang.String name)
          Create a layered directory.
 void createLayeredFile(java.lang.String ticket, java.lang.String targetPath, java.lang.String parent, java.lang.String name)
          Create a new layered file.
 java.util.Map createSnapshot(java.lang.String ticket, java.lang.String store, java.lang.String label, java.lang.String comment)
          Snapshot an AVMStore.
 void createStore(java.lang.String ticket, java.lang.String name)
          Create a new AVMStore.
 void deleteNodeProperties(java.lang.String ticket, java.lang.String path)
          Delete all properties from a node.
 void deleteNodeProperty(java.lang.String ticket, java.lang.String path, org.alfresco.service.namespace.QName name)
          Delete a property from a node.
 void deleteStoreProperty(java.lang.String ticket, java.lang.String store, org.alfresco.service.namespace.QName name)
          Delete a property from a store.
 org.alfresco.util.Pair getAPath(java.lang.String ticket, AVMNodeDescriptor desc)
          Get a version and path for a node.
 java.util.Set getAspects(java.lang.String ticket, int version, java.lang.String path)
          Get all the aspects on an AVM node.
 AVMNodeDescriptor getCommonAncestor(java.lang.String ticket, AVMNodeDescriptor left, AVMNodeDescriptor right)
          Get the most recent common ancestor of two nodes.
 java.util.List getDeleted(java.lang.String ticket, int version, java.lang.String path)
          Get the names of nodes that have been deleted in a directory.
 java.util.SortedMap getDirectoryListing(java.lang.String ticket, AVMNodeDescriptor dir)
          Get a directory listing from a node descriptor.
 java.util.SortedMap getDirectoryListing(java.lang.String ticket, int version, java.lang.String path)
          Get a listing of a directory.
 java.util.SortedMap getDirectoryListingDirect(java.lang.String ticket, int version, java.lang.String path)
          Get a listing of a directories direct contents.
 java.util.List getHistory(java.lang.String ticket, AVMNodeDescriptor desc, int count)
          Get a list of ancestors of a node.
 java.lang.String getIndirectionPath(java.lang.String ticket, int version, java.lang.String path)
          Get the indirection path for a node.
 java.lang.String getInputHandle(java.lang.String ticket, AVMNodeDescriptor desc)
          Get an input handle from a descriptor.
 java.lang.String getInputHandle(java.lang.String ticket, int version, java.lang.String path)
          Get an input handle.
 int getLatestSnapshotID(java.lang.String ticket, java.lang.String storeName)
          Get the id of the latest version snapshot.
 LayeringDescriptor getLayeringInfo(java.lang.String ticket, int version, java.lang.String path)
          Get layering information about a path.
 int getNextVersionID(java.lang.String ticket, java.lang.String storeName)
          Get the latest version id of the given AVMStore.
 java.util.Map getNodeProperties(java.lang.String ticket, int version, java.lang.String path)
          Get all properties of a node.
 PropertyValue getNodeProperty(java.lang.String ticket, int version, java.lang.String path, org.alfresco.service.namespace.QName name)
          Get the value of a node property.
 java.lang.String getOutputHandle(java.lang.String ticket, java.lang.String path)
          Get an opaque handle to a server side output stream.
 AVMStoreDescriptor getStore(java.lang.String ticket, java.lang.String name)
          Get the descriptor for a given AVMStore.
 java.util.Map getStoreProperties(java.lang.String ticket, java.lang.String store)
          Get all the properties on a store.
 PropertyValue getStoreProperty(java.lang.String ticket, java.lang.String store, org.alfresco.service.namespace.QName name)
          Get a property from a store.
 AVMNodeDescriptor getStoreRoot(java.lang.String ticket, int version, java.lang.String name)
          Get the specified root of the specified store.
 java.util.List getStores(java.lang.String ticket)
          Get a list of all AVM stores.
 java.util.List getStoreVersions(java.lang.String ticket, java.lang.String name)
          Get a List of all versions in a given store.
 java.util.List getStoreVersions(java.lang.String ticket, java.lang.String name, java.util.Date from, java.util.Date to)
          Get AVMStore versions between given dates.
 boolean hasAspect(java.lang.String ticket, int version, java.lang.String path, org.alfresco.service.namespace.QName aspectName)
          Does a node have a particular aspect.
 void init()
          The init method.
 AVMNodeDescriptor lookup(java.lang.String ticket, AVMNodeDescriptor dir, java.lang.String name)
          Get a descriptor for the specified node.
 AVMNodeDescriptor lookup(java.lang.String ticket, 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(java.lang.String ticket, int version, java.lang.String path)
          Get a descriptor for the specified node.
 AVMNodeDescriptor lookup(java.lang.String ticket, 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 ticket, java.lang.String path)
          Turn a directory into a primary indirection node.
 void purgeStore(java.lang.String ticket, java.lang.String name)
          Purge an AVMStore.
 void purgeVersion(java.lang.String ticket, int version, java.lang.String name)
          Purge a given version from a given store.
 java.util.Map queryStorePropertyKey(java.lang.String ticket, java.lang.String store, org.alfresco.service.namespace.QName keyPattern)
          Query a store for keys that match a pattern.
 java.util.Map queryStoresPropertyKey(java.lang.String ticket, org.alfresco.service.namespace.QName keyPattern)
          Query all stores for keys that match a pattern.
 byte[] readInput(java.lang.String ticket, java.lang.String handle, int count)
          Read a chunk of data from a handle.
 void removeAspect(java.lang.String ticket, java.lang.String path, org.alfresco.service.namespace.QName aspectName)
          Remove an aspect and its properties from a node.
 void removeNode(java.lang.String ticket, java.lang.String parent, java.lang.String name)
          Remove a node.
 void rename(java.lang.String ticket, java.lang.String srcParent, java.lang.String srcName, java.lang.String dstParent, java.lang.String dstName)
          Rename a node.
 void renameStore(java.lang.String ticket, java.lang.String sourceName, java.lang.String destName)
          Rename a store.
 void retargetLayeredDirectory(java.lang.String ticket, java.lang.String path, java.lang.String target)
          Set a layered directory node to point at a different target.
 void revert(java.lang.String ticket, java.lang.String path, AVMNodeDescriptor toRevertTo)
          Revert a head path to a given version.
 void run()
          The body of this Runnable.
 void setAuthenticationService(AuthenticationService service)
           
 void setAvmService(AVMService service)
          Set the AVMService.
 void setEncoding(java.lang.String ticket, java.lang.String path, java.lang.String encoding)
          Set the encoding.
 void setGuid(java.lang.String ticket, java.lang.String path, java.lang.String guid)
          Set the GUID on a node.
 void setIdleTimeout(long timeout)
          Set the Idle Timeout value.
 void setMimeType(java.lang.String ticket, java.lang.String path, java.lang.String mimeType)
          Set the mime type.
 void setNodeProperties(java.lang.String ticket, java.lang.String path, java.util.Map properties)
          Set a group of properties on a node.
 void setNodeProperty(java.lang.String ticket, java.lang.String path, org.alfresco.service.namespace.QName name, PropertyValue value)
          Set a property on a node.
 void setOpacity(java.lang.String ticket, java.lang.String path, boolean opacity)
          Turn on or off a directory's opacity.
 void setStoreProperties(java.lang.String ticket, java.lang.String store, java.util.Map props)
          Set a group of properties on a store.
 void setStoreProperty(java.lang.String ticket, java.lang.String store, org.alfresco.service.namespace.QName name, PropertyValue value)
          Set a property on a store.
 void shutDown()
          Shutdown the Runnable cleanly.
 void uncover(java.lang.String ticket, java.lang.String dirPath, java.lang.String name)
          Uncover a name in a layered directory.
 void writeOutput(java.lang.String ticket, java.lang.String handle, byte[] buff, int count)
          Write count bytes from buffer buff starting at offset offset in buff
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AVMRemoteTransportService

public AVMRemoteTransportService()
Default constructor.

Method Detail

setIdleTimeout

public void setIdleTimeout(long timeout)
Set the Idle Timeout value.

Parameters:
timeout - The value to set.

setAvmService

public void setAvmService(AVMService service)
Set the AVMService.

Parameters:
service - The service to set.

setAuthenticationService

public void setAuthenticationService(AuthenticationService service)

init

public void init()
The init method. This fires up a thread to check for closable streams.


run

public void run()
The body of this Runnable.

Specified by:
run in interface java.lang.Runnable

shutDown

public void shutDown()
Shutdown the Runnable cleanly.


getInputHandle

public java.lang.String getInputHandle(java.lang.String ticket,
                                       int version,
                                       java.lang.String path)
Get an input handle. A handle is an opaque reference to a server side input stream.

Specified by:
getInputHandle in interface AVMRemoteTransport
Parameters:
version - The version to look under.
path - The path to the file.
Returns:
A handle.

getInputHandle

public java.lang.String getInputHandle(java.lang.String ticket,
                                       AVMNodeDescriptor desc)
Description copied from interface: AVMRemoteTransport
Get an input handle from a descriptor.

Specified by:
getInputHandle in interface AVMRemoteTransport
Parameters:
ticket - The authentication ticket.
desc - The descriptor.
Returns:
An input handle.

readInput

public byte[] readInput(java.lang.String ticket,
                        java.lang.String handle,
                        int count)
Read a chunk of data from a handle.

Specified by:
readInput in interface AVMRemoteTransport
Parameters:
handle - The opaque input stream handle.
count - The number of bytes to try to read.
Returns:
An array of bytes. 0 length at eof.

closeInputHandle

public void closeInputHandle(java.lang.String ticket,
                             java.lang.String handle)
Close an input stream. Server side input streams are timer limited, ie, they will be automatically closed after a given idle time. However, be nice, and close handles when you're done.

Specified by:
closeInputHandle in interface AVMRemoteTransport
Parameters:
handle - The opaque handle to the server side stream.

getOutputHandle

public java.lang.String getOutputHandle(java.lang.String ticket,
                                        java.lang.String path)
Get an opaque handle to a server side output stream.

Specified by:
getOutputHandle in interface AVMRemoteTransport
Parameters:
path - The path to the existing file.
Returns:
An opaque handle.

writeOutput

public void writeOutput(java.lang.String ticket,
                        java.lang.String handle,
                        byte[] buff,
                        int count)
Write count bytes from buffer buff starting at offset offset in buff

Specified by:
writeOutput in interface AVMRemoteTransport
Parameters:
handle - The opaque handle to the server side output stream.
buff - The data buffer.
offset - The offset within the buffer.
count - The number of bytes to write.

closeOutputHandle

public void closeOutputHandle(java.lang.String ticket,
                              java.lang.String handle)
Close the server side output stream designated by the handle.

Specified by:
closeOutputHandle in interface AVMRemoteTransport
Parameters:
handle - The handle to the server side output stream.

getDirectoryListingDirect

public java.util.SortedMap getDirectoryListingDirect(java.lang.String ticket,
                                                     int version,
                                                     java.lang.String path)
Get a listing of a directories direct contents.

Specified by:
getDirectoryListingDirect in interface AVMRemoteTransport
Parameters:
version - The version to look under.
path - The path to the directory.
Returns:
A sorted listing.

getDirectoryListing

public java.util.SortedMap getDirectoryListing(java.lang.String ticket,
                                               int version,
                                               java.lang.String path)
Get a listing of a directory.

Specified by:
getDirectoryListing in interface AVMRemoteTransport
Parameters:
version - The version to look under.
path - The path to the directory.
Returns:
A sorted listing.

getDirectoryListing

public java.util.SortedMap getDirectoryListing(java.lang.String ticket,
                                               AVMNodeDescriptor dir)
Get a directory listing from a node descriptor.

Specified by:
getDirectoryListing in interface AVMRemoteTransport
Parameters:
dir - The directory node descriptor.
Returns:
A sorted listing.

getDeleted

public java.util.List getDeleted(java.lang.String ticket,
                                 int version,
                                 java.lang.String path)
Get the names of nodes that have been deleted in a directory.

Specified by:
getDeleted in interface AVMRemoteTransport
Parameters:
version - The version to look under.
path - The path to the directory.
Returns:
A list of deleted names.

createFile

public java.lang.String createFile(java.lang.String ticket,
                                   java.lang.String path,
                                   java.lang.String name)
Create a file and return a handle to an output stream.

Specified by:
createFile in interface AVMRemoteTransport
Parameters:
path - The path to the file.
name - The name of the file to create.
Returns:
An opaque handle to a server side output stream.

createDirectory

public void createDirectory(java.lang.String ticket,
                            java.lang.String path,
                            java.lang.String name)
Create a directory.

Specified by:
createDirectory in interface AVMRemoteTransport
Parameters:
path - The path to the containing directory.
name - The name for the new directory.

createLayeredFile

public void createLayeredFile(java.lang.String ticket,
                              java.lang.String targetPath,
                              java.lang.String parent,
                              java.lang.String name)
Create a new layered file.

Specified by:
createLayeredFile in interface AVMRemoteTransport
Parameters:
targetPath - The path that is targeted.
parent - The path to the parent directory.
name - The name for the new file.

createLayeredDirectory

public void createLayeredDirectory(java.lang.String ticket,
                                   java.lang.String targetPath,
                                   java.lang.String parent,
                                   java.lang.String name)
Create a layered directory.

Specified by:
createLayeredDirectory in interface AVMRemoteTransport
Parameters:
targetPath - The path that is targeted.
parent - The parent directory.
name - The name of the new directory.

retargetLayeredDirectory

public void retargetLayeredDirectory(java.lang.String ticket,
                                     java.lang.String path,
                                     java.lang.String target)
Set a layered directory node to point at a different target.

Specified by:
retargetLayeredDirectory in interface AVMRemoteTransport
Parameters:
path - The path to the layered directory node.
target - The new target.

createStore

public void createStore(java.lang.String ticket,
                        java.lang.String name)
Create a new AVMStore.

Specified by:
createStore in interface AVMRemoteTransport
Parameters:
name - The name to give the new store.

createBranch

public void createBranch(java.lang.String ticket,
                         int version,
                         java.lang.String srcPath,
                         java.lang.String dstPath,
                         java.lang.String name)
Create a new branch.

Specified by:
createBranch in interface AVMRemoteTransport
Parameters:
version - The version to look under for the source node.
srcPath - The path to the source node.
dstPath - The path to the destination directory.
name - The name of the new branch.

removeNode

public void removeNode(java.lang.String ticket,
                       java.lang.String parent,
                       java.lang.String name)
Remove a node.

Specified by:
removeNode in interface AVMRemoteTransport
Parameters:
parent - The path to the parent directory.
name - The name of the node to remove.

rename

public void rename(java.lang.String ticket,
                   java.lang.String srcParent,
                   java.lang.String srcName,
                   java.lang.String dstParent,
                   java.lang.String dstName)
Rename a node.

Specified by:
rename in interface AVMRemoteTransport
Parameters:
srcParent - The source directory path.
srcName - The source node name.
dstParent - The destination directory path.
dstName - The destination name for the node.

uncover

public void uncover(java.lang.String ticket,
                    java.lang.String dirPath,
                    java.lang.String name)
Uncover a name in a layered directory.

Specified by:
uncover in interface AVMRemoteTransport
Parameters:
dirPath - The path to the directory.
name - The name to uncover.

getNextVersionID

public int getNextVersionID(java.lang.String ticket,
                            java.lang.String storeName)
Get the latest version id of the given AVMStore.

Specified by:
getNextVersionID in interface AVMRemoteTransport
Parameters:
storeName - The name of the AVMStore.
Returns:
The latest version id.

getLatestSnapshotID

public int getLatestSnapshotID(java.lang.String ticket,
                               java.lang.String storeName)
Get the id of the latest version snapshot.

Specified by:
getLatestSnapshotID in interface AVMRemoteTransport
Parameters:
storeName - The store name.
Returns:
The id.

createSnapshot

public java.util.Map createSnapshot(java.lang.String ticket,
                                    java.lang.String store,
                                    java.lang.String label,
                                    java.lang.String comment)
Snapshot an AVMStore.

Specified by:
createSnapshot in interface AVMRemoteTransport
Parameters:
store - The name of the AVMStore to snapshot.
Returns:
The version id of the new snapshot.

getStoreVersions

public java.util.List getStoreVersions(java.lang.String ticket,
                                       java.lang.String name)
Get a List of all versions in a given store.

Specified by:
getStoreVersions in interface AVMRemoteTransport
Parameters:
name - The name of the store.
Returns:
A List of VersionDescriptors.

getStoreVersions

public java.util.List getStoreVersions(java.lang.String ticket,
                                       java.lang.String name,
                                       java.util.Date from,
                                       java.util.Date to)
Get AVMStore versions between given dates.

Specified by:
getStoreVersions in interface AVMRemoteTransport
Parameters:
name - The name of the store.
from - The date from which (inclusive).
to - The date to which (inclusive).
Returns:
A List of VersionDescriptors.

getStores

public java.util.List getStores(java.lang.String ticket)
Get a list of all AVM stores.

Specified by:
getStores in interface AVMRemoteTransport
Returns:
A List of AVMStoreDescriptors.

getStore

public AVMStoreDescriptor getStore(java.lang.String ticket,
                                   java.lang.String name)
Get the descriptor for a given AVMStore.

Specified by:
getStore in interface AVMRemoteTransport
Parameters:
name - The name of the store.
Returns:
An AVMStoreDescriptor.

getStoreRoot

public AVMNodeDescriptor getStoreRoot(java.lang.String ticket,
                                      int version,
                                      java.lang.String name)
Get the specified root of the specified store.

Specified by:
getStoreRoot in interface AVMRemoteTransport
Parameters:
version - The version number to fetch.
name - The name of the store.
Returns:
The AVMNodeDescriptor for the root.

lookup

public AVMNodeDescriptor lookup(java.lang.String ticket,
                                int version,
                                java.lang.String path)
Get a descriptor for the specified node.

Specified by:
lookup in interface AVMRemoteTransport
Parameters:
version - The version to look under.
path - The path to the node.
Returns:
An AVMNodeDescriptor.

lookup

public AVMNodeDescriptor lookup(java.lang.String ticket,
                                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.

Specified by:
lookup in interface AVMRemoteTransport
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

public AVMNodeDescriptor lookup(java.lang.String ticket,
                                AVMNodeDescriptor dir,
                                java.lang.String name)
Get a descriptor for the specified node.

Specified by:
lookup in interface AVMRemoteTransport
Parameters:
dir - The descriptor for the directory node.
name - The name of the node to lookup.
Returns:
An AVMNodeDescriptor.

lookup

public AVMNodeDescriptor lookup(java.lang.String ticket,
                                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.

Specified by:
lookup in interface AVMRemoteTransport
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

getIndirectionPath

public java.lang.String getIndirectionPath(java.lang.String ticket,
                                           int version,
                                           java.lang.String path)
Get the indirection path for a node.

Specified by:
getIndirectionPath in interface AVMRemoteTransport
Parameters:
version - The version to look under.
path - The path to the node.
Returns:
The indirection path/target.

purgeStore

public void purgeStore(java.lang.String ticket,
                       java.lang.String name)
Purge an AVMStore.

Specified by:
purgeStore in interface AVMRemoteTransport
Parameters:
name - The name of the store to purge.

purgeVersion

public void purgeVersion(java.lang.String ticket,
                         int version,
                         java.lang.String name)
Purge a given version from a given store.

Specified by:
purgeVersion in interface AVMRemoteTransport
Parameters:
version - The version id.
name - The name of the store.

makePrimary

public void makePrimary(java.lang.String ticket,
                        java.lang.String path)
Turn a directory into a primary indirection node.

Specified by:
makePrimary in interface AVMRemoteTransport
Parameters:
path - The path to the directory.

getHistory

public java.util.List getHistory(java.lang.String ticket,
                                 AVMNodeDescriptor desc,
                                 int count)
Get a list of ancestors of a node.

Specified by:
getHistory in interface AVMRemoteTransport
Parameters:
desc - The descriptor of the node whose history is to be fetched.
count - The maximum number of ancestors that will be returned.
Returns:
A List of descriptors for ancestors starting most recent first.

setOpacity

public void setOpacity(java.lang.String ticket,
                       java.lang.String path,
                       boolean opacity)
Turn on or off a directory's opacity.

Specified by:
setOpacity in interface AVMRemoteTransport
Parameters:
path - The path to the directory.
opacity - Whether the directory should be opaque or not.

getCommonAncestor

public AVMNodeDescriptor getCommonAncestor(java.lang.String ticket,
                                           AVMNodeDescriptor left,
                                           AVMNodeDescriptor right)
Get the most recent common ancestor of two nodes.

Specified by:
getCommonAncestor in interface AVMRemoteTransport
Parameters:
left - One node.
right - The other node.
Returns:
The common ancestor.

getLayeringInfo

public LayeringDescriptor getLayeringInfo(java.lang.String ticket,
                                          int version,
                                          java.lang.String path)
Get layering information about a path.

Specified by:
getLayeringInfo in interface AVMRemoteTransport
Parameters:
version - The version to look under.
path - The path to the node.
Returns:
A LayeringDescriptor.

setNodeProperty

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

Specified by:
setNodeProperty in interface AVMRemoteTransport
Parameters:
path - The path to the node.
name - The name of the property.
value - The value to give the property.

setNodeProperties

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

Specified by:
setNodeProperties in interface AVMRemoteTransport
Parameters:
path - The path to the node.
properties - A Map of QNames to PropertyValues to set.

getNodeProperty

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

Specified by:
getNodeProperty in interface AVMRemoteTransport
Parameters:
version - The version to look under.
path - The path to the node.
name - The name of the property.
Returns:
A PropertyValue.

getNodeProperties

public java.util.Map getNodeProperties(java.lang.String ticket,
                                       int version,
                                       java.lang.String path)
Get all properties of a node.

Specified by:
getNodeProperties in interface AVMRemoteTransport
Parameters:
version - The version.
path - The path to the node.
Returns:
A Map of QNames to PropertyValues.

deleteNodeProperty

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

Specified by:
deleteNodeProperty in interface AVMRemoteTransport
Parameters:
path - The path to the node.
name - The name of the property.

deleteNodeProperties

public void deleteNodeProperties(java.lang.String ticket,
                                 java.lang.String path)
Delete all properties from a node.

Specified by:
deleteNodeProperties in interface AVMRemoteTransport
Parameters:
path - The path to the node.

setStoreProperty

public void setStoreProperty(java.lang.String ticket,
                             java.lang.String store,
                             org.alfresco.service.namespace.QName name,
                             PropertyValue value)
Set a property on a store.

Specified by:
setStoreProperty in interface AVMRemoteTransport
Parameters:
store - The name of the store.
name - The name of the property to set.
value - The value of the property to set.

setStoreProperties

public void setStoreProperties(java.lang.String ticket,
                               java.lang.String store,
                               java.util.Map props)
Set a group of properties on a store.

Specified by:
setStoreProperties in interface AVMRemoteTransport
Parameters:
store - The name of the store.
props - A Map of QNames to PropertyValues to set.

getStoreProperty

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

Specified by:
getStoreProperty in interface AVMRemoteTransport
Parameters:
store - The name of the store.
name - The name of the property.
Returns:
A PropertyValue.

queryStorePropertyKey

public java.util.Map queryStorePropertyKey(java.lang.String ticket,
                                           java.lang.String store,
                                           org.alfresco.service.namespace.QName keyPattern)
Query a store for keys that match a pattern.

Specified by:
queryStorePropertyKey in interface AVMRemoteTransport
Parameters:
store - The store name.
keyPattern - The sql 'like' pattern.
Returns:
A Map of keys to values.

queryStoresPropertyKey

public java.util.Map queryStoresPropertyKey(java.lang.String ticket,
                                            org.alfresco.service.namespace.QName keyPattern)
Query all stores for keys that match a pattern.

Specified by:
queryStoresPropertyKey in interface AVMRemoteTransport
Parameters:
keyPattern - The sql 'like' pattern.
Returns:
A Map of store names to Maps of matching keys to values.

getStoreProperties

public java.util.Map getStoreProperties(java.lang.String ticket,
                                        java.lang.String store)
Get all the properties on a store.

Specified by:
getStoreProperties in interface AVMRemoteTransport
Parameters:
store - The name of the store.
Returns:
A Map of QNames to PropertyValues.

deleteStoreProperty

public void deleteStoreProperty(java.lang.String ticket,
                                java.lang.String store,
                                org.alfresco.service.namespace.QName name)
Delete a property from a store.

Specified by:
deleteStoreProperty in interface AVMRemoteTransport
Parameters:
store - The name of the store.
name - The name of the property.

renameStore

public void renameStore(java.lang.String ticket,
                        java.lang.String sourceName,
                        java.lang.String destName)
Description copied from interface: AVMRemoteTransport
Rename a store.

Specified by:
renameStore in interface AVMRemoteTransport
Parameters:
ticket - The authentication ticket.
sourceName - The original name.
destName - The new name.

addAspect

public void addAspect(java.lang.String ticket,
                      java.lang.String path,
                      org.alfresco.service.namespace.QName aspectName)
Description copied from interface: AVMRemoteTransport
Add an aspect to an AVM node.

Specified by:
addAspect in interface AVMRemoteTransport
path - The path to the node.
aspectName - The QName of the aspect.

getAspects

public java.util.Set getAspects(java.lang.String ticket,
                                int version,
                                java.lang.String path)
Description copied from interface: AVMRemoteTransport
Get all the aspects on an AVM node.

Specified by:
getAspects in interface AVMRemoteTransport
version - The version to look under.
path - The path to the node.
Returns:
A List of the QNames of the aspects.

hasAspect

public boolean hasAspect(java.lang.String ticket,
                         int version,
                         java.lang.String path,
                         org.alfresco.service.namespace.QName aspectName)
Description copied from interface: AVMRemoteTransport
Does a node have a particular aspect.

Specified by:
hasAspect in interface AVMRemoteTransport
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.

removeAspect

public void removeAspect(java.lang.String ticket,
                         java.lang.String path,
                         org.alfresco.service.namespace.QName aspectName)
Description copied from interface: AVMRemoteTransport
Remove an aspect and its properties from a node.

Specified by:
removeAspect in interface AVMRemoteTransport
path - The path to the node.
aspectName - The name of the aspect.

revert

public void revert(java.lang.String ticket,
                   java.lang.String path,
                   AVMNodeDescriptor toRevertTo)
Description copied from interface: AVMRemoteTransport
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.

Specified by:
revert in interface AVMRemoteTransport
path - The path to the node to revert.
toRevertTo - The descriptor of the version to revert to.

getAPath

public org.alfresco.util.Pair getAPath(java.lang.String ticket,
                                       AVMNodeDescriptor desc)
Description copied from interface: AVMRemoteTransport
Get a version and path for a node.

Specified by:
getAPath in interface AVMRemoteTransport
Parameters:
ticket - The authentication ticket.
desc - The node descriptor for the node we want to get a path to.
Returns:
version and path.

setGuid

public void setGuid(java.lang.String ticket,
                    java.lang.String path,
                    java.lang.String guid)
Description copied from interface: AVMRemoteTransport
Set the GUID on a node.

Specified by:
setGuid in interface AVMRemoteTransport
Parameters:
ticket - The authentication ticket.
path - The path to the node.
guid - The GUID to set.

setEncoding

public void setEncoding(java.lang.String ticket,
                        java.lang.String path,
                        java.lang.String encoding)
Description copied from interface: AVMRemoteTransport
Set the encoding.

Specified by:
setEncoding in interface AVMRemoteTransport
path - The path of the file.
encoding - The encoding.

setMimeType

public void setMimeType(java.lang.String ticket,
                        java.lang.String path,
                        java.lang.String mimeType)
Description copied from interface: AVMRemoteTransport
Set the mime type.

Specified by:
setMimeType in interface AVMRemoteTransport
path - The path of the file.
mimeType - The mime type.


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