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 booleanstatic final Stringprotected LockInfoprotected Stringprotected intFields 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 voidThe main lock implementation method.protected final voidcreateLock(FileInfo lockNode, String userName) Create a new lockprotected FileInfocreateNode(NodeRef parentNodeRef, String name, org.alfresco.service.namespace.QName typeQName) Create a new nodeprotected voidExecute the requestprotected StringgenerateNamespaceDeclarations(HashMap<String, String> nameSpaces) Generates a list of namespace declarations for the responseprotected voidgenerateResponse(FileInfo lockNodeInfo, String userName) Generates the XML lock discovery response bodyprotected final intReturn the lock timeout, in seconds.protected final booleanReturns true if request has lock token in the If headerprotected voidParse the request bodyprotected voidParse the request headersprotected final voidrefreshLock(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:
parseRequestHeadersin classWebDAVMethod- Throws:
WebDAVServerException
-
parseRequestBody
Parse the request body- Specified by:
parseRequestBodyin classWebDAVMethod- Throws:
WebDAVServerException
-
executeImpl
Execute the request- Specified by:
executeImplin classWebDAVMethod- Throws:
WebDAVServerExceptionException- any unhandled exception
-
attemptLock
The main lock implementation method.- Throws:
WebDAVServerExceptionException
-
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:
generateNamespaceDeclarationsin classWebDAVMethod
-