org.alfresco.repo.webdav
Class LockMethod

java.lang.Object
  extended by org.alfresco.repo.webdav.WebDAVMethod
      extended by org.alfresco.repo.webdav.LockMethod

public class LockMethod
extends WebDAVMethod

Implements the WebDAV LOCK method


Nested Class Summary
 
Nested classes/interfaces inherited from class org.alfresco.repo.webdav.WebDAVMethod
WebDAVMethod.Condition
 
Field Summary
protected  boolean createExclusive
           
static java.lang.String EMPTY_NS
           
protected  LockInfo lockInfo
           
protected  java.lang.String lockToken
           
protected  int m_timeoutDuration
           
 
Fields inherited from class org.alfresco.repo.webdav.WebDAVMethod
logger, m_childToParent, m_conditions, m_davHelper, m_depth, m_parentLockInfo, m_request, m_resourceTag, m_response, m_rootNodeRef, m_strPath, m_userAgent
 
Constructor Summary
LockMethod()
          Default constructor
 
Method Summary
protected  void createLock(org.alfresco.service.cmr.model.FileInfo lockNode, java.lang.String userName)
          Create a new lock
protected  org.alfresco.service.cmr.model.FileInfo createNode(org.alfresco.service.cmr.repository.NodeRef parentNodeRef, java.lang.String name, org.alfresco.service.namespace.QName typeQName)
          Create a new node
protected  void executeImpl()
          Execute the request
protected  java.lang.String generateNamespaceDeclarations(java.util.HashMap nameSpaces)
          Generates a list of namespace declarations for the response
protected  void generateResponse(org.alfresco.service.cmr.model.FileInfo lockNodeInfo, java.lang.String userName)
          Generates the XML lock discovery response body
protected  int getLockTimeout()
          Return the lock timeout, in minutes
protected  boolean hasLockToken()
          Returns true if request has lock token in the If header
protected  void parseRequestBody()
          Parse the request body
protected  void parseRequestHeaders()
          Parse the request headers
protected  void refreshLock(org.alfresco.service.cmr.model.FileInfo lockNode, java.lang.String userName)
          Refresh an existing lock
 
Methods inherited from class org.alfresco.repo.webdav.WebDAVMethod
checkNode, checkNode, createXMLWriter, execute, flushXML, generateLockDiscoveryXML, generateLockDiscoveryXML, getActionService, getAuthenticationService, getContentService, getDAVHelper, getDepth, getFileFolderService, getLockService, getMimetypeService, getNamespaceService, getNodeForPath, getNodeLockInfo, getNodeService, getPath, getPermissionService, getRequestBodyAsDocument, getRootNodeRef, getSearchService, getServiceRegistry, getServletPath, getStatusForAccessDeniedException, getTransactionService, getURLForPath, getWorkingCopy, isReadOnly, parseDepthHeader, parseIfHeader, setDetails, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY_NS

public static final java.lang.String EMPTY_NS
See Also:
Constant Field Values

m_timeoutDuration

protected int m_timeoutDuration

lockInfo

protected LockInfo lockInfo

createExclusive

protected boolean createExclusive

lockToken

protected java.lang.String lockToken
Constructor Detail

LockMethod

public LockMethod()
Default constructor

Method Detail

hasLockToken

protected final boolean hasLockToken()
Returns true if request has lock token in the If header

Returns:
boolean

getLockTimeout

protected final int getLockTimeout()
Return the lock timeout, in minutes

Returns:
int

parseRequestHeaders

protected void parseRequestHeaders()
                            throws WebDAVServerException
Parse the request headers

Specified by:
parseRequestHeaders in class WebDAVMethod
Throws:
WebDAVServerException

parseRequestBody

protected void parseRequestBody()
                         throws WebDAVServerException
Parse the request body

Specified by:
parseRequestBody in class WebDAVMethod
Throws:
WebDAVServerException

executeImpl

protected void executeImpl()
                    throws WebDAVServerException,
                           java.lang.Exception
Execute the request

Specified by:
executeImpl in class WebDAVMethod
Throws:
WebDAVServerException
java.lang.Exception - any unhandled exception

createNode

protected org.alfresco.service.cmr.model.FileInfo createNode(org.alfresco.service.cmr.repository.NodeRef parentNodeRef,
                                                             java.lang.String name,
                                                             org.alfresco.service.namespace.QName typeQName)
Create a new node

Parameters:
parentNodeRef - the parent node.
name - the name of the node
typeQName - the type to create
Returns:
Returns the new node's file information

createLock

protected final void createLock(org.alfresco.service.cmr.model.FileInfo lockNode,
                                java.lang.String userName)
                         throws WebDAVServerException
Create a new lock

Parameters:
lockNode - NodeRef
userName - String
Throws:
WebDAVServerException

refreshLock

protected final void refreshLock(org.alfresco.service.cmr.model.FileInfo lockNode,
                                 java.lang.String userName)
                          throws WebDAVServerException
Refresh an existing lock

Parameters:
lockNode - NodeRef
userName - String
Throws:
WebDAVServerException

generateResponse

protected void generateResponse(org.alfresco.service.cmr.model.FileInfo lockNodeInfo,
                                java.lang.String userName)
                         throws java.lang.Exception
Generates the XML lock discovery response body

Throws:
java.lang.Exception

generateNamespaceDeclarations

protected java.lang.String generateNamespaceDeclarations(java.util.HashMap nameSpaces)
Generates a list of namespace declarations for the response

Overrides:
generateNamespaceDeclarations in class WebDAVMethod


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