|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jackrabbit.webdav.jcr.DefaultItemResource
public class DefaultItemResource
DefaultItemResource represents JCR property item.
Property| Field Summary | |
|---|---|
protected boolean |
initedProps
|
protected javax.jcr.Item |
item
|
protected DavPropertySet |
properties
|
protected SupportedLock |
supportedLock
|
protected SupportedReportSetProperty |
supportedReports
|
| Fields inherited from interface org.apache.jackrabbit.webdav.observation.ObservationResource |
|---|
METHODS |
| Fields inherited from interface org.apache.jackrabbit.webdav.transaction.TransactionResource |
|---|
METHODS |
| Fields inherited from interface org.apache.jackrabbit.webdav.version.DeltaVResource |
|---|
METHODS, METHODS_INCL_MKWORKSPACE |
| Fields inherited from interface org.apache.jackrabbit.webdav.search.SearchResource |
|---|
METHODS |
| Constructor Summary | |
|---|---|
DefaultItemResource(DavResourceLocator locator,
JcrDavSession session,
DavResourceFactory factory,
javax.jcr.Item item)
Create a new DefaultItemResource. |
|
| Method Summary | |
|---|---|
void |
addLockManager(LockManager lockMgr)
Add an external LockManager to this resource. |
void |
addMember(DavResource resource,
InputContext inputContext)
Method is not allowed. |
void |
addWorkspace(DavResource workspace)
The JCR api does not provide methods to create new workspaces. |
MultiStatusResponse |
alterProperties(DavPropertySet setProperties,
DavPropertyNameSet removePropertyNames)
Builds a single List from the properties to set and the properties to remove and delegates the list to AbstractResource.alterProperties(List); |
MultiStatusResponse |
alterProperties(java.util.List changeList)
Loops over the given List and alters the properties accordingly. |
void |
copy(DavResource destination,
boolean shallow)
Copies the underlying repository item to the indicated destination. |
protected DavResource |
createResourceFromLocator(DavResourceLocator loc)
Create a new DavResource from the given locator. |
boolean |
exists()
Returns true if there exists a repository item with the given
resource path, false otherwise. |
DavResource |
getCollection()
Returns the resource representing the parent item of the repository item represented by this resource. |
java.lang.String |
getComplianceClass()
Returns a string listing the compliance classes for this resource as it is required for the DAV response header. |
java.lang.String |
getDisplayName()
Retrieves the last segment of the item path (or the resource path if this resource does not exist). |
DavResourceFactory |
getFactory()
Return the DavResourceFactory that created this resource. |
java.lang.String |
getHref()
Returns the absolute href of this resource as returned in the multistatus response body. |
protected static java.lang.String |
getItemName(java.lang.String itemPath)
Retrieves the last segment of the given path and removes the index if present. |
DavResourceLocator |
getLocator()
Returns the locator object for this webdav resource,
which encapsulates the information for building the complete 'href'. |
protected DavResourceLocator |
getLocatorFromItem(javax.jcr.Item repositoryItem)
Build a new DavResourceLocator from the given repository item. |
protected DavResourceLocator |
getLocatorFromItemPath(java.lang.String itemPath)
Build a DavResourceLocator from the given itemPath path. |
ActiveLock |
getLock(Type type,
Scope scope)
JCR properties are locked if their
parent node is locked; thus this method will always return the
lock object from the collection this resource is
internal member of. |
ActiveLock[] |
getLocks()
Returns an array of all locks applied to the given resource. |
DavResourceIterator |
getMembers()
Always returns an empty iterator for a non-collection resource might not have internal members. |
long |
getModificationTime()
Always returns 'now' |
OptionsResponse |
getOptionResponse(OptionsInfo optionsInfo)
Retrieves the information requested in the OPTIONS request body and returns the corresponding values. |
DavPropertySet |
getProperties()
Returns all webdav properties present on this resource. |
DavProperty |
getProperty(DavPropertyName name)
Return the webdav property with the specified name. |
DavPropertyName[] |
getPropertyNames()
Returns an array of all property names available
on this resource. |
QueryGrammerSet |
getQueryGrammerSet()
Returns the protected DAV:supported-method-set property which is defined mandatory by RTF 3253. |
DavResource[] |
getReferenceResources(DavPropertyName hrefPropertyName)
Return an array of DavResource objects that are referenced
by the property with the specified name. |
Report |
getReport(ReportInfo reportInfo)
Runs the report specified by the given ReportInfo. |
protected javax.jcr.Session |
getRepositorySession()
Shortcut for getSession().getRepositorySession() |
java.lang.String |
getResourcePath()
Returns the path of the underlying repository item or the item to be created (PUT/MKCOL). |
DavSession |
getSession()
Retrieve the DavSession associated with this resource. |
java.lang.String |
getSupportedMethods()
Returns a comma separated list of all METHODS supported by the given resource. |
java.lang.String |
getTransactionId()
The TransactionId or null according to the value of the
corresponding request header
field. |
protected java.lang.String |
getWorkspaceHref()
Retrieve the href of the workspace the current session belongs to. |
boolean |
hasLock(Type type,
Scope scope)
Returns true if this resource has a lock applied with the given type and scope. |
void |
init(SubscriptionManager subsMgr)
Initializes this resource. |
void |
init(TxLockManager txMgr,
java.lang.String transactionId)
Initializes the TransactionResource. |
protected void |
initLockSupport()
Initialize the SupportedLock property
with entries that are valid for any type item resources. |
protected void |
initProperties()
Add resource specific properties. |
protected void |
initSupportedReports()
Define the set of reports supported by this resource. |
boolean |
isCollection()
Returns false. |
boolean |
isLockable(Type type,
Scope scope)
Returns true, if the SupportedLock property contains an entry
with the given type and scope. |
ActiveLock |
lock(LockInfo reqLockInfo)
Lock this webdav resource with the information retrieve from the request and return the resulting lockdiscovery object. |
void |
move(DavResource destination)
Moves the underlying repository item to the indicated destination. |
EventDiscovery |
poll(java.lang.String subscriptionId,
long timeout)
Retrieve the list of events that where recorded for the event listener with the given SubscriptionId. |
ActiveLock |
refreshLock(LockInfo info,
java.lang.String lockToken)
Only transaction lock may be available on this resource. |
void |
removeMember(DavResource member)
Method is not allowed. |
void |
removeProperty(DavPropertyName propertyName)
Removing properties is not allowed, for a single-value JCR-property without a value does not exist. |
MultiStatus |
search(SearchInfo sInfo)
Runs a search with the language and query defined in the SearchInfo
object specified and returns a MultiStatus object listing the
results. |
void |
setProperty(DavProperty property)
Sets the given property. |
void |
spool(OutputContext outputContext)
In case an underlying repository property exists the following
logic is applyed to spool the property content:
Property is not multi valued: Return the stream representation of the property value.
Property is multivalue: Return the xml representation of the values.
|
Subscription |
subscribe(SubscriptionInfo info,
java.lang.String subscriptionId)
Subscribe this resource for event listening defined by the specified subscription info. |
void |
unlock(java.lang.String lockToken)
Throws HttpServletResponse.SC_METHOD_NOT_ALLOWED since only transaction
locks may be present on this resource, that need to be released by calling
TransactionResource.unlock(String, org.apache.jackrabbit.webdav.transaction.TransactionInfo). |
void |
unlock(java.lang.String lockToken,
TransactionInfo tInfo)
Overloads the unlock method of the DavResource
interface. |
void |
unsubscribe(java.lang.String subscriptionId)
Unsubscribe the event listener with the given SubscriptionId. |
| 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.DavResource |
|---|
addLockManager, alterProperties, getFactory, getHref, getLocator, getLocks, getProperties, getProperty, getPropertyNames, getResourcePath, getSession, hasLock, isLockable, lock, refreshLock, unlock |
| Field Detail |
|---|
protected final javax.jcr.Item item
protected boolean initedProps
protected DavPropertySet properties
protected SupportedLock supportedLock
protected SupportedReportSetProperty supportedReports
| Constructor Detail |
|---|
public DefaultItemResource(DavResourceLocator locator,
JcrDavSession session,
DavResourceFactory factory,
javax.jcr.Item item)
DefaultItemResource.
locator - session - | Method Detail |
|---|
public boolean isCollection()
DavResource.isCollection()public long getModificationTime()
DavResource.getModificationTime()
public void spool(OutputContext outputContext)
throws java.io.IOException
property exists the following
logic is applyed to spool the property content:
stream representation of the property value.
spool in interface DavResourceoutputContext -
java.io.IOExceptionDavResource.spool(OutputContext)
public void setProperty(DavProperty property)
throws DavException
ItemResourceConstants.JCR_VALUE and ItemResourceConstants.JCR_VALUES
are the only resource properties that are allowed to be modified. Any other
property is read-only and will throw an exception ('Conflict').
setProperty in interface DavResourceproperty -
DavExceptionDavResource.setProperty(org.apache.jackrabbit.webdav.property.DavProperty)
public void removeProperty(DavPropertyName propertyName)
throws DavException
values array
may be specified with by setting the 'values' webdav property.
removeProperty in interface DavResourcepropertyName -
DavExceptionDavResource.removeProperty(org.apache.jackrabbit.webdav.property.DavPropertyName)
public MultiStatusResponse alterProperties(java.util.List changeList)
throws DavException
List and alters the properties accordingly.
Changes are persisted at the end only according to the rules defined with
the complete() method.Please note: since there is only a single property than can be set from a client (i.e. jcr:value OR jcr:values) this method either succeeds or throws an exception, even if this violates RFC 2518.
alterProperties in interface DavResourcechangeList -
DavExceptionDavResource.alterProperties(List)
public void addMember(DavResource resource,
InputContext inputContext)
throws DavException
resource - DavResource to be added as internal member.inputContext - Context providing the properties and content for the
internal member to be created or replaced.
DavExceptionDavResource.addMember(org.apache.jackrabbit.webdav.DavResource, InputContext)public DavResourceIterator getMembers()
DavResource.getMembers()
public void removeMember(DavResource member)
throws DavException
DavExceptionDavResource.removeMember(DavResource)
public ActiveLock getLock(Type type,
Scope scope)
JCR properties are locked if their
parent node is locked; thus this method will always return the
lock object from the collection this resource is
internal member of.
getLock in interface DavResourcetype - scope -
null if this resource
has no lock.DavResource.getLock(Type, Scope)protected void initProperties()
public java.lang.String getComplianceClass()
getComplianceClass in interface DavResourceDavResource.getComplianceClass()public java.lang.String getSupportedMethods()
DavResource
getSupportedMethods in interface DavResourceDavResource.getSupportedMethods()public boolean exists()
repository item with the given
resource path, false otherwise.
exists in interface DavResourceDavResource.exists()public java.lang.String getDisplayName()
item name
which is exposed with the {http://www.day.com/jcr/webdav/1.0}name property.
getDisplayName in interface DavResourceDavResource.getDisplayName()public DavResource getCollection()
RootCollection is returned.
getCollection in interface DavResourceDavResource.getCollection()
public void move(DavResource destination)
throws DavException
move in interface DavResourcedestination -
DavExceptionDavResource.move(DavResource),
Session.move(String, String)
public void copy(DavResource destination,
boolean shallow)
throws DavException
Workspace.copy(String, String, String) is used to perform
the copy operation, Workspace.copy(String, String) otherwise.
Note, that this implementation does not support shallow copy.
copy in interface DavResourcedestination - shallow -
DavExceptionDavResource.copy(DavResource, boolean),
Workspace.copy(String, String),
Workspace.copy(String, String, String)public void init(SubscriptionManager subsMgr)
ObservationResource
init in interface ObservationResourcesubsMgr - subscription manager objectObservationResource.init(SubscriptionManager)
public Subscription subscribe(SubscriptionInfo info,
java.lang.String subscriptionId)
throws DavException
ObservationResource
subscribe in interface ObservationResourceinfo - SubscriptionInfo object as defined by the
request body and headers.subscriptionId - or null if the
SubscriptionId header
is missing.
Subscription object in case the subscription was
successful.
DavExceptionObservationResource.subscribe(org.apache.jackrabbit.webdav.observation.SubscriptionInfo, String),
SubscriptionManager.subscribe(org.apache.jackrabbit.webdav.observation.SubscriptionInfo, String, org.apache.jackrabbit.webdav.observation.ObservationResource)
public void unsubscribe(java.lang.String subscriptionId)
throws DavException
ObservationResource
unsubscribe in interface ObservationResourcesubscriptionId - as present in the SubscriptionId header.
DavExceptionObservationResource.unsubscribe(String),
SubscriptionManager.unsubscribe(String, org.apache.jackrabbit.webdav.observation.ObservationResource)
public EventDiscovery poll(java.lang.String subscriptionId,
long timeout)
throws DavException
ObservationResource
poll in interface ObservationResourcesubscriptionId - as present in the
SubscriptionId header.timeout - as present in the
ObservationConstants.HEADER_POLL_TIMEOUT header or 0 (zero) if
none is present.
EventDiscovery object
DavExceptionObservationResource.poll(String, long),
SubscriptionManager.poll(String, long, org.apache.jackrabbit.webdav.observation.ObservationResource)protected void initLockSupport()
SupportedLock property
with entries that are valid for any type item resources.
SupportedLock,
TxLockEntry,
AbstractResource.initLockSupport()protected java.lang.String getWorkspaceHref()
null if this resource
does not represent a repository item.AbstractResource.getWorkspaceHref()protected static java.lang.String getItemName(java.lang.String itemPath)
itemPath -
public DavResourceLocator getLocator()
DavResourcelocator object for this webdav resource,
which encapsulates the information for building the complete 'href'.
getLocator in interface DavResourceDavResource.getLocator()public java.lang.String getResourcePath()
null is returned.
getResourcePath in interface DavResourceDavResource.getResourcePath(),
DavResourceLocator.getResourcePath()public java.lang.String getHref()
DavResource
getHref in interface DavResourceDavResource.getHref(),
DavResourceLocator.getHref(boolean)public DavPropertyName[] getPropertyNames()
DavResourceproperty names available
on this resource.
getPropertyNames in interface DavResourceDavResource.getPropertyNames()public DavProperty getProperty(DavPropertyName name)
DavResource
getProperty in interface DavResourcename - name of the webdav property
DavProperty with the given name or null
if the property does not exist.DavResource.getProperty(org.apache.jackrabbit.webdav.property.DavPropertyName)public DavPropertySet getProperties()
DavResource
getProperties in interface DavResourceDavPropertySet containing all webdav property
of this resource.DavResource.getProperties()
public MultiStatusResponse alterProperties(DavPropertySet setProperties,
DavPropertyNameSet removePropertyNames)
throws DavException
AbstractResource.alterProperties(List);
alterProperties in interface DavResourcesetProperties - Set of properties to be added or modifiedremovePropertyNames - Set of property names to be removed
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).DavResource.alterProperties(org.apache.jackrabbit.webdav.property.DavPropertySet, org.apache.jackrabbit.webdav.property.DavPropertyNameSet)
public boolean isLockable(Type type,
Scope scope)
SupportedLock property contains an entry
with the given type and scope. By default resources allow for transaction lock only.
isLockable in interface DavResourcetype - scope -
DavResource.isLockable(org.apache.jackrabbit.webdav.lock.Type, org.apache.jackrabbit.webdav.lock.Scope)
public boolean hasLock(Type type,
Scope scope)
hasLock in interface DavResourcetype - scope -
DavResource.hasLock(Type, Scope)public ActiveLock[] getLocks()
DavResource
getLocks in interface DavResourcetodo improve....
public ActiveLock lock(LockInfo reqLockInfo)
throws DavException
DavResource
lock in interface DavResourcereqLockInfo - lock info as retrieved from the request.
DavException is thrown.
DavException - if the lock could not be obtained.DavResource.lock(org.apache.jackrabbit.webdav.lock.LockInfo)
public ActiveLock refreshLock(LockInfo info,
java.lang.String lockToken)
throws DavException
refreshLock in interface DavResourceinfo - lockToken -
DavException is thrown.
DavExceptionDavResource.refreshLock(org.apache.jackrabbit.webdav.lock.LockInfo, String)
public void unlock(java.lang.String lockToken)
throws DavException
HttpServletResponse.SC_METHOD_NOT_ALLOWED since only transaction
locks may be present on this resource, that need to be released by calling
TransactionResource.unlock(String, org.apache.jackrabbit.webdav.transaction.TransactionInfo).
unlock in interface DavResourcelockToken -
DavException - Always throws HttpServletResponse.SC_METHOD_NOT_ALLOWEDpublic void addLockManager(LockManager lockMgr)
DavResourceLockManager to this resource. This method may
throw UnsupportedOperationException if the resource does handle
locking itself.
addLockManager in interface DavResourceDavResource.addLockManager(org.apache.jackrabbit.webdav.lock.LockManager)public DavResourceFactory getFactory()
DavResourceDavResourceFactory that created this resource.
getFactory in interface DavResourceDavResource.getFactory()public DavSession getSession()
DavResourceDavSession associated with this resource.
getSession in interface DavResourceDavResource.getSession(),
DavResource.getSession()
public void init(TxLockManager txMgr,
java.lang.String transactionId)
TransactionResourceTransactionResource.
init in interface TransactionResourceTransactionResource.init(TxLockManager, String)
public void unlock(java.lang.String lockToken,
TransactionInfo tInfo)
throws DavException
TransactionResourceunlock method of the DavResource
interface.
unlock in interface TransactionResourcelockToken - lock token as present in the request header.tInfo - transaction info object as present in the UNLOCK request body.
DavException - if an error occursTransactionResource.unlock(String, org.apache.jackrabbit.webdav.transaction.TransactionInfo)public java.lang.String getTransactionId()
TransactionResourcenull according to the value of the
corresponding request header
field.
getTransactionId in interface TransactionResourcenullTransactionResource.getTransactionId()public OptionsResponse getOptionResponse(OptionsInfo optionsInfo)
DeltaVResource
getOptionResponse in interface DeltaVResourceoptionsInfo -
nullDeltaVResource.getOptionResponse(org.apache.jackrabbit.webdav.version.OptionsInfo)
public Report getReport(ReportInfo reportInfo)
throws DavException
DeltaVResourceReportInfo.
getReport in interface DeltaVResourcereportInfo -
DavExceptionDeltaVResource.getReport(org.apache.jackrabbit.webdav.version.report.ReportInfo)
public void addWorkspace(DavResource workspace)
throws DavException
addWorkspace on this resource will always fail.
addWorkspace in interface DeltaVResourceworkspace -
DavException - Always throws.DeltaVResource.addWorkspace(org.apache.jackrabbit.webdav.DavResource)
public DavResource[] getReferenceResources(DavPropertyName hrefPropertyName)
throws DavException
DavResource objects that are referenced
by the property with the specified name.
getReferenceResources in interface DeltaVResourcehrefPropertyName -
DavResources
DavExceptionDeltaVResource.getReferenceResources(org.apache.jackrabbit.webdav.property.DavPropertyName)public QueryGrammerSet getQueryGrammerSet()
SearchResourceDavResource.getProperty(SearchConstants.QUERY_GRAMMER_SET).
getQueryGrammerSet in interface SearchResourceSearchResource.getQueryGrammerSet()
public MultiStatus search(SearchInfo sInfo)
throws DavException
SearchResourceSearchInfo
object specified and returns a MultiStatus object listing the
results.
search in interface SearchResourcesInfo -
DavExceptionSearchResource.search(org.apache.jackrabbit.webdav.search.SearchInfo)
protected DavResource createResourceFromLocator(DavResourceLocator loc)
throws DavException
DavResource from the given locator.
loc -
DavResource
DavExceptionprotected DavResourceLocator getLocatorFromItemPath(java.lang.String itemPath)
DavResourceLocator from the given itemPath path.
itemPath -
DavResourceLocatorDavLocatorFactory.createResourceLocator(String, String, String)protected DavResourceLocator getLocatorFromItem(javax.jcr.Item repositoryItem)
DavResourceLocator from the given repository item.
repositoryItem -
getLocatorFromItemPath(String)protected javax.jcr.Session getRepositorySession()
getSession().getRepositorySession()
AbstractResource.session.protected void initSupportedReports()
SupportedReportSetProperty,
AbstractResource.initSupportedReports()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||