Package org.alfresco.repo.webdav
Class LockMethod
- java.lang.Object
-
- org.alfresco.repo.webdav.WebDAVMethod
-
- org.alfresco.repo.webdav.LockMethod
-
public class LockMethod extends WebDAVMethod
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
Fields Modifier and Type Field Description protected boolean
createExclusive
static String
EMPTY_NS
protected LockInfo
lockInfo
protected 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
Constructors Constructor Description LockMethod()
Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
attemptLock()
The main lock implementation method.protected void
createLock(FileInfo lockNode, String userName)
Create a new lockprotected FileInfo
createNode(NodeRef parentNodeRef, String name, QName typeQName)
Create a new nodeprotected void
executeImpl()
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 int
getLockTimeout()
Return the lock timeout, in seconds.protected boolean
hasLockToken()
Returns true if request has lock token in the If headerprotected void
parseRequestBody()
Parse the request bodyprotected void
parseRequestHeaders()
Parse the request headersprotected void
refreshLock(FileInfo lockNode, String userName)
Refresh an existing lock-
Methods 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 Detail
-
EMPTY_NS
public static final String EMPTY_NS
- See Also:
- Constant Field Values
-
m_timeoutDuration
protected int m_timeoutDuration
-
lockInfo
protected LockInfo lockInfo
-
createExclusive
protected boolean createExclusive
-
lockToken
protected String lockToken
-
-
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 seconds.- Returns:
- int
-
parseRequestHeaders
protected void parseRequestHeaders() throws WebDAVServerException
Parse the request headers- Specified by:
parseRequestHeaders
in classWebDAVMethod
- Throws:
WebDAVServerException
-
parseRequestBody
protected void parseRequestBody() throws WebDAVServerException
Parse the request body- Specified by:
parseRequestBody
in classWebDAVMethod
- Throws:
WebDAVServerException
-
executeImpl
protected void executeImpl() throws WebDAVServerException, Exception
Execute the request- Specified by:
executeImpl
in classWebDAVMethod
- Throws:
WebDAVServerException
Exception
- any unhandled exception
-
attemptLock
protected void attemptLock() throws WebDAVServerException, Exception
The main lock implementation method.- Throws:
WebDAVServerException
Exception
-
createNode
protected FileInfo createNode(NodeRef parentNodeRef, String name, 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
protected final void createLock(FileInfo lockNode, String userName) throws WebDAVServerException
Create a new lock- Parameters:
lockNode
- NodeRefuserName
- String- Throws:
WebDAVServerException
-
refreshLock
protected final void refreshLock(FileInfo lockNode, String userName) throws WebDAVServerException
Refresh an existing lock- Parameters:
lockNode
- NodeRefuserName
- String- Throws:
WebDAVServerException
-
generateResponse
protected void generateResponse(FileInfo lockNodeInfo, String userName) throws Exception
Generates the XML lock discovery response body- Throws:
Exception
-
generateNamespaceDeclarations
protected String generateNamespaceDeclarations(HashMap<String,String> nameSpaces)
Generates a list of namespace declarations for the response- Overrides:
generateNamespaceDeclarations
in classWebDAVMethod
-
-