com.ptc.netmarkets.nmixb
Class SubscriptionsCopyHelper

java.lang.Object
  extended bywt.inf.template.containercopy.AbstractContainerCopyHandler
      extended bycom.ptc.netmarkets.nmixb.SubscriptionsCopyHelper
All Implemented Interfaces:
ContainerCopyHandler, Serializable

public class SubscriptionsCopyHelper
extends AbstractContainerCopyHandler
implements Serializable

This is run after all objects have been copied. This copyHelper resets the subscription policies to match those of the source project. This is different from the default subscription policies which were dealt with by the ProjectPlanStructCopyHelper This method limits itself to subscriptions on ExecutionObjects,Project,and WTDocuments. As more Subscriptions are exposed they will have to be added.

Supported API: false

Extendable: false

See Also:
Serialized Form

Nested Class Summary
(package private) static class SubscriptionsCopyHelper.PairEntry
           
(package private) static class SubscriptionsCopyHelper.SubHolder
          This class holds a map of the subscriptions and the vector of their subscribes.
(package private) static class SubscriptionsCopyHelper.SubscrProxy
           
 
Field Summary
private static String CLASSNAME
           
private static Object[] DEF_PARAMS
           
private static int[] FROM_INDICES
           
private static String RESOURCE
           
private  SubscriptionsCopyHelper.SubHolder sourceSubs
           
private  SubscriptionsCopyHelper.SubHolder targetSubs
           
private  ProjectCopyWorklist workList
           
 
Fields inherited from class wt.inf.template.containercopy.AbstractContainerCopyHandler
VERBOSE
 
Constructor Summary
SubscriptionsCopyHelper()
           
 
Method Summary
protected  void copyAddedObjects()
          Most of the time this is the only method that needs to be over-ridden.
private static void createSubscriptionsFromProxy(SubscriptionsCopyHelper.SubscrProxy proxy)
           
static void createSubscriptionsFromProxy(SubscriptionsCopyHelper.SubscrProxy proxy, Notifiable theTarget)
          creates the subscriptions from the proxy.
private  List doExecutionObjects(WTContainerRef contRef)
           
private  List doFolderContents(WTContainerRef contRef)
           
private  List doFolderStructure(WTContainerRef contRef)
           
private  void doForumObjects(WTContainerRef contRef)
           
private  List doParts(WTContainerRef contRef)
           
private  List findSubscriptions(WTContainerRef contRef)
           
private  QueryResult getAllObjects(WTContainerRef contRef, Class target)
           
private  QueryResult getLatestIterationOfObjects(WTContainerRef contRef, Class target)
           
protected  void initialize()
          This method provides an opportunity to do any initializion beyond setting the three target member variables that is performed in at the start of the method.
 void postPostCopyFeedback()
          Posts post copy feedback.
 void postPreCopyFeedback()
          Posts pre-copy user feedback.
 void printPostCopyVerbose()
          Prints verbose post-copy statements.
 void printPreCopyVerbose()
          Prints verbose pre-copy statements.
private  List processCandidateSubscription(ObjectSubscription candidate, List objVec)
           
protected  void rememberSourceContainerObjects()
          Depending on the template being employed it may be necessary to to remember what was in the source container in order to do pruning.
 
Methods inherited from class wt.inf.template.containercopy.AbstractContainerCopyHandler
copyObjects, getCopier, getSourceContainer, getTargetContainer, getWorklist, postFeedback, rememberTargetContainerObjects, setCopier, setSourceContainer, setTargetContainer, setWorklist
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

sourceSubs

private SubscriptionsCopyHelper.SubHolder sourceSubs

targetSubs

private SubscriptionsCopyHelper.SubHolder targetSubs

FROM_INDICES

private static final int[] FROM_INDICES

workList

private ProjectCopyWorklist workList

DEF_PARAMS

private static final Object[] DEF_PARAMS
Constructor Detail

SubscriptionsCopyHelper

public SubscriptionsCopyHelper()
Method Detail

initialize

protected void initialize()
                   throws WTException
This method provides an opportunity to do any initializion beyond setting the three target member variables that is performed in at the start of the method.

Supported API: false

Overrides:
initialize in class AbstractContainerCopyHandler
Throws:
WTException

printPreCopyVerbose

public void printPreCopyVerbose()
                         throws WTException
Prints verbose pre-copy statements. Handler implementor is responsible for deciding what to use for this value. The handlers residing in wt.inf.template use the property wt.inf.template.verboseCopy

Supported API: false

Specified by:
printPreCopyVerbose in interface ContainerCopyHandler
Overrides:
printPreCopyVerbose in class AbstractContainerCopyHandler
Throws:
WTException

postPreCopyFeedback

public void postPreCopyFeedback()
                         throws WTException
Posts pre-copy user feedback.

Supported API: false

Specified by:
postPreCopyFeedback in interface ContainerCopyHandler
Overrides:
postPreCopyFeedback in class AbstractContainerCopyHandler
Throws:
WTException

rememberSourceContainerObjects

protected void rememberSourceContainerObjects()
                                       throws WTException
Depending on the template being employed it may be necessary to to remember what was in the source container in order to do pruning. This method is the hook that enables that to happen.

Supported API: false

Overrides:
rememberSourceContainerObjects in class AbstractContainerCopyHandler
Throws:
WTException

copyAddedObjects

protected void copyAddedObjects()
                         throws WTException
Most of the time this is the only method that needs to be over-ridden.

Supported API: false

Overrides:
copyAddedObjects in class AbstractContainerCopyHandler
Throws:
WTException

postPostCopyFeedback

public void postPostCopyFeedback()
                          throws WTException
Posts post copy feedback. (Copy of foo succeeded).

Supported API: false

Specified by:
postPostCopyFeedback in interface ContainerCopyHandler
Overrides:
postPostCopyFeedback in class AbstractContainerCopyHandler
Throws:
WTException

printPostCopyVerbose

public void printPostCopyVerbose()
                          throws WTException
Prints verbose post-copy statements. Handler implementor is responsible for deciding what to use for this value. The handlers residing in wt.inf.template use the property wt.inf.template.verboseCopy

Supported API: false

Specified by:
printPostCopyVerbose in interface ContainerCopyHandler
Overrides:
printPostCopyVerbose in class AbstractContainerCopyHandler
Throws:
WTException

createSubscriptionsFromProxy

private static void createSubscriptionsFromProxy(SubscriptionsCopyHelper.SubscrProxy proxy)
                                          throws WTException
Throws:
WTException

createSubscriptionsFromProxy

public static void createSubscriptionsFromProxy(SubscriptionsCopyHelper.SubscrProxy proxy,
                                                Notifiable theTarget)
                                         throws WTException
creates the subscriptions from the proxy. If target is null, we attempt to determine the target from the proxy. If the target is non-null, the subscription is tied to the target.

Throws:
WTException

findSubscriptions

private List findSubscriptions(WTContainerRef contRef)
                        throws WTException
Throws:
WTException

doForumObjects

private void doForumObjects(WTContainerRef contRef)
                     throws WTException
Throws:
WTException

doExecutionObjects

private List doExecutionObjects(WTContainerRef contRef)
                         throws WTException
Throws:
WTException

doFolderStructure

private List doFolderStructure(WTContainerRef contRef)
                        throws WTException
Throws:
WTException

doFolderContents

private List doFolderContents(WTContainerRef contRef)
                       throws WTException
Throws:
WTException

doParts

private List doParts(WTContainerRef contRef)
              throws WTException
Throws:
WTException

processCandidateSubscription

private List processCandidateSubscription(ObjectSubscription candidate,
                                          List objVec)
                                   throws WTException
Throws:
WTException

getLatestIterationOfObjects

private QueryResult getLatestIterationOfObjects(WTContainerRef contRef,
                                                Class target)
                                         throws WTException
Throws:
WTException

getAllObjects

private QueryResult getAllObjects(WTContainerRef contRef,
                                  Class target)
                           throws WTException
Throws:
WTException