Package org.alfresco.repo.webdav
Class LockMethod
java.lang.Object
org.alfresco.repo.webdav.WebDAVMethod
org.alfresco.repo.webdav.LockMethod
Implements the WebDAV LOCK method
- Author:
- gavinc
-
Nested Class Summary
Nested classes/interfaces inherited from class org.alfresco.repo.webdav.WebDAVMethod
WebDAVMethod.Condition
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
static final String
protected LockInfo
protected String
protected int
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
The main lock implementation method.protected final void
createLock
(FileInfo lockNode, String userName) Create a new lockprotected FileInfo
createNode
(NodeRef parentNodeRef, String name, org.alfresco.service.namespace.QName typeQName) Create a new nodeprotected void
Execute the requestprotected String
generateNamespaceDeclarations
(HashMap<String, String> nameSpaces) Generates a list of namespace declarations for the responseprotected void
generateResponse
(FileInfo lockNodeInfo, String userName) Generates the XML lock discovery response bodyprotected final int
Return the lock timeout, in seconds.protected final boolean
Returns true if request has lock token in the If headerprotected void
Parse the request bodyprotected void
Parse the request headersprotected final void
refreshLock
(FileInfo lockNode, String userName) Refresh an existing lockMethods inherited from class org.alfresco.repo.webdav.WebDAVMethod
checkNode, checkNode, createXMLWriter, execute, flushXML, generateLockDiscoveryXML, generateLockDiscoveryXML, generateResponseImpl, getActionService, getAuthenticationService, getContentService, getContextPath, getDAVHelper, getDAVLockService, getDepth, getFileFolderService, getMimetypeService, getNamespaceService, getNodeForPath, getNodeLockInfo, getNodeService, getPath, getPermissionService, getRequestBodyAsDocument, getRootNodeRef, getSearchService, getServiceRegistry, getServletPath, getSiteId, getStatusForAccessDeniedException, getTenantDomain, getTransactionService, getURLForPath, getWorkingCopy, getXMLOutputFormat, isReadOnly, parseDepthHeader, parseIfHeader, setDetails, shouldFlushXMLWriter, toString
-
Field Details
-
EMPTY_NS
- See Also:
-
m_timeoutDuration
protected int m_timeoutDuration -
lockInfo
-
createExclusive
protected boolean createExclusive -
lockToken
-
-
Constructor Details
-
LockMethod
public LockMethod()Default constructor
-
-
Method Details
-
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 seconds.- Returns:
- int
-
parseRequestHeaders
Parse the request headers- Specified by:
parseRequestHeaders
in classWebDAVMethod
- Throws:
WebDAVServerException
-
parseRequestBody
Parse the request body- Specified by:
parseRequestBody
in classWebDAVMethod
- Throws:
WebDAVServerException
-
executeImpl
Execute the request- Specified by:
executeImpl
in classWebDAVMethod
- Throws:
WebDAVServerException
Exception
- any unhandled exception
-
attemptLock
The main lock implementation method.- Throws:
WebDAVServerException
Exception
-
createNode
protected FileInfo createNode(NodeRef parentNodeRef, String name, org.alfresco.service.namespace.QName typeQName) Create a new node- Parameters:
parentNodeRef
- the parent node.name
- the name of the nodetypeQName
- the type to create- Returns:
- Returns the new node's file information
-
createLock
Create a new lock- Parameters:
lockNode
- NodeRefuserName
- String- Throws:
WebDAVServerException
-
refreshLock
Refresh an existing lock- Parameters:
lockNode
- NodeRefuserName
- String- Throws:
WebDAVServerException
-
generateResponse
Generates the XML lock discovery response body- Throws:
Exception
-
generateNamespaceDeclarations
Generates a list of namespace declarations for the response- Overrides:
generateNamespaceDeclarations
in classWebDAVMethod
-