|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object info.magnolia.cms.filters.AbstractMgnlFilter info.magnolia.module.exchangesimple.ReceiveFilter
public class ReceiveFilter
This filter receives activation requests from another instance and applies them.
Field Summary | |
---|---|
static String |
ROOT_LOCK_NAME
|
static String |
SYSTEM_REPO
|
Constructor Summary | |
---|---|
ReceiveFilter(ExchangeSimpleModule module)
|
Method Summary | |
---|---|
protected void |
applyLock(javax.servlet.http.HttpServletRequest request)
apply lock. |
protected String[] |
checkAuthenticated(javax.servlet.http.HttpServletRequest request)
|
protected void |
cleanUp(javax.servlet.http.HttpServletRequest request,
String status)
cleans temporary store and removes any locks set. |
protected void |
copyProperties(Content source,
Content destination)
Copy all properties from source to destination (by cleaning the old properties). |
void |
doFilter(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.FilterChain chain)
|
protected HierarchyManager |
getBackupHierarchyManager()
|
protected HierarchyManager |
getHierarchyManager(javax.servlet.http.HttpServletRequest request)
get hierarchy manager. |
protected org.jdom.Element |
getImportedContentRoot(MultipartForm data,
String resourceFileName,
String resourcesmd5)
|
protected Content |
getNode(javax.servlet.http.HttpServletRequest request)
Returns parent node of the activated node in case of activation or the node itself in case of deactivation. |
protected String |
getParentPath(javax.servlet.http.HttpServletRequest request)
|
long |
getRetryWait()
|
int |
getUnlockRetries()
|
protected String |
getUser(javax.servlet.http.HttpServletRequest request)
Deprecated. since 4.5. This method is not used anymore and there is no replacement. Authentication of activation is now handled by exchange of info encrypted by PPKey. |
protected String |
getUUID(javax.servlet.http.HttpServletRequest request)
|
protected String |
getWebappName()
|
protected void |
handleChildren(javax.servlet.http.HttpServletRequest request,
Content content)
|
protected String |
handleMovedContent(String newParentPath,
HierarchyManager hm,
org.jdom.Element topContentElement,
Content content)
|
protected void |
importFresh(org.jdom.Element topContentElement,
MultipartForm data,
HierarchyManager hierarchyManager,
String parentPath)
import on non existing tree. |
protected void |
importOnExisting(org.jdom.Element topContentElement,
MultipartForm data,
HierarchyManager hierarchyManager,
Content existingContent)
import on existing content, making sure that content which is not sent stays as is. |
protected void |
importResource(MultipartForm data,
org.jdom.Element resourceElement,
HierarchyManager hm,
String parentPath)
import documents. |
protected boolean |
isAuthorAuthenticated(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
|
protected void |
lock(Content node,
Content parent)
Method handling issuing of the lock. |
protected void |
order(Content parent,
String name,
String orderBefore)
|
protected String |
orderImportedNode(String newParentPath,
HierarchyManager hm,
org.jdom.Element rootElement,
org.jdom.Element topContentElement)
|
protected String |
receive(javax.servlet.http.HttpServletRequest request)
handle activate or deactivate request. |
protected void |
releaseLock(javax.servlet.http.HttpServletRequest request)
|
protected String |
remove(javax.servlet.http.HttpServletRequest request,
String md5)
Deletes (de-activate) the content specified by the request. |
protected void |
removeChildren(Content content,
Content.ContentFilter filter)
remove children. |
protected void |
setResponseHeaders(javax.servlet.http.HttpServletResponse response,
String statusMessage,
String status,
String result)
|
void |
setRetryWait(int retryWait)
|
void |
setUnlockRetries(int unlockRetries)
|
protected String |
update(javax.servlet.http.HttpServletRequest request,
String resourcesmd5)
handle update (activate) request. |
protected Content |
waitForLock(javax.servlet.http.HttpServletRequest request)
Will wait for predefined amount of time and attempt predefined number of times to obtain unlocked content. |
Methods inherited from class info.magnolia.cms.filters.AbstractMgnlFilter |
---|
acceptsEncoding, acceptsGzipEncoding, addAndVerifyHeader, addBypass, addMapping, bypasses, destroy, doFilter, getBypasses, getDispatching, getMapping, getMappings, getName, headerContains, init, isEnabled, mapsTo, matches, matchesDispatching, setDispatching, setEnabled, setName |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String SYSTEM_REPO
public static final String ROOT_LOCK_NAME
Constructor Detail |
---|
@Inject public ReceiveFilter(ExchangeSimpleModule module)
Method Detail |
---|
public int getUnlockRetries()
public void setUnlockRetries(int unlockRetries)
public long getRetryWait()
public void setRetryWait(int retryWait)
public void doFilter(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException
doFilter
in class AbstractMgnlFilter
IOException
javax.servlet.ServletException
protected boolean isAuthorAuthenticated(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws NoSuchAlgorithmException, ExchangeException
NoSuchAlgorithmException
ExchangeException
protected void setResponseHeaders(javax.servlet.http.HttpServletResponse response, String statusMessage, String status, String result)
protected String receive(javax.servlet.http.HttpServletRequest request) throws Exception
request
-
Exception
- if fails to updateprotected String[] checkAuthenticated(javax.servlet.http.HttpServletRequest request) throws ExchangeException
ExchangeException
protected String getWebappName()
@Deprecated protected String getUser(javax.servlet.http.HttpServletRequest request)
protected String update(javax.servlet.http.HttpServletRequest request, String resourcesmd5) throws Exception
request
- incoming reuqestresourcesmd5
- signature confirming validity of resource file
Exception
- if fails to updateprotected org.jdom.Element getImportedContentRoot(MultipartForm data, String resourceFileName, String resourcesmd5) throws org.jdom.JDOMException, IOException
org.jdom.JDOMException
IOException
protected void handleChildren(javax.servlet.http.HttpServletRequest request, Content content)
protected String handleMovedContent(String newParentPath, HierarchyManager hm, org.jdom.Element topContentElement, Content content) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected String orderImportedNode(String newParentPath, HierarchyManager hm, org.jdom.Element rootElement, org.jdom.Element topContentElement) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected void order(Content parent, String name, String orderBefore) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected void copyProperties(Content source, Content destination) throws javax.jcr.RepositoryException
source
- the content node to be copieddestination
- the destination node
javax.jcr.RepositoryException
protected void removeChildren(Content content, Content.ContentFilter filter)
content
- whose children to be deletedfilter
- content filterprotected void importFresh(org.jdom.Element topContentElement, MultipartForm data, HierarchyManager hierarchyManager, String parentPath) throws ExchangeException, javax.jcr.RepositoryException
topContentElement
- data
- hierarchyManager
- parentPath
-
ExchangeException
javax.jcr.RepositoryException
protected void importOnExisting(org.jdom.Element topContentElement, MultipartForm data, HierarchyManager hierarchyManager, Content existingContent) throws ExchangeException, javax.jcr.RepositoryException
topContentElement
- data
- hierarchyManager
- existingContent
-
ExchangeException
javax.jcr.RepositoryException
protected void importResource(MultipartForm data, org.jdom.Element resourceElement, HierarchyManager hm, String parentPath) throws Exception
data
- as sentresourceElement
- parent file elementhm
- parentPath
- Path to the node parent
Exception
protected String remove(javax.servlet.http.HttpServletRequest request, String md5) throws Exception
request
-
Exception
- if fails to updateprotected HierarchyManager getHierarchyManager(javax.servlet.http.HttpServletRequest request) throws ExchangeException
request
-
ExchangeException
protected void cleanUp(javax.servlet.http.HttpServletRequest request, String status)
request
- status
- protected void releaseLock(javax.servlet.http.HttpServletRequest request)
protected void applyLock(javax.servlet.http.HttpServletRequest request) throws ExchangeException
request
-
ExchangeException
protected Content waitForLock(javax.servlet.http.HttpServletRequest request) throws ExchangeException, javax.jcr.RepositoryException
request
-
ExchangeException
javax.jcr.RepositoryException
protected HierarchyManager getBackupHierarchyManager()
protected Content getNode(javax.servlet.http.HttpServletRequest request) throws ExchangeException, javax.jcr.RepositoryException
ExchangeException
javax.jcr.RepositoryException
protected String getParentPath(javax.servlet.http.HttpServletRequest request)
protected String getUUID(javax.servlet.http.HttpServletRequest request)
protected void lock(Content node, Content parent) throws ExchangeException, javax.jcr.RepositoryException
node
- Activated node.parent
- Parent of activated node.
ExchangeException
javax.jcr.RepositoryException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |