org.apache.jackrabbit.webdav.simple
Class VersionResourceImpl

java.lang.Object
  extended by org.apache.jackrabbit.webdav.simple.DavResourceImpl
      extended by org.apache.jackrabbit.webdav.simple.DeltaVResourceImpl
          extended by org.apache.jackrabbit.webdav.simple.VersionResourceImpl
All Implemented Interfaces:
JcrConstants, BindableResource, DavResource, DeltaVResource, VersionResource

public class VersionResourceImpl
extends DeltaVResourceImpl
implements VersionResource

VersionResourceImpl represents a JCR version.

See Also:
Version

Field Summary
 
Fields inherited from class org.apache.jackrabbit.webdav.simple.DeltaVResourceImpl
supportedReports
 
Fields inherited from class org.apache.jackrabbit.webdav.simple.DavResourceImpl
COMPLIANCE_CLASSES, METHODS, properties, propsInitialized
 
Fields inherited from interface org.apache.jackrabbit.webdav.version.VersionResource
ACTIVITY_SET, CHECKIN_FORK, CHECKOUT_FORK, CHECKOUT_SET, LABEL_NAME_SET, METHODS, PREDECESSOR_SET, SUCCESSOR_SET, VERSION_CONTROLLED_BINDING_SET, VERSION_HISTORY, VERSION_NAME
 
Fields inherited from interface org.apache.jackrabbit.webdav.version.DeltaVResource
METHODS_INCL_MKWORKSPACE
 
Fields inherited from interface org.apache.jackrabbit.JcrConstants
JCR_AUTOCREATED, JCR_BASEVERSION, JCR_CHILD, JCR_CHILDNODEDEFINITION, JCR_CONTENT, JCR_CREATED, JCR_DATA, JCR_DEFAULTPRIMARYTYPE, JCR_DEFAULTVALUES, JCR_ENCODING, JCR_FROZENMIXINTYPES, JCR_FROZENNODE, JCR_FROZENPRIMARYTYPE, JCR_FROZENUUID, JCR_HASORDERABLECHILDNODES, JCR_ISCHECKEDOUT, JCR_ISMIXIN, JCR_LANGUAGE, JCR_LASTMODIFIED, JCR_LOCKISDEEP, JCR_LOCKOWNER, JCR_MANDATORY, JCR_MERGEFAILED, JCR_MIMETYPE, JCR_MIXINTYPES, JCR_MULTIPLE, JCR_NAME, JCR_NODETYPENAME, JCR_ONPARENTVERSION, JCR_PATH, JCR_PREDECESSORS, JCR_PRIMARYITEMNAME, JCR_PRIMARYTYPE, JCR_PROPERTYDEFINITION, JCR_PROTECTED, JCR_REQUIREDPRIMARYTYPES, JCR_REQUIREDTYPE, JCR_ROOTVERSION, JCR_SAMENAMESIBLINGS, JCR_SCORE, JCR_STATEMENT, JCR_SUCCESSORS, JCR_SUPERTYPES, JCR_SYSTEM, JCR_UUID, JCR_VALUECONSTRAINTS, JCR_VERSIONABLEUUID, JCR_VERSIONHISTORY, JCR_VERSIONLABELS, JCR_VERSIONSTORAGE, MIX_LOCKABLE, MIX_REFERENCEABLE, MIX_SHAREABLE, MIX_VERSIONABLE, NT_BASE, NT_CHILDNODEDEFINITION, NT_FILE, NT_FOLDER, NT_FROZENNODE, NT_HIERARCHYNODE, NT_LINKEDFILE, NT_NODETYPE, NT_PROPERTYDEFINITION, NT_QUERY, NT_RESOURCE, NT_UNSTRUCTURED, NT_VERSION, NT_VERSIONEDCHILD, NT_VERSIONHISTORY, NT_VERSIONLABELS
 
Constructor Summary
VersionResourceImpl(DavResourceLocator locator, DavResourceFactory factory, DavSession session, ResourceConfig config, Item item)
          Create a new DavResource.
 
Method Summary
 void addMember(DavResource member, InputContext inputContext)
          The version storage is read-only -> fails with 403.
 MultiStatusResponse alterProperties(List<? extends PropEntry> changeList)
          Version storage is read-only -> fails with 403.
 DavResourceIterator getMembers()
          Returns an iterator over all internal members.
 VersionHistoryResource getVersionHistory()
          Returns the VersionHistory associated with the repository version.
protected  void initProperties()
          Fill the property set for this resource.
protected  void initSupportedReports()
          Define the set of reports supported by this resource.
 boolean isCollection()
          Since this implementation of VersionResource never is a version belonging to a version controlled collection, this method always returns false not respecting the configuration.
 void label(LabelInfo labelInfo)
          Modify the labels defined for the underlying repository version.
 void removeMember(DavResource member)
          The version storage is read-only -> fails with 403.
 void removeProperty(DavPropertyName propertyName)
          Version storage is read-only -> fails with 403.
 void setProperty(DavProperty<?> property)
          Version storage is read-only -> fails with 403.
 
Methods inherited from class org.apache.jackrabbit.webdav.simple.DeltaVResourceImpl
addWorkspace, createResourceFromLocator, getComplianceClass, getHrefProperty, getLocatorFromNode, getLocatorFromNodePath, getOptionResponse, getReferenceResources, getReport
 
Methods inherited from class org.apache.jackrabbit.webdav.simple.DavResourceImpl
addLockManager, bind, copy, exists, getCollection, getDisplayName, getExportContext, getFactory, getHref, getImportContext, getLocator, getLock, getLocks, getModificationTime, getNode, getParentElements, getProperties, getProperty, getPropertyExportContext, getPropertyImportContext, getPropertyNames, getResourcePath, getSession, getSupportedMethods, hasLock, isLockable, lock, move, rebind, refreshLock, spool, unlock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.jackrabbit.webdav.version.DeltaVResource
addWorkspace, getOptionResponse, getReferenceResources, getReport
 
Methods inherited from interface org.apache.jackrabbit.webdav.DavResource
addLockManager, copy, exists, getCollection, getComplianceClass, getDisplayName, getFactory, getHref, getLocator, getLock, getLocks, getModificationTime, getProperties, getProperty, getPropertyNames, getResourcePath, getSession, getSupportedMethods, hasLock, isLockable, lock, move, refreshLock, spool, unlock
 

Constructor Detail

VersionResourceImpl

public VersionResourceImpl(DavResourceLocator locator,
                           DavResourceFactory factory,
                           DavSession session,
                           ResourceConfig config,
                           Item item)
                    throws DavException
Create a new DavResource.

Parameters:
locator -
factory -
session -
config -
item -
Throws:
DavException
Method Detail

isCollection

public boolean isCollection()
Since this implementation of VersionResource never is a version belonging to a version controlled collection, this method always returns false not respecting the configuration.

Specified by:
isCollection in interface DavResource
Overrides:
isCollection in class DavResourceImpl
Returns:
always false
See Also:
DavResource.isCollection()

getMembers

public DavResourceIterator getMembers()
Description copied from interface: DavResource
Returns an iterator over all internal members.

Specified by:
getMembers in interface DavResource
Overrides:
getMembers in class DavResourceImpl
Returns:
An empty DavResourceIterator
See Also:
DavResource.getMembers()

addMember

public void addMember(DavResource member,
                      InputContext inputContext)
               throws DavException
The version storage is read-only -> fails with 403.

Specified by:
addMember in interface DavResource
Overrides:
addMember in class DavResourceImpl
Parameters:
member - DavResource to be added as internal member.
inputContext - Context providing the properties and content for the internal member to be created or replaced.
Throws:
DavException
See Also:
DavResource.addMember(DavResource, InputContext)

removeMember

public void removeMember(DavResource member)
                  throws DavException
The version storage is read-only -> fails with 403.

Specified by:
removeMember in interface DavResource
Overrides:
removeMember in class DavResourceImpl
Throws:
DavException
See Also:
DavResource.removeMember(DavResource)

setProperty

public void setProperty(DavProperty<?> property)
                 throws DavException
Version storage is read-only -> fails with 403.

Specified by:
setProperty in interface DavResource
Overrides:
setProperty in class DavResourceImpl
Throws:
DavException - if an error occurs
See Also:
DavResource.setProperty(DavProperty)

removeProperty

public void removeProperty(DavPropertyName propertyName)
                    throws DavException
Version storage is read-only -> fails with 403.

Specified by:
removeProperty in interface DavResource
Overrides:
removeProperty in class DavResourceImpl
Throws:
DavException - if an error occurs
See Also:
DavResource.removeProperty(DavPropertyName)

alterProperties

public MultiStatusResponse alterProperties(List<? extends PropEntry> changeList)
                                    throws DavException
Version storage is read-only -> fails with 403.

Specified by:
alterProperties in interface DavResource
Overrides:
alterProperties in class DavResourceImpl
Parameters:
changeList - list containing DavPropertyName objects (for properties to be removed) and DavProperty objects (for properties to be added/set).
Returns:
multistatus response listing the status resulting from setting and/or removing the specified properties, in order to allow a detailed multistatus response.
Throws:
DavException - if an error occurred. This may be the case if the general state of the resource prevents any properties to be set or removed (e.g. due to a lock).
See Also:
DavResource.alterProperties(List)

label

public void label(LabelInfo labelInfo)
           throws DavException
Modify the labels defined for the underlying repository version.

Specified by:
label in interface VersionResource
Parameters:
labelInfo -
Throws:
DavException
See Also:
VersionResource.label(org.apache.jackrabbit.webdav.version.LabelInfo), VersionHistory.addVersionLabel(String, String, boolean), VersionHistory.removeVersionLabel(String)

getVersionHistory

public VersionHistoryResource getVersionHistory()
                                         throws DavException
Returns the VersionHistory associated with the repository version. Note: in contrast to a versionable node, the version history of a version item is always represented by its nearest ancestor.

Specified by:
getVersionHistory in interface VersionResource
Returns:
the VersionHistoryResource associated with this resource.
Throws:
DavException
See Also:
VersionResource.getVersionHistory(), Item.getParent()

initSupportedReports

protected void initSupportedReports()
Define the set of reports supported by this resource.

Overrides:
initSupportedReports in class DeltaVResourceImpl
See Also:
SupportedReportSetProperty

initProperties

protected void initProperties()
Fill the property set for this resource.

Overrides:
initProperties in class DeltaVResourceImpl


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.