|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object info.magnolia.module.exchangesimple.BaseSyndicatorImpl
public abstract class BaseSyndicatorImpl
Default implementation of Syndicator
. Activates all the content to a subscriber configured on the server.
Field Summary | |
---|---|
static java.lang.String |
ACTION
|
static java.lang.String |
ACTIVATE
|
static java.lang.String |
ACTIVATION_ATTRIBUTE_MESSAGE
|
static java.lang.String |
ACTIVATION_ATTRIBUTE_STATUS
|
static java.lang.String |
ACTIVATION_ATTRIBUTE_VERSION
|
static java.lang.String |
ACTIVATION_FAILED
|
static java.lang.String |
ACTIVATION_SUCCESSFUL
|
static java.lang.String |
AUTH_CREDENTIALS
|
static java.lang.String |
AUTH_USER
|
static java.lang.String |
AUTHORIZATION
|
protected java.lang.String |
basicCredentials
|
static java.lang.String |
COMMIT
|
static java.lang.String |
CONTENT_FILTER_RULE
|
protected Content.ContentFilter |
contentFilter
|
protected Rule |
contentFilterRule
|
static java.lang.String |
DEACTIVATE
|
static java.lang.String |
DEFAULT_HANDLER
URI used for activation. |
static java.lang.String |
MAPPED_PARENT_PATH
|
static java.lang.String |
NODE_UUID
|
protected java.lang.String |
parent
|
static java.lang.String |
PARENT_PATH
|
static java.lang.String |
PATH
Path to be activated or deactivated. |
static java.lang.String |
REPOSITORY_NAME
|
protected java.lang.String |
repositoryName
|
static java.lang.String |
RESOURCE_MAPPING_FILE
Name of the resource containing reading sequence for importing the data in activation target. |
static java.lang.String |
RESOURCE_MAPPING_FILE_ELEMENT
|
static java.lang.String |
RESOURCE_MAPPING_ID_ATTRIBUTE
|
static java.lang.String |
RESOURCE_MAPPING_NAME_ATTRIBUTE
|
static java.lang.String |
RESOURCE_MAPPING_ROOT_ELEMENT
|
static java.lang.String |
RESOURCE_MAPPING_UUID_ATTRIBUTE
|
static java.lang.String |
ROLLBACK
|
static java.lang.String |
SIBLING_UUID
|
static java.lang.String |
SIBLINGS_ELEMENT
|
static java.lang.String |
SIBLINGS_ROOT_ELEMENT
Name of the element in the resource file describing siblings of activated node. |
protected User |
user
|
static java.lang.String |
UTF8_STATUS
|
static java.lang.String |
VERSION_NAME
|
static java.lang.String |
WORKSPACE_NAME
|
protected java.lang.String |
workspaceName
|
Constructor Summary | |
---|---|
BaseSyndicatorImpl()
|
Method Summary | |
---|---|
protected static void |
acquireIgnoringInterruption(EDU.oswego.cs.dl.util.concurrent.Sync latch)
Acquires a Sync ignoring any interruptions. |
abstract void |
activate(ActivationContent activationContent,
java.lang.String nodePath)
|
void |
activate(java.lang.String parent,
Content content)
This will activate specifies page (sub pages) to all configured subscribers. |
void |
activate(java.lang.String parent,
Content content,
java.util.List<java.lang.String> orderBefore)
This will activate specified node to all configured subscribers. |
java.lang.String |
activate(Subscriber subscriber,
ActivationContent activationContent,
java.lang.String nodePath)
Send request of activation of activationContent to the subscriber. |
void |
activate(Subscriber subscriber,
java.lang.String parent,
Content content)
This will activate specifies page (sub pages) to the specified subscriber. |
void |
activate(Subscriber subscriber,
java.lang.String parent,
Content content,
java.util.List<java.lang.String> orderBefore)
This will activate specifies node to the specified subscriber. |
protected void |
addActivationHeaders(java.net.URLConnection connection,
ActivationContent activationContent)
Adds headers fields describing activation request. |
protected void |
addDeactivationHeaders(java.net.URLConnection connection,
java.lang.String nodeUUID)
Adds header fields describing deactivation request. |
protected void |
addOrderingInfo(org.jdom.Element root,
java.util.List<java.lang.String> orderBefore)
Adds ordering information to the resource mapping file. |
protected void |
addResources(org.jdom.Element resourceElement,
javax.jcr.Session session,
Content content,
Content.ContentFilter filter,
ActivationContent activationContent)
|
protected void |
cleanTemporaryStore(ActivationContent activationContent)
Cleans up temporary file store after activation. |
protected ActivationContent |
collect(Content node,
java.util.List<java.lang.String> orderBefore)
Collects all information about activated content and its children (those that are set to be activated with the parent by filter rules). |
void |
deactivate(Content node)
|
void |
deactivate(java.lang.String path)
|
void |
deactivate(Subscriber subscriber,
Content node)
|
abstract void |
doDeactivate(java.lang.String nodeUUID,
java.lang.String nodePath)
|
abstract java.lang.String |
doDeactivate(Subscriber subscriber,
java.lang.String nodeUUID,
java.lang.String nodePath)
Deactivate content from specified subscriber. |
protected static void |
executeInPool(java.lang.Runnable job)
Runs a given job in the thread pool. |
protected void |
exportAndParse(javax.jcr.Session session,
Content content,
org.xml.sax.XMLReader elementfilter,
java.io.OutputStream os,
boolean noRecurse)
|
protected java.lang.String |
getActivationURL(Subscriber subscriberInfo)
Retrieves URL subscriber is listening on for (de)activation requests. |
protected java.lang.String |
getDeactivationURL(Subscriber subscriberInfo)
Return URI set for deactivation. |
protected java.lang.String |
getMappedPath(java.lang.String path,
Subscription subscription)
Gets target path to which the current path is mapped in given subscription. |
void |
init(User user,
java.lang.String repositoryName,
java.lang.String workspaceName,
Rule rule)
Sets up the syndicator. |
protected java.net.URLConnection |
prepareConnection(Subscriber subscriber,
java.lang.String urlString)
|
protected static java.lang.String |
stripPasswordFromUrl(java.lang.String escapedUrl)
|
protected void |
updateActivationDetails(java.lang.String path)
Updates current content activation meta data with the time stamp and user details of the activation. |
protected void |
updateDeactivationDetails(java.lang.String nodeUUID)
Updates current content activation meta data with the timestamp and user details of the deactivation. |
protected void |
updateMetaData(Content node,
java.lang.String type)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DEFAULT_HANDLER
public static final java.lang.String PARENT_PATH
public static final java.lang.String MAPPED_PARENT_PATH
public static final java.lang.String PATH
public static final java.lang.String NODE_UUID
public static final java.lang.String REPOSITORY_NAME
public static final java.lang.String WORKSPACE_NAME
public static final java.lang.String VERSION_NAME
public static final java.lang.String RESOURCE_MAPPING_FILE
public static final java.lang.String UTF8_STATUS
public static final java.lang.String SIBLINGS_ROOT_ELEMENT
public static final java.lang.String SIBLINGS_ELEMENT
public static final java.lang.String SIBLING_UUID
public static final java.lang.String RESOURCE_MAPPING_FILE_ELEMENT
public static final java.lang.String RESOURCE_MAPPING_NAME_ATTRIBUTE
public static final java.lang.String RESOURCE_MAPPING_UUID_ATTRIBUTE
public static final java.lang.String RESOURCE_MAPPING_ID_ATTRIBUTE
public static final java.lang.String RESOURCE_MAPPING_ROOT_ELEMENT
public static final java.lang.String ACTION
public static final java.lang.String ACTIVATE
public static final java.lang.String DEACTIVATE
public static final java.lang.String COMMIT
public static final java.lang.String ROLLBACK
public static final java.lang.String AUTHORIZATION
public static final java.lang.String AUTH_CREDENTIALS
public static final java.lang.String AUTH_USER
public static final java.lang.String CONTENT_FILTER_RULE
public static final java.lang.String ACTIVATION_SUCCESSFUL
public static final java.lang.String ACTIVATION_FAILED
public static final java.lang.String ACTIVATION_ATTRIBUTE_STATUS
public static final java.lang.String ACTIVATION_ATTRIBUTE_MESSAGE
public static final java.lang.String ACTIVATION_ATTRIBUTE_VERSION
protected java.lang.String repositoryName
protected java.lang.String workspaceName
protected java.lang.String parent
protected Content.ContentFilter contentFilter
protected Rule contentFilterRule
protected User user
protected java.lang.String basicCredentials
Constructor Detail |
---|
public BaseSyndicatorImpl()
Method Detail |
---|
protected static void executeInPool(java.lang.Runnable job) throws ExchangeException
job
- the job to run
ExchangeException
- if the job could not be put in the poolprotected static void acquireIgnoringInterruption(EDU.oswego.cs.dl.util.concurrent.Sync latch)
Sync
ignoring any interruptions. Should any
interruption occur the interruption status will be set. Might
potentially block/wait forever.
latch
- the latch on which to waitSync.acquire()
public void init(User user, java.lang.String repositoryName, java.lang.String workspaceName, Rule rule)
Syndicator
init
in interface Syndicator
user
- repositoryName
- repository IDworkspaceName
- workspace IDrule
- content filter ruleSyndicator.init(info.magnolia.cms.security.User, String, String,
info.magnolia.cms.util.Rule)
public void activate(java.lang.String parent, Content content) throws ExchangeException, javax.jcr.RepositoryException
activate
in interface Syndicator
parent
- parent under which this page will be activatedcontent
- to be activated
javax.jcr.RepositoryException
ExchangeException
public void activate(java.lang.String parent, Content content, java.util.List<java.lang.String> orderBefore) throws ExchangeException, javax.jcr.RepositoryException
activate
in interface Syndicator
parent
- parent under which this page will be activatedcontent
- to be activatedorderBefore
- List of UUID to be used by the implementation to order this node after activation
javax.jcr.RepositoryException
ExchangeException
public void activate(Subscriber subscriber, java.lang.String parent, Content content) throws ExchangeException, javax.jcr.RepositoryException
activate
in interface Syndicator
subscriber
- parent
- parent under which this page will be activatedcontent
- to be activated
javax.jcr.RepositoryException
ExchangeException
public void activate(Subscriber subscriber, java.lang.String parent, Content content, java.util.List<java.lang.String> orderBefore) throws ExchangeException, javax.jcr.RepositoryException
activate
in interface Syndicator
subscriber
- parent
- parent under which this page will be activatedcontent
- to be activatedorderBefore
- List of UUID to be used by the subscriber to order this node after activation
javax.jcr.RepositoryException
ExchangeException
public abstract void activate(ActivationContent activationContent, java.lang.String nodePath) throws ExchangeException
ExchangeException
public java.lang.String activate(Subscriber subscriber, ActivationContent activationContent, java.lang.String nodePath) throws ExchangeException
ExchangeException
protected static java.lang.String stripPasswordFromUrl(java.lang.String escapedUrl)
protected void cleanTemporaryStore(ActivationContent activationContent)
public void deactivate(java.lang.String path) throws ExchangeException, javax.jcr.RepositoryException
ExchangeException
javax.jcr.RepositoryException
public void deactivate(Content node) throws ExchangeException, javax.jcr.RepositoryException
deactivate
in interface Syndicator
node
- to deactivate
javax.jcr.RepositoryException
ExchangeException
public void deactivate(Subscriber subscriber, Content node) throws ExchangeException, javax.jcr.RepositoryException
deactivate
in interface Syndicator
node
- , to deactivatesubscriber
-
javax.jcr.RepositoryException
ExchangeException
public abstract void doDeactivate(java.lang.String nodeUUID, java.lang.String nodePath) throws ExchangeException
ExchangeException
public abstract java.lang.String doDeactivate(Subscriber subscriber, java.lang.String nodeUUID, java.lang.String nodePath) throws ExchangeException
subscriber
-
ExchangeException
protected java.lang.String getDeactivationURL(Subscriber subscriberInfo)
subscriberInfo
- protected void addDeactivationHeaders(java.net.URLConnection connection, java.lang.String nodeUUID)
connection
- protected java.lang.String getActivationURL(Subscriber subscriberInfo)
protected void addActivationHeaders(java.net.URLConnection connection, ActivationContent activationContent)
protected void updateActivationDetails(java.lang.String path) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected void updateDeactivationDetails(java.lang.String nodeUUID) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected void updateMetaData(Content node, java.lang.String type) throws AccessDeniedException
node
- type
- (activate / deactivate)
AccessDeniedException
protected ActivationContent collect(Content node, java.util.List<java.lang.String> orderBefore) throws java.lang.Exception
java.lang.Exception
protected void addOrderingInfo(org.jdom.Element root, java.util.List<java.lang.String> orderBefore)
root
- element of the resource file under which ordering info must be addedorderBefore
- protected void addResources(org.jdom.Element resourceElement, javax.jcr.Session session, Content content, Content.ContentFilter filter, ActivationContent activationContent) throws java.io.IOException, javax.jcr.RepositoryException, org.xml.sax.SAXException, java.lang.Exception
java.io.IOException
javax.jcr.RepositoryException
org.xml.sax.SAXException
java.lang.Exception
protected void exportAndParse(javax.jcr.Session session, Content content, org.xml.sax.XMLReader elementfilter, java.io.OutputStream os, boolean noRecurse) throws java.lang.Exception
java.lang.Exception
protected java.lang.String getMappedPath(java.lang.String path, Subscription subscription)
protected java.net.URLConnection prepareConnection(Subscriber subscriber, java.lang.String urlString) throws ExchangeException
ExchangeException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |