public class AVMRepository extends Object
| Constructor and Description |
|---|
AVMRepository()
Create a new one.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAspect(String path,
org.alfresco.service.namespace.QName aspectName)
Add an aspect to an AVM Node.
|
boolean |
can(AVMStore store,
AVMNode node,
String permission,
boolean isDirectlyContained)
Evaluate permission on a node.
|
boolean |
can(String storeName,
int version,
String path,
String permission) |
void |
createAVMStore(String name)
Create a new AVMStore.
|
void |
createAVMStore(String name,
Map<org.alfresco.service.namespace.QName,PropertyValue> props) |
void |
createBranch(int version,
String srcPath,
String dstPath,
String name)
Create a new branch.
|
org.alfresco.service.cmr.repository.ContentWriter |
createContentWriter(String path,
boolean update)
Get a ContentWriter to a file node.
|
AVMNodeDescriptor |
createDirectory(AVMNodeDescriptor parent,
String name)
Create a new directory.
|
void |
createDirectory(String path,
String name,
List<org.alfresco.service.namespace.QName> aspects,
Map<org.alfresco.service.namespace.QName,PropertyValue> properties)
Create a new directory.
|
OutputStream |
createFile(String path,
String name)
Create a file.
|
void |
createFile(String path,
String name,
File data,
List<org.alfresco.service.namespace.QName> aspects,
Map<org.alfresco.service.namespace.QName,PropertyValue> properties)
Create a file with the given File as content.
|
void |
createLayeredDirectory(String srcPath,
String dstPath,
String name)
Create a new layered directory.
|
void |
createLayeredFile(String srcPath,
String dstPath,
String name)
Create a new layered file.
|
Map<String,Integer> |
createSnapshot(String storeName,
String tag,
String description)
Create a snapshot of a single AVMStore.
|
void |
deleteNodeProperties(String path)
Delete all properties on a node.
|
void |
deleteNodeProperty(String path,
org.alfresco.service.namespace.QName name)
Delete a single property from a node.
|
void |
deleteStoreProperty(String store,
org.alfresco.service.namespace.QName name)
Delete a property from a store.
|
void |
flatten(String path,
String name)
Remove name without leaving behind a deleted node.
|
AVMNodeDescriptor |
forceCopy(String path)
Force a copy on write.
|
Acl |
getACL(int version,
String path)
Get the ACL on a node.
|
org.alfresco.util.Pair<Integer,String> |
getAPath(AVMNodeDescriptor desc)
Get a single valid path for a node.
|
Set<org.alfresco.service.namespace.QName> |
getAspects(AVMNodeDescriptor desc) |
Set<org.alfresco.service.namespace.QName> |
getAspects(int version,
String path)
Get all the aspects on an AVM node.
|
AVMStoreDescriptor |
getAVMStore(String name)
Get a descriptor for an AVMStore.
|
AVMNodeDescriptor |
getAVMStoreRoot(int version,
String name)
Get a descriptor for an AVMStore root.
|
List<AVMStoreDescriptor> |
getAVMStores()
Get descriptors of all AVMStores.
|
List<VersionDescriptor> |
getAVMStoreVersions(String name)
Get all version for a given AVMStore.
|
List<VersionDescriptor> |
getAVMStoreVersions(String name,
Date from,
Date to)
Get the set of versions between (inclusive) of the given dates.
|
List<VersionDescriptor> |
getAVMStoreVersionsBetween(String name,
int startVersion,
int endVersion) |
List<VersionDescriptor> |
getAVMStoreVersionsFrom(String name,
int version) |
List<VersionDescriptor> |
getAVMStoreVersionsTo(String name,
int version) |
AVMNodeDescriptor |
getCommonAncestor(AVMNodeDescriptor left,
AVMNodeDescriptor right)
Get the common ancestor of two nodes if one exists.
|
org.alfresco.service.cmr.repository.ContentData |
getContentDataForRead(AVMNodeDescriptor desc) |
org.alfresco.service.cmr.repository.ContentData |
getContentDataForRead(int version,
String path)
Get the ContentData for a file.
|
org.alfresco.service.cmr.repository.ContentData |
getContentDataForWrite(String path)
Get the ContentData for a file for writing.
|
org.alfresco.service.cmr.repository.ContentReader |
getContentReader(int version,
String path)
Get a content reader from a file node.
|
List<String> |
getDeleted(int version,
String path)
Get the names of deleted nodes in a directory.
|
List<org.alfresco.util.Pair<Integer,String>> |
getHeadPaths(AVMNodeDescriptor desc)
Get all paths for a node reachable by HEAD.
|
List<AVMNodeDescriptor> |
getHistory(AVMNodeDescriptor desc,
int count)
Get the history chain for a node.
|
String |
getIndirectionPath(int version,
String path)
Get the indirection path for a layered node.
|
InputStream |
getInputStream(AVMNodeDescriptor desc) |
InputStream |
getInputStream(int version,
String path)
Get an input stream from a file.
|
static AVMRepository |
GetInstance()
Get the single instance of AVMRepository.
|
int |
getLatestSnapshotID(String name)
Get the latest extant snapshotted version id.
|
int |
getLatestVersionID(String name)
Get the next version id for the given AVMStore.
|
LayeringDescriptor |
getLayeringInfo(int version,
String path)
Get information about layering of a path.
|
SortedMap<String,AVMNodeDescriptor> |
getListing(AVMNodeDescriptor dir,
boolean includeDeleted)
Get a directory listing from a directory node descriptor.
|
SortedMap<String,AVMNodeDescriptor> |
getListing(AVMNodeDescriptor dir,
String childNamePattern,
boolean includeDeleted)
Get a directory listing from a directory node descriptor fo children that match the given pattern
|
SortedMap<String,AVMNodeDescriptor> |
getListing(int version,
String path,
boolean includeDeleted)
Get a listing of a directory.
|
SortedMap<String,AVMNodeDescriptor> |
getListingDirect(AVMNodeDescriptor dir,
boolean includeDeleted)
Get the list of nodes directly contained in a directory.
|
SortedMap<String,AVMNodeDescriptor> |
getListingDirect(int version,
String path,
boolean includeDeleted)
Get the list of nodes directly contained in a directory.
|
Map<org.alfresco.service.namespace.QName,PropertyValue> |
getNodeProperties(AVMNodeDescriptor desc) |
Map<org.alfresco.service.namespace.QName,PropertyValue> |
getNodeProperties(int version,
String path)
Get a Map of all the properties of a node.
|
PropertyValue |
getNodeProperty(int version,
String path,
org.alfresco.service.namespace.QName name)
Get a property by name for a node.
|
OutputStream |
getOutputStream(String path)
Get an output stream to a file.
|
List<org.alfresco.util.Pair<Integer,String>> |
getPaths(AVMNodeDescriptor desc)
Get all the paths to a particular node.
|
List<org.alfresco.util.Pair<Integer,String>> |
getPathsInStoreHead(AVMNodeDescriptor desc,
String store)
Get all paths in a particular store in the head version for a particular node.
|
List<String> |
getPathsInStoreVersion(AVMNodeDescriptor desc,
String store,
int version) |
Acl |
getStoreAcl(String storeName)
Get the ACL on a store.
|
Map<org.alfresco.service.namespace.QName,PropertyValue> |
getStoreProperties(String store)
Get all the properties for a store.
|
PropertyValue |
getStoreProperty(String store,
org.alfresco.service.namespace.QName name)
Get a property from a store.
|
List<String> |
getVersionPaths(VersionRoot version,
AVMNode node)
Gets all the pass from to the given node starting from the give version root.
|
boolean |
hasAspect(int version,
String path,
org.alfresco.service.namespace.QName aspectName)
Does a node have a particular aspect.
|
void |
link(AVMNodeDescriptor parent,
String name,
AVMNodeDescriptor child)
This is the danger version of link.
|
void |
link(String parentPath,
String name,
AVMNodeDescriptor toLink)
Link a node into a directory, directly.
|
AVMNodeDescriptor |
lookup(AVMNodeDescriptor dir,
String name,
boolean includeDeleted)
Lookup a descriptor from a directory descriptor.
|
org.alfresco.repo.avm.Lookup |
lookup(int version,
String path,
boolean includeDeleted)
Lookup a node.
|
org.alfresco.repo.avm.Lookup |
lookupDirectory(int version,
String path)
Lookup a directory specifically.
|
void |
makePrimary(String path)
Make a directory into a primary indirection.
|
void |
purgeAVMStore(String name)
Get rid of all content that lives only in the given AVMStore.
|
void |
purgeVersion(String name,
int version)
Remove all content specific to a AVMRepository and version.
|
Map<org.alfresco.service.namespace.QName,PropertyValue> |
queryStorePropertyKey(String store,
org.alfresco.service.namespace.QName keyPattern)
Queries a given store for properties with keys that match a given pattern.
|
Map<String,Map<org.alfresco.service.namespace.QName,PropertyValue>> |
queryStoresPropertyKeys(org.alfresco.service.namespace.QName keyPattern)
Queries all AVM stores for properties with keys that match a given pattern.
|
void |
remove(String path,
String name)
Remove a node and everything underneath it.
|
void |
removeAspect(String path,
org.alfresco.service.namespace.QName aspectName)
Remove an aspect and all associated properties from a node.
|
void |
rename(String srcPath,
String srcName,
String dstPath,
String dstName)
Rename a node.
|
void |
renameStore(String sourceName,
String destName)
Rename a store.
|
void |
retargetLayeredDirectory(String path,
String target)
Change what a layered directory points at.
|
void |
revert(String path,
String name,
AVMNodeDescriptor toRevertTo)
Revert a head path to a given version.
|
void |
setACL(String path,
Acl acl)
Set the ACL on a node.
|
void |
setAvmNodeDAO(AVMNodeDAO dao) |
void |
setAvmStoreDAO(AVMStoreDAO dao) |
void |
setAvmStorePropertyDAO(AVMStorePropertyDAO dao) |
void |
setChildEntryDAO(ChildEntryDAO dao) |
void |
setContentData(String path,
org.alfresco.service.cmr.repository.ContentData data)
Set the ContentData on a file.
|
void |
setContentStore(ContentStore store)
Set the ContentService.
|
void |
setCreateStoreTxnListener(CreateStoreTxnListener listener) |
void |
setCreateVersionTxnListener(CreateVersionTxnListener listener) |
void |
setEncoding(String path,
String encoding)
Set the encoding on a node.
|
void |
setGuid(String path,
String guid)
Set the GUID on a node.
|
void |
setLookupCache(LookupCache cache)
Set the Lookup Cache instance.
|
void |
setMetaDataFrom(String path,
AVMNodeDescriptor from) |
void |
setMimeType(String path,
String mimeType)
Set the mime type on a node.
|
void |
setNodeProperties(String path,
Map<org.alfresco.service.namespace.QName,PropertyValue> properties)
Set a collection of properties at once.
|
void |
setNodeProperty(String path,
org.alfresco.service.namespace.QName name,
PropertyValue value)
Set a property on a node.
|
void |
setOpacity(String path,
boolean opacity)
Set the opacity of a layered directory.
|
void |
setPermissionService(org.alfresco.service.cmr.security.PermissionService service) |
void |
setPurgeStoreTxnListener(PurgeStoreTxnListener listener) |
void |
setPurgeVersionTxnListener(PurgeVersionTxnListener listener) |
void |
setStoreAcl(String storeName,
Acl acl)
Set the acl on a store.
|
void |
setStoreProperties(String store,
Map<org.alfresco.service.namespace.QName,PropertyValue> props)
Set a group of properties on a store.
|
void |
setStoreProperty(String store,
org.alfresco.service.namespace.QName name,
PropertyValue value)
Set a property on a store.
|
void |
setVersionLayeredNodeEntryDAO(VersionLayeredNodeEntryDAO dao) |
void |
setVersionRootDAO(VersionRootDAO dao) |
void |
uncover(String dirPath,
String name)
Uncover a deleted name in a layered directory.
|
void |
updateLink(String parentPath,
String name,
AVMNodeDescriptor toLink)
Update a link, directly.
|
public void setContentStore(ContentStore store)
public void setLookupCache(LookupCache cache)
cache - The instance to set.public void setCreateStoreTxnListener(CreateStoreTxnListener listener)
public void setPurgeStoreTxnListener(PurgeStoreTxnListener listener)
public void setCreateVersionTxnListener(CreateVersionTxnListener listener)
public void setPurgeVersionTxnListener(PurgeVersionTxnListener listener)
public void setAvmStoreDAO(AVMStoreDAO dao)
public void setAvmNodeDAO(AVMNodeDAO dao)
public void setVersionRootDAO(VersionRootDAO dao)
public void setVersionLayeredNodeEntryDAO(VersionLayeredNodeEntryDAO dao)
public void setAvmStorePropertyDAO(AVMStorePropertyDAO dao)
public void setChildEntryDAO(ChildEntryDAO dao)
public void setPermissionService(org.alfresco.service.cmr.security.PermissionService service)
public OutputStream createFile(String path, String name)
path - The path to the containing directory.name - The name for the new file.public void createFile(String path, String name, File data, List<org.alfresco.service.namespace.QName> aspects, Map<org.alfresco.service.namespace.QName,PropertyValue> properties)
path - The path to the containing directory.name - The name to give the file.data - The file contents.public void createDirectory(String path, String name, List<org.alfresco.service.namespace.QName> aspects, Map<org.alfresco.service.namespace.QName,PropertyValue> properties)
path - The path to the containing directory.name - The name to give the directory.public AVMNodeDescriptor createDirectory(AVMNodeDescriptor parent, String name)
parent - The parent node.name - The name of the new directory.public void createLayeredDirectory(String srcPath, String dstPath, String name)
srcPath - The target indirection for the new layered directory.dstPath - The path to the containing directory.name - The name for the new directory.public void createLayeredFile(String srcPath, String dstPath, String name)
srcPath - The target indirection for the new layered file.dstPath - The path to the containing directory.name - The name of the new layered file.public void createAVMStore(String name)
name - The name to give the new AVMStore.public void createAVMStore(String name, Map<org.alfresco.service.namespace.QName,PropertyValue> props)
public void createBranch(int version,
String srcPath,
String dstPath,
String name)
version - The version to branch off.srcPath - The path to make a branch from.dstPath - The containing directory.name - The name of the new branch.public OutputStream getOutputStream(String path)
path - The full path to the file.public org.alfresco.service.cmr.repository.ContentReader getContentReader(int version,
String path)
version - The version of the file.path - The path to the file.public org.alfresco.service.cmr.repository.ContentWriter createContentWriter(String path, boolean update)
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.public void rename(String srcPath, String srcName, String dstPath, String dstName)
srcPath - Source containing directory.srcName - Source name.dstPath - Destination containing directory.dstName - Destination name.public void uncover(String dirPath, String name)
dirPath - The path to the layered directory.name - The name to uncover.public Map<String,Integer> createSnapshot(String storeName, String tag, String description)
store - The name of the repository.tag - The short description.description - The thick description.public void remove(String path, String name)
path - The path to the containing directory.name - The name of the node to remove.public void purgeAVMStore(String name)
name - The name of the AVMStore to purge.public void purgeVersion(String name, int version)
name - The name of the AVMStore.version - The version to purge.public InputStream getInputStream(int version, String path)
version - The version to look under.path - The path to the file.public InputStream getInputStream(AVMNodeDescriptor desc)
public SortedMap<String,AVMNodeDescriptor> getListing(int version, String path, boolean includeDeleted)
version - The version to look under.path - The path to the directory.includeDeleted - Whether to see DeletedNodes.public SortedMap<String,AVMNodeDescriptor> getListingDirect(int version, String path, boolean includeDeleted)
version - The version to look under.path - The path to the directory to list.public SortedMap<String,AVMNodeDescriptor> getListingDirect(AVMNodeDescriptor dir, boolean includeDeleted)
dir - The descriptor to the directory node.includeDeleted - Whether to include deleted children.public SortedMap<String,AVMNodeDescriptor> getListing(AVMNodeDescriptor dir, boolean includeDeleted)
dir - The directory node descriptor.public SortedMap<String,AVMNodeDescriptor> getListing(AVMNodeDescriptor dir, String childNamePattern, boolean includeDeleted)
dir - The directory node descriptor.public List<String> getDeleted(int version, String path)
version - The version to look under.path - The path to the directory.public List<AVMStoreDescriptor> getAVMStores()
public AVMStoreDescriptor getAVMStore(String name)
name - The name to get.public List<VersionDescriptor> getAVMStoreVersions(String name)
name - The name of the AVMStore.public List<VersionDescriptor> getAVMStoreVersions(String name, Date from, Date to)
name - The name of the AVMRepository.from - The earliest date.to - The latest date.public String getIndirectionPath(int version, String path)
version - The version to look under.path - The path to the node.public int getLatestVersionID(String name)
name - The name of the AVMStore.public int getLatestSnapshotID(String name)
name - The store name.public AVMNodeDescriptor getAVMStoreRoot(int version, String name)
version - The version to get.name - The name of the AVMStore.public org.alfresco.repo.avm.Lookup lookup(int version,
String path,
boolean includeDeleted)
version - The version to look under.path - The path to lookup.includeDeleted - Whether to see DeletedNodes.public AVMNodeDescriptor lookup(AVMNodeDescriptor dir, String name, boolean includeDeleted)
dir - The directory descriptor.name - The name of the child to lookup.public List<org.alfresco.util.Pair<Integer,String>> getPaths(AVMNodeDescriptor desc)
desc - The node descriptor.public org.alfresco.util.Pair<Integer,String> getAPath(AVMNodeDescriptor desc)
desc - The node descriptor.public List<org.alfresco.util.Pair<Integer,String>> getHeadPaths(AVMNodeDescriptor desc)
desc - The node descriptor.public List<String> getVersionPaths(VersionRoot version, AVMNode node)
version - The version root.node - The node to get the paths of.public List<org.alfresco.util.Pair<Integer,String>> getPathsInStoreHead(AVMNodeDescriptor desc, String store)
desc - The node descriptor.store - The name of the store.public LayeringDescriptor getLayeringInfo(int version, String path)
version - The version to look under.path - The full avm path.public org.alfresco.repo.avm.Lookup lookupDirectory(int version,
String path)
version - The version to look under.path - The path to lookup.public void makePrimary(String path)
path - The full path.public void retargetLayeredDirectory(String path, String target)
path - The full path to the layered directory.target - The new target path.public List<AVMNodeDescriptor> getHistory(AVMNodeDescriptor desc, int count)
desc - The node to get history of.count - The maximum number of ancestors to traverse. Negative means all.public void setOpacity(String path, boolean opacity)
path - The path to the layered directory.opacity - True is opaque; false is not.public void setNodeProperty(String path, org.alfresco.service.namespace.QName name, PropertyValue value)
path - The path to the node.name - The name of the property.value - The value of the property.public void setNodeProperties(String path, Map<org.alfresco.service.namespace.QName,PropertyValue> properties)
path - The path to the node.properties - The Map of QNames to PropertyValues.public PropertyValue getNodeProperty(int version, String path, org.alfresco.service.namespace.QName name)
version - The version to look under.path - The path to the node.name - The name of the property.public Map<org.alfresco.service.namespace.QName,PropertyValue> getNodeProperties(int version, String path)
version - The version to look under.path - The path to the node.public void deleteNodeProperty(String path, org.alfresco.service.namespace.QName name)
path - The path to the node.name - The name of the property.public void deleteNodeProperties(String path)
path - The path to the node.public void setStoreProperty(String store, org.alfresco.service.namespace.QName name, PropertyValue value)
store - The AVMStore.name - The QName.value - The PropertyValue to set.public void setStoreProperties(String store, Map<org.alfresco.service.namespace.QName,PropertyValue> props)
store - The AVMStore.props - The properties to set.public PropertyValue getStoreProperty(String store, org.alfresco.service.namespace.QName name)
store - The name of the store.name - The propertypublic Map<org.alfresco.service.namespace.QName,PropertyValue> queryStorePropertyKey(String store, org.alfresco.service.namespace.QName keyPattern)
store - The name of the store.keyPattern - The sql 'like' pattern, inserted into a QName.public Map<String,Map<org.alfresco.service.namespace.QName,PropertyValue>> queryStoresPropertyKeys(org.alfresco.service.namespace.QName keyPattern)
keyPattern - The sql 'like' pattern, inserted into a QName.public Map<org.alfresco.service.namespace.QName,PropertyValue> getStoreProperties(String store)
store - The name of the Store.public void deleteStoreProperty(String store, org.alfresco.service.namespace.QName name)
store - The name of the store.name - The name of the property.public AVMNodeDescriptor getCommonAncestor(AVMNodeDescriptor left, AVMNodeDescriptor right)
left - The first node.right - The second node.public org.alfresco.service.cmr.repository.ContentData getContentDataForRead(int version,
String path)
version - The version to look under.path - The path to the file.public org.alfresco.service.cmr.repository.ContentData getContentDataForWrite(String path)
path - The path to the file.public void setContentData(String path, org.alfresco.service.cmr.repository.ContentData data)
path - The path to the file.data - The content data to set.public static AVMRepository GetInstance()
public void setMetaDataFrom(String path, AVMNodeDescriptor from)
public void addAspect(String path, org.alfresco.service.namespace.QName aspectName)
path - The path to the node.aspectName - The name of the aspect.public Set<org.alfresco.service.namespace.QName> getAspects(int version, String path)
version - The version to look under.path - The path to the node.public void removeAspect(String path, org.alfresco.service.namespace.QName aspectName)
path - The path to the node.aspectName - The name of the aspect.public boolean hasAspect(int version,
String path,
org.alfresco.service.namespace.QName aspectName)
version - The version to look under.path - The path to the node.aspectName - The name of the aspect.public void setACL(String path, Acl acl)
path - The path to the node.acl - The ACL to set.public Acl getACL(int version, String path)
version - The version to look under.path - The path to the node.public void link(String parentPath, String name, AVMNodeDescriptor toLink)
parentPath - The path to the parent.name - The name to give the node.toLink - The node to link.public void updateLink(String parentPath, String name, AVMNodeDescriptor toLink)
parentPath - The path to the parent.name - The name to give the node.toLink - The node to link.public void link(AVMNodeDescriptor parent, String name, AVMNodeDescriptor child)
parent - The parent directory.name - The name to give the child.child - The child to link in.public void flatten(String path, String name)
path - The path to the layered directory.name - The name of the child.public AVMNodeDescriptor forceCopy(String path)
path - The path to force.public void renameStore(String sourceName, String destName)
sourceName - The original name.destName - The new name.AVMNotFoundExceptionAVMExistsExceptionpublic void revert(String path, String name, AVMNodeDescriptor toRevertTo)
path - The path to the parent directory.name - The name of the node.toRevertTo - The descriptor of the version to revert to.public void setGuid(String path, String guid)
path - guid - public void setEncoding(String path, String encoding)
path - encoding - public void setMimeType(String path, String mimeType)
path - encoding - public List<String> getPathsInStoreVersion(AVMNodeDescriptor desc, String store, int version)
public Map<org.alfresco.service.namespace.QName,PropertyValue> getNodeProperties(AVMNodeDescriptor desc)
public org.alfresco.service.cmr.repository.ContentData getContentDataForRead(AVMNodeDescriptor desc)
public Set<org.alfresco.service.namespace.QName> getAspects(AVMNodeDescriptor desc)
public boolean can(AVMStore store, AVMNode node, String permission, boolean isDirectlyContained)
store - node - permission - public void setStoreAcl(String storeName, Acl acl)
storeName - acl - public Acl getStoreAcl(String storeName)
storeName - public List<VersionDescriptor> getAVMStoreVersionsTo(String name, int version)
name - version - public List<VersionDescriptor> getAVMStoreVersionsFrom(String name, int version)
name - version - public List<VersionDescriptor> getAVMStoreVersionsBetween(String name, int startVersion, int endVersion)
name - startVersion - endVersion - Copyright © 2005–2014 Alfresco Software. All rights reserved.