|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.alfresco.repo.avm.AVMStoreImpl
public class AVMStoreImpl
A Repository contains a current root directory and a list of root versions. Each root version corresponds to a separate snapshot operation.
Constructor Summary | |
---|---|
AVMStoreImpl()
Default constructor. |
|
AVMStoreImpl(AVMRepository repo,
java.lang.String name)
Make a brand new AVMStore. |
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)
Snapshot 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. |
boolean |
equals(java.lang.Object obj)
Equals override. |
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 on a file 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)
Get the effective indirection path for a layered node. |
java.io.InputStream |
getInputStream(int version,
java.lang.String path)
Get an input stream 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 from a 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 AVMStore. |
int |
getNextVersionID()
Get the next version id. |
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 store. |
PropertyValue |
getProperty(org.alfresco.service.namespace.QName name)
Get a property by name. |
DirectoryNode |
getRoot()
Get the root directory. |
AVMNodeDescriptor |
getRoot(int version)
Get the root node descriptor. |
Acl |
getStoreAcl()
Get the Acl associated with this store. |
long |
getVers()
Get the version (for concurrency control). |
java.util.List |
getVersions()
Get the set of all extant versions for this AVMStore. |
java.util.List |
getVersions(java.util.Date from,
java.util.Date to)
Get the versions between the given dates (inclusive). |
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. |
int |
hashCode()
Get a hash code. |
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 up a path. |
org.alfresco.repo.avm.Lookup |
lookupDirectory(int version,
java.lang.String path,
boolean write)
Lookup a node and insist that it is a directory. |
void |
makePrimary(java.lang.String path)
Make the indicated node a primary indirection. |
void |
purgeVersion(int version)
Purge all nodes reachable only via this version and repository. |
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 everything underneath it. |
void |
retargetLayeredDirectory(java.lang.String path,
java.lang.String target)
Change the indirection 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 |
setId(long id)
Set the primary key |
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 this AVMStore. |
void |
setNewRoot(DirectoryNode root)
Set a new root for this. |
void |
setNextVersionID(int nextVersionID)
Set the next version id. |
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 |
setRoot(DirectoryNode root)
Set the root directory. |
void |
setStoreAcl(Acl acl)
Set the acl on this store. |
void |
setVers(long vers)
Set the version (for concurrency control). |
java.lang.String |
toString()
|
void |
uncover(java.lang.String dirPath,
java.lang.String name)
Allow a name which has been deleted to be visible through that layer. |
void |
updateLink(java.lang.String parentPath,
java.lang.String name,
AVMNodeDescriptor toLink)
Update a link to a node in a directory, directly. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AVMStoreImpl()
public AVMStoreImpl(AVMRepository repo, java.lang.String name)
repo
- The AVMRepository.name
- The name of the AVMStore.Method Detail |
---|
public void setId(long id)
id
- The primary key.public long getId()
getId
in interface AVMStore
public void setNewRoot(DirectoryNode root)
setNewRoot
in interface AVMStore
root
- public java.util.Map createSnapshot(java.lang.String tag, java.lang.String description, java.util.Map snapShotMap)
createSnapshot
in interface AVMStore
tag
- The short description.snapShotMap
- Keeps track of snapshot ids for all stores that
end up snapshotted, possibly recursively.
public void createDirectory(java.lang.String path, java.lang.String name, java.util.List aspects, java.util.Map properties)
createDirectory
in interface AVMStore
path
- The path to the containing directory.name
- The name of the new directory.public void createLayeredDirectory(java.lang.String srcPath, java.lang.String dstPath, java.lang.String name)
createLayeredDirectory
in interface AVMStore
srcPath
- The target indirection for a layered node.dstPath
- The containing directory for the new node.name
- The name of the new node.public java.io.OutputStream createFile(java.lang.String path, java.lang.String name)
createFile
in interface AVMStore
path
- The path to the directory to contain the new file.name
- The name to give the new file.
initial content.
public void createFile(java.lang.String path, java.lang.String name, java.io.File data, java.util.List aspects, java.util.Map properties)
createFile
in interface AVMStore
path
- The path to the containing directory.name
- The name to give the new file.data
- The contents.public void createLayeredFile(java.lang.String srcPath, java.lang.String dstPath, java.lang.String name)
createLayeredFile
in interface AVMStore
srcPath
- The target indirection for the layered file.dstPath
- The path to the directory to contain the new file.name
- The name of the new file.public java.io.InputStream getInputStream(int version, java.lang.String path)
getInputStream
in interface AVMStore
version
- The version id to look under.path
- The path to the file.
public org.alfresco.service.cmr.repository.ContentReader getContentReader(int version, java.lang.String path)
getContentReader
in interface AVMStore
version
- The version to look under.path
- The path to the file.
public org.alfresco.service.cmr.repository.ContentWriter createContentWriter(java.lang.String path, boolean update)
createContentWriter
in interface AVMStore
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 java.util.SortedMap getListing(int version, java.lang.String path, boolean includeDeleted)
getListing
in interface AVMStore
version
- The version to look under.path
- The path to the directory.includeDeleted
- Whether to see Deleted nodes.
public java.util.SortedMap getListingDirect(int version, java.lang.String path, boolean includeDeleted)
getListingDirect
in interface AVMStore
version
- The version to look under.path
- The path to the directory.includeDeleted
- Whether to see Deleted nodes.
public java.util.List getDeleted(int version, java.lang.String path)
getDeleted
in interface AVMStore
version
- The version to look under.path
- The path to the directory.
public java.io.OutputStream getOutputStream(java.lang.String path)
getOutputStream
in interface AVMStore
path
- The path to the file.
public void removeNode(java.lang.String path, java.lang.String name)
removeNode
in interface AVMStore
path
- The path to the containing directory.name
- The name of the node to remove.public void uncover(java.lang.String dirPath, java.lang.String name)
uncover
in interface AVMStore
dirPath
- The path to the containing directory.name
- The name to uncover.public java.util.List getVersions()
getVersions
in interface AVMStore
public java.util.List getVersions(java.util.Date from, java.util.Date to)
getVersions
in interface AVMStore
from
- The earliest date.to
- The latest date.
public java.util.List getVersionsTo(int version)
AVMStore
getVersionsTo
in interface AVMStore
version
- - the version to start from
public java.util.List getVersionsFrom(int version)
AVMStore
getVersionsFrom
in interface AVMStore
version
- - the version which which to end
public java.util.List getVersionsBetween(int startVersion, int endVersion)
AVMStore
getVersionsBetween
in interface AVMStore
public AVMRepository getAVMRepository()
getAVMRepository
in interface AVMStore
public org.alfresco.repo.avm.Lookup lookup(int version, java.lang.String path, boolean write, boolean includeDeleted)
lookup
in interface AVMStore
version
- The version to look in.path
- The path to look up.write
- Whether this is in the context of a write.includeDeleted
- Whether to see Deleted nodes.
public AVMNodeDescriptor getRoot(int version)
getRoot
in interface AVMStore
version
- The version to get.
public org.alfresco.repo.avm.Lookup lookupDirectory(int version, java.lang.String path, boolean write)
lookupDirectory
in interface AVMStore
version
- The version to look under.path
- The path to the directory.write
- Whether this is in a write context.
public java.lang.String getIndirectionPath(int version, java.lang.String path)
getIndirectionPath
in interface AVMStore
version
- The version to look under.path
- The path to the node.
public void makePrimary(java.lang.String path)
makePrimary
in interface AVMStore
path
- The path to the node.public void retargetLayeredDirectory(java.lang.String path, java.lang.String target)
retargetLayeredDirectory
in interface AVMStore
path
- The path to the layered directory.target
- The target indirection to set.public void setName(java.lang.String name)
setName
in interface AVMStore
name
- public java.lang.String getName()
getName
in interface AVMStore
public Acl getStoreAcl()
AVMStore
getStoreAcl
in interface AVMStore
public void setStoreAcl(Acl acl)
AVMStore
setStoreAcl
in interface AVMStore
public void setNextVersionID(int nextVersionID)
nextVersionID
- public int getNextVersionID()
getNextVersionID
in interface AVMStore
public int getLastVersionID()
getLastVersionID
in interface AVMStore
public void setRoot(DirectoryNode root)
root
- public DirectoryNode getRoot()
getRoot
in interface AVMStore
public void setVers(long vers)
vers
- The version for optimistic locks.public long getVers()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
-
public int hashCode()
hashCode
in class java.lang.Object
public void purgeVersion(int version)
purgeVersion
in interface AVMStore
version
- public AVMStoreDescriptor getDescriptor()
getDescriptor
in interface AVMStore
public void setOpacity(java.lang.String path, boolean opacity)
setOpacity
in interface AVMStore
path
- The path to the layered directory.opacity
- True is opaque; false is not.public void setNodeProperty(java.lang.String path, org.alfresco.service.namespace.QName name, PropertyValue value)
setNodeProperty
in interface AVMStore
path
- The path to the node.name
- The name of the property.value
- The value to set.public void setNodeProperties(java.lang.String path, java.util.Map properties)
setNodeProperties
in interface AVMStore
path
- The path to the node.properties
- The Map of QNames to PropertyValues.public PropertyValue getNodeProperty(int version, java.lang.String path, org.alfresco.service.namespace.QName name)
getNodeProperty
in interface AVMStore
version
- The version to lookup.path
- The path to the node.name
- The name of the property.
public java.util.Map getNodeProperties(int version, java.lang.String path)
getNodeProperties
in interface AVMStore
version
- The version to lookup.path
- The path to the node.
public void deleteNodeProperty(java.lang.String path, org.alfresco.service.namespace.QName name)
deleteNodeProperty
in interface AVMStore
path
- The path to the node.name
- The name of the property.public void deleteNodeProperties(java.lang.String path)
deleteNodeProperties
in interface AVMStore
path
- The path to the node.public void setProperty(org.alfresco.service.namespace.QName name, PropertyValue value)
setProperty
in interface AVMStore
name
- The QName of the property.value
- The actual PropertyValue.public void setProperties(java.util.Map properties)
setProperties
in interface AVMStore
properties
- A Map of QNames to PropertyValues to set.public PropertyValue getProperty(org.alfresco.service.namespace.QName name)
getProperty
in interface AVMStore
name
- The QName of the property to fetch.
public java.util.Map getProperties()
getProperties
in interface AVMStore
public void deleteProperty(org.alfresco.service.namespace.QName name)
deleteProperty
in interface AVMStore
name
- The name of the property to delete.public org.alfresco.service.cmr.repository.ContentData getContentDataForRead(int version, java.lang.String path)
getContentDataForRead
in interface AVMStore
version
- The version to look under.path
- The path to the file.
public org.alfresco.service.cmr.repository.ContentData getContentDataForWrite(java.lang.String path)
getContentDataForWrite
in interface AVMStore
path
- The path to the file.
public void setContentData(java.lang.String path, org.alfresco.service.cmr.repository.ContentData data)
setContentData
in interface AVMStore
path
- The path to the file.data
- The ContentData to set.public void setMetaDataFrom(java.lang.String path, AVMNode from)
setMetaDataFrom
in interface AVMStore
path
- The path to the node to set metadata on.from
- The node to get the metadata from.public void addAspect(java.lang.String path, org.alfresco.service.namespace.QName aspectName)
addAspect
in interface AVMStore
path
- The path to the node.aspectName
- The name of the aspect.public java.util.Set getAspects(int version, java.lang.String path)
getAspects
in interface AVMStore
version
- The version to look under.path
- The path to the node.
public void removeAspect(java.lang.String path, org.alfresco.service.namespace.QName aspectName)
removeAspect
in interface AVMStore
path
- The path to the node.aspectName
- The name of the aspect.public boolean hasAspect(int version, java.lang.String path, org.alfresco.service.namespace.QName aspectName)
hasAspect
in interface AVMStore
version
- The version to look under.path
- The path to the node.aspectName
- The name of the aspect.
public void setACL(java.lang.String path, Acl acl)
setACL
in interface AVMStore
path
- The path to the node.acl
- The ACL to set.public Acl getACL(int version, java.lang.String path)
getACL
in interface AVMStore
version
- The version to look under.path
- The path to the node.
public void link(java.lang.String parentPath, java.lang.String name, AVMNodeDescriptor toLink)
link
in interface AVMStore
parentPath
- The path to the directory.name
- The name to give the parent.toLink
- The node to link.public void updateLink(java.lang.String parentPath, java.lang.String name, AVMNodeDescriptor toLink)
updateLink
in interface AVMStore
parentPath
- The path to the directory.name
- The name to give the parent.toLink
- The node to link.public void revert(java.lang.String path, java.lang.String name, AVMNodeDescriptor toRevertTo)
revert
in interface AVMStore
path
- The path to the parent directory.name
- The name of the node to revert.toRevertTo
- The descriptor of the version to revert to.public void setGuid(java.lang.String path, java.lang.String guid)
AVMStore
setGuid
in interface AVMStore
public void setEncoding(java.lang.String path, java.lang.String encoding)
AVMStore
setEncoding
in interface AVMStore
public void setMimeType(java.lang.String path, java.lang.String mimeType)
AVMStore
setMimeType
in interface AVMStore
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |