org.alfresco.repo.avm
Interface AVMStore

All Known Implementing Classes:
AVMStoreImpl

public interface AVMStore

The store interface. Methods for filesystem like, versioning, and layering operations.


Method Summary
 void addAspect(java.lang.String path, org.alfresco.service.namespace.QName aspectName)
          Add an aspect to a node.
 org.alfresco.service.cmr.repository.ContentWriter createContentWriter(java.lang.String path, boolean update)
          Get a ContentWriter to a file.
 void createDirectory(java.lang.String path, java.lang.String name, java.util.List aspects, java.util.Map properties)
          Create a new directory.
 java.io.OutputStream createFile(java.lang.String path, java.lang.String name)
          Create a new file.
 void createFile(java.lang.String path, java.lang.String name, java.io.File data, java.util.List aspects, java.util.Map properties)
          Create a file with the given contents.
 void createLayeredDirectory(java.lang.String srcPath, java.lang.String dstPath, java.lang.String name)
          Create a new layered directory.
 void createLayeredFile(java.lang.String srcPath, java.lang.String dstPath, java.lang.String name)
          Create a new layered file.
 java.util.Map createSnapshot(java.lang.String tag, java.lang.String Description, java.util.Map snapShotMap)
          Snapshots this store.
 void deleteNodeProperties(java.lang.String path)
          Delete all properties from a node.
 void deleteNodeProperty(java.lang.String path, org.alfresco.service.namespace.QName name)
          Delete a single property from a node.
 void deleteProperty(org.alfresco.service.namespace.QName name)
          Delete a property.
 Acl getACL(int version, java.lang.String path)
          Get the ACL on a node.
 java.util.Set getAspects(int version, java.lang.String path)
          Get all aspects on a given node.
 AVMRepository getAVMRepository()
          Get the AVMRepository.
 org.alfresco.service.cmr.repository.ContentData getContentDataForRead(int version, java.lang.String path)
          Get the ContentData on a file.
 org.alfresco.service.cmr.repository.ContentData getContentDataForWrite(java.lang.String path)
          Get the ContentData for writing.
 org.alfresco.service.cmr.repository.ContentReader getContentReader(int version, java.lang.String path)
          Get a ContentReader from a file.
 java.util.List getDeleted(int version, java.lang.String path)
          Get the names of the deleted nodes in a directory.
 AVMStoreDescriptor getDescriptor()
          Get the descriptor for this.
 long getId()
          Get the primary key.
 java.lang.String getIndirectionPath(int version, java.lang.String path)
          For a layered node, get its indirection.
 java.io.InputStream getInputStream(int version, java.lang.String path)
          Get an InputStream from a file.
 int getLastVersionID()
          This gets the last extant version id.
 java.util.SortedMap getListing(int version, java.lang.String path, boolean includeDeleted)
          Get a listing of the designated directory.
 java.util.SortedMap getListingDirect(int version, java.lang.String path, boolean includeDeleted)
          Get the list of nodes directly contained in a directory.
 java.lang.String getName()
          Get the name of this store.
 int getNextVersionID()
          This returns the next version in this store that will be snapshotted.
 java.util.Map getNodeProperties(int version, java.lang.String path)
          Get all the properties associated with a node.
 PropertyValue getNodeProperty(int version, java.lang.String path, org.alfresco.service.namespace.QName name)
          Get a property by name.
 java.io.OutputStream getOutputStream(java.lang.String path)
          Get an output stream to a file.
 java.util.Map getProperties()
          Get all the properties associated with this node.
 PropertyValue getProperty(org.alfresco.service.namespace.QName name)
          Get a property by name.
 DirectoryNode getRoot()
          Get the root directory of this AVMStore.
 AVMNodeDescriptor getRoot(int version)
          Get the specified root as a descriptor.
 Acl getStoreAcl()
          Get the Acl associated with this store.
 java.util.List getVersions()
          Get all the version for this AVMStore.
 java.util.List getVersions(java.util.Date from, java.util.Date to)
          Get the versions from between the given dates.
 java.util.List getVersionsBetween(int startVersion, int endVersion)
          Get all versions from an including startVersion up to but NOT including endVersion
 java.util.List getVersionsFrom(int version)
          Get all the versions starting from the last until the version specified
 java.util.List getVersionsTo(int version)
          Get all the versions after and including the one specified
 boolean hasAspect(int version, java.lang.String path, org.alfresco.service.namespace.QName aspectName)
          Does a given node have a given aspect.
 void link(java.lang.String parentPath, java.lang.String name, AVMNodeDescriptor toLink)
          Link a node into a directory, directly.
 org.alfresco.repo.avm.Lookup lookup(int version, java.lang.String path, boolean write, boolean includeDeleted)
          Lookup a node.
 org.alfresco.repo.avm.Lookup lookupDirectory(int version, java.lang.String path, boolean write)
          Lookup a directory.
 void makePrimary(java.lang.String path)
          Make the indicated directory a primary indirection.
 void purgeVersion(int version)
          Purge all the nodes reachable only by the given version.
 void removeAspect(java.lang.String path, org.alfresco.service.namespace.QName aspectName)
          Remove an aspect and all its properties from a node.
 void removeNode(java.lang.String path, java.lang.String name)
          Remove a node and all of its contents.
 void retargetLayeredDirectory(java.lang.String path, java.lang.String target)
          Change the target of a layered directory.
 void revert(java.lang.String path, java.lang.String name, AVMNodeDescriptor toRevertTo)
          Revert a head path to a given version.
 void setACL(java.lang.String path, Acl acl)
          Set the ACL on a node.
 void setContentData(java.lang.String path, org.alfresco.service.cmr.repository.ContentData data)
          Set the ContentData for a file.
 void setEncoding(java.lang.String path, java.lang.String encoding)
          Set the encoding of a file.
 void setGuid(java.lang.String path, java.lang.String guid)
          Set the GUID on a node.
 void setMetaDataFrom(java.lang.String path, AVMNode from)
          Set meta data, aspects, properties, acls, from another node.
 void setMimeType(java.lang.String path, java.lang.String mimeType)
          Set the mime type of a file.
 void setName(java.lang.String name)
          Set the name of the store.
 void setNewRoot(DirectoryNode root)
          Set a new root for this store.
 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 setProperties(java.util.Map properties)
          Set a group of properties on this store.
 void setProperty(org.alfresco.service.namespace.QName name, PropertyValue value)
          Set a property on this store.
 void setStoreAcl(Acl acl)
          Set the acl on this store.
 void uncover(java.lang.String dirPath, java.lang.String name)
          Uncover a whited out node.
 void updateLink(java.lang.String parentPath, java.lang.String name, AVMNodeDescriptor toLink)
          Update a link to a node in a directory, directly.
 

Method Detail

getId

long getId()
Get the primary key.


getNextVersionID

int getNextVersionID()
This returns the next version in this store that will be snapshotted.

Returns:
The next version to be snapshotted.

getLastVersionID

int getLastVersionID()
This gets the last extant version id.


setNewRoot

void setNewRoot(DirectoryNode root)
Set a new root for this store.

Parameters:
root - The root to set.

getStoreAcl

Acl getStoreAcl()
Get the Acl associated with this store.

Returns:

setStoreAcl

void setStoreAcl(Acl acl)
Set the acl on this store.

Parameters:
acl -

createSnapshot

java.util.Map createSnapshot(java.lang.String tag,
                             java.lang.String Description,
                             java.util.Map snapShotMap)
Snapshots this store. This sets all nodes in the the store to the should be copied state, and creates a new version root.

Parameters:
tag - The short description.
description - The long description.
snapShotMap - Keeps track of snapshot ids for all stores that end up snapshotted, possibly recursively.
Returns:
The map of all implicitely and explicitely snapshotted stores.

createDirectory

void createDirectory(java.lang.String path,
                     java.lang.String name,
                     java.util.List aspects,
                     java.util.Map properties)
Create a new directory.

Parameters:
path - The path to the parent directory.
name - The name to give the new directory.

createLayeredDirectory

void createLayeredDirectory(java.lang.String srcPath,
                            java.lang.String dstPath,
                            java.lang.String name)
Create a new layered directory.

Parameters:
srcPath - The path that the new layered directory will point at.
dstPath - The path to the directory to create the new layered directory in.
name - The name of the new layered directory.

createFile

java.io.OutputStream createFile(java.lang.String path,
                                java.lang.String name)
Create a new file. The designated file cannot already exist.

Parameters:
path - The path to the directory to contain the new file.
name - The name to give the new file.
Returns:
An OutputStream.

createFile

void createFile(java.lang.String path,
                java.lang.String name,
                java.io.File data,
                java.util.List aspects,
                java.util.Map properties)
Create a file with the given contents.

Parameters:
path - The path to the containing directory.
name - The name to give the file.
data - The contents of the file.

createLayeredFile

void createLayeredFile(java.lang.String srcPath,
                       java.lang.String dstPath,
                       java.lang.String name)
Create a new layered file.

Parameters:
srcPath - The target path for the new file.
dstPath - The path to the directory to make the new file in.
name - The name of the new file.

getInputStream

java.io.InputStream getInputStream(int version,
                                   java.lang.String path)
Get an InputStream from a file.

Parameters:
version - The version to look under.
path - The path to the file.
Returns:
An InputStream

getContentReader

org.alfresco.service.cmr.repository.ContentReader getContentReader(int version,
                                                                   java.lang.String path)
Get a ContentReader from a file.

Parameters:
version - The version to look under.
path - The path to the file.
Returns:
A ContentReader

getListing

java.util.SortedMap getListing(int version,
                               java.lang.String path,
                               boolean includeDeleted)
Get a listing of the designated directory.

Parameters:
version - The version to look under.
path - The path to the directory.
includeDeleted - Whether to see Deleted nodes.
Returns:
A listing.

getListingDirect

java.util.SortedMap getListingDirect(int version,
                                     java.lang.String path,
                                     boolean includeDeleted)
Get the list of nodes directly contained in a directory.

Parameters:
version - The version to look under.
path - The path to the directory.
includeDeleted - Whether to see Deleted nodes.
Returns:
A Map of names to descriptors.

getDeleted

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

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

getOutputStream

java.io.OutputStream getOutputStream(java.lang.String path)
Get an output stream to a file.

Parameters:
path - The path to the file.
Returns:
An OutputStream

createContentWriter

org.alfresco.service.cmr.repository.ContentWriter createContentWriter(java.lang.String path,
                                                                      boolean update)
Get a ContentWriter to a file.

Parameters:
path - The path to the file.
update - true if the property must be updated atomically when the content write stream is closed (attaches a listener to the stream); false if the client code will perform the updates itself.
Returns:
A ContentWriter.

removeNode

void removeNode(java.lang.String path,
                java.lang.String name)
Remove a node and all of its contents.

Parameters:
path - The path to the node's parent directory.
name - The name of the node to remove.

uncover

void uncover(java.lang.String dirPath,
             java.lang.String name)
Uncover a whited out node.

Parameters:
dirPath - The path to the directory.
name - The name to uncover.

getVersions

java.util.List getVersions()
Get all the version for this AVMStore.

Returns:
A Set of all versions.

getVersionsFrom

java.util.List getVersionsFrom(int version)
Get all the versions starting from the last until the version specified

Parameters:
version - - the version which which to end
Returns:
- the versions in descending order

getVersionsTo

java.util.List getVersionsTo(int version)
Get all the versions after and including the one specified

Parameters:
version - - the version to start from
Returns:
- the versions in ascending order

getVersionsBetween

java.util.List getVersionsBetween(int startVersion,
                                  int endVersion)
Get all versions from an including startVersion up to but NOT including endVersion

Parameters:
startVersion -
endVersion -
Returns:
- the versions in ascending order

getVersions

java.util.List getVersions(java.util.Date from,
                           java.util.Date to)
Get the versions from between the given dates. From or to may be null but not both.

Parameters:
from - The earliest date.
to - The latest date.
Returns:
The Set of matching version IDs.

getAVMRepository

AVMRepository getAVMRepository()
Get the AVMRepository.

Returns:
The AVMRepository.

lookup

org.alfresco.repo.avm.Lookup lookup(int version,
                                    java.lang.String path,
                                    boolean write,
                                    boolean includeDeleted)
Lookup a node.

Parameters:
version - The version to look under.
path - The path to the node.
write - Whether this is in a write context.
includeDeleted - Whether to see Deleted nodes.
Returns:
A Lookup object.

lookupDirectory

org.alfresco.repo.avm.Lookup lookupDirectory(int version,
                                             java.lang.String path,
                                             boolean write)
Lookup a directory.

Parameters:
version - The version to look under.
path - The path to the directory.
write - Whether this is in a write context.
Returns:
A Lookup object.

getIndirectionPath

java.lang.String getIndirectionPath(int version,
                                    java.lang.String path)
For a layered node, get its indirection.

Parameters:
version - The version to look under.
path - The path to the node.
Returns:
The indirection.

makePrimary

void makePrimary(java.lang.String path)
Make the indicated directory a primary indirection.

Parameters:
path - The AVMRepository relative path.

retargetLayeredDirectory

void retargetLayeredDirectory(java.lang.String path,
                              java.lang.String target)
Change the target of a layered directory.

Parameters:
path - The path to the layered directory.
target - The new target path.

getRoot

DirectoryNode getRoot()
Get the root directory of this AVMStore.

Returns:
The root directory.

getRoot

AVMNodeDescriptor getRoot(int version)
Get the specified root as a descriptor.

Parameters:
version - The version to get (-1 for head).
Returns:
The specified root or null.

getName

java.lang.String getName()
Get the name of this store.

Returns:
The name.

setName

void setName(java.lang.String name)
Set the name of the store.

Parameters:
name - To Set.

purgeVersion

void purgeVersion(int version)
Purge all the nodes reachable only by the given version.

Parameters:
version -

getDescriptor

AVMStoreDescriptor getDescriptor()
Get the descriptor for this.

Returns:
The descriptor.

setOpacity

void setOpacity(java.lang.String path,
                boolean opacity)
Set the opacity of a layered directory. An opaque directory hides what is pointed at by its indirection.

Parameters:
path - The path to the layered directory.
opacity - True is opaque; false is not.

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.
name - The name of the property.
value - The value to set.

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 QNames to PropertyValues.

getNodeProperty

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

Parameters:
version - The version to look under.
path - The path to the node.
name - The name of the property.
Returns:
A PropertyValue or null if not found.

deleteNodeProperty

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

Parameters:
path - The path to the node.
name - The name of the property.

deleteNodeProperties

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

Parameters:
path - The path to the node.

getNodeProperties

java.util.Map getNodeProperties(int version,
                                java.lang.String path)
Get all the properties associated with a node.

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

setProperty

void setProperty(org.alfresco.service.namespace.QName name,
                 PropertyValue value)
Set a property on this store. Replaces if property already exists.

Parameters:
name - The QName of the property.
value - The actual PropertyValue.

setProperties

void setProperties(java.util.Map properties)
Set a group of properties on this store. Replaces any property that exists.

Parameters:
properties - A Map of QNames to PropertyValues to set.

getProperty

PropertyValue getProperty(org.alfresco.service.namespace.QName name)
Get a property by name.

Parameters:
name - The QName of the property to fetch.
Returns:
The PropertyValue or null if non-existent.

getProperties

java.util.Map getProperties()
Get all the properties associated with this node.

Returns:
A Map of the properties.

deleteProperty

void deleteProperty(org.alfresco.service.namespace.QName name)
Delete a property.

Parameters:
name - The name of the property to delete.

getContentDataForRead

org.alfresco.service.cmr.repository.ContentData getContentDataForRead(int version,
                                                                      java.lang.String path)
Get the ContentData on a file.

Parameters:
version - The version to look under.
path - The path to the file.
Returns:
The ContentData corresponding to the file.

getContentDataForWrite

org.alfresco.service.cmr.repository.ContentData getContentDataForWrite(java.lang.String path)
Get the ContentData for writing.

Parameters:
path - The path to the file.
Returns:
The ContentData object.

setContentData

void setContentData(java.lang.String path,
                    org.alfresco.service.cmr.repository.ContentData data)
Set the ContentData for a file.

Parameters:
path - The path to the file.
data - The ContentData to set.

setMetaDataFrom

void setMetaDataFrom(java.lang.String path,
                     AVMNode from)
Set meta data, aspects, properties, acls, from another node.

Parameters:
path - The path to the node to set metadata on.
from - The node to get the metadata from.

addAspect

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

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

getAspects

java.util.Set getAspects(int version,
                         java.lang.String path)
Get all aspects on a given node.

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

removeAspect

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

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

hasAspect

boolean hasAspect(int version,
                  java.lang.String path,
                  org.alfresco.service.namespace.QName aspectName)
Does a given node have a given aspect.

Parameters:
version - The version to look under.
path - The path to the node.
aspectName - The name of the aspect.
Returns:
Whether the node has the aspect.

setACL

void setACL(java.lang.String path,
            Acl acl)
Set the ACL on a node.

Parameters:
path - The path to the node.
acl - The ACL to set.

getACL

Acl getACL(int version,
           java.lang.String path)
Get the ACL on a node.

Parameters:
version - The version to look under.
path - The path to the node.
Returns:
The ACL.

link

void link(java.lang.String parentPath,
          java.lang.String name,
          AVMNodeDescriptor toLink)
Link a node into a directory, directly.

Parameters:
parentPath - The path to the directory.
name - The name to give the node.
toLink - The node to link.

updateLink

void updateLink(java.lang.String parentPath,
                java.lang.String name,
                AVMNodeDescriptor toLink)
Update a link to a node in a directory, directly.

Parameters:
parentPath - The path to the directory.
name - The name to give the node.
toLink - The node to link.

revert

void revert(java.lang.String path,
            java.lang.String name,
            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 parent directory.
name - The name of the node to revert.
toRevertTo - The descriptor of the version to revert to.

setGuid

void setGuid(java.lang.String path,
             java.lang.String guid)
Set the GUID on a node.

Parameters:
path -
guid -

setEncoding

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

Parameters:
path -
encoding -

setMimeType

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

Parameters:
path -
mimeType -


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