wt.sandbox
Class SandboxRefreshUtility

java.lang.Object
  extended bywt.sandbox.SandboxRefreshUtility

class SandboxRefreshUtility
extends Object

Utility class to handle refresh methods in StandardSandboxService

Supported API: false

Extendable: false


Field Summary
private static String RESOURCE
          Resource bundle for error messages
 
Constructor Summary
(package private) SandboxRefreshUtility()
           
 
Method Summary
private static Map createRefreshMap(List freshIterations, List sharedIterations)
          Create a mapping between the new recently refreshed iterations and the ones currently shared to the Sandbox.
private static List getMasters(List iterations)
          Gets Masters from list of Iterated Objects.
private static List getSharedIterations(WTContainerRef sandboxRef)
          Returns objects shared to Sandbox from PDM.
protected static Map refresh(WTContainerRef sandboxRef, ConfigSpec configSpec, ConfigSpec otherConfigSpec, boolean isDocCentric)
          For all objects shared from PDM to Sandbox, checks if newer iterations are available in PDM and Returns Map of ObjectReference of shared Iteration in Sandbox as key and new iteration as value.
 
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
Resource bundle for error messages

See Also:
Constant Field Values
Constructor Detail

SandboxRefreshUtility

SandboxRefreshUtility()
Method Detail

refresh

protected static Map refresh(WTContainerRef sandboxRef,
                             ConfigSpec configSpec,
                             ConfigSpec otherConfigSpec,
                             boolean isDocCentric)
                      throws WTException
For all objects shared from PDM to Sandbox, checks if newer iterations are available in PDM and Returns Map of ObjectReference of shared Iteration in Sandbox as key and new iteration as value.

This method works in two modes, docCentric and partCentric. In docCentric mode, EPMDocuments are refreshed first. They along with the latest compatible iteration of their associated WTParts are added to refresh Map. Next, any left over WTParts, ones not associated with any EPMDocument, are refreshed and added to refresh Map.

In partCentric mode, WTParts are refreshed first. They along with the latest compatible iteration of their associated EPMDocuments are added to refresh Map. Next, any leftover EPMDocuments, ones not associated with any WTPart, are refreshed and added to refresh Map.

In order to find associated EPMDocuments/WTParts, BuildRule, BuildHistory and EPMDescribeLink are navigated. WTDocuments associated to WTParts are not considered for refresh.

Parameters:
sandboxRef - Sandbox Container Reference
configSpec - if (isDocCentric) PDM Configspec used to get new Iterations of Documents else PDM Configspec used to get new Iterations of Parts
otherConfigSpec - if (isDocCentric) PDM Configspec used to find Iterations of Parts that are not associated with any documents else PDM Configspec used to find Iterations of Documents that are not associated with any Parts
isDocCentric - true if Doc Centric refresh is required, false otherwise
Returns:
Map of ObjectReference of shared Iteration in Sandbox as key and new iteration as value.
Throws:
WTException

getSharedIterations

private static List getSharedIterations(WTContainerRef sandboxRef)
                                 throws WTException
Returns objects shared to Sandbox from PDM. Only objects shared and added to Sandbox Baseline are returned.

Parameters:
sandboxRef -
Returns:
List of objects shared to Sandbox.
Throws:
WTException

getMasters

private static List getMasters(List iterations)
Gets Masters from list of Iterated Objects.

Parameters:
iterations -
Returns:
List of Masters of iterations

createRefreshMap

private static Map createRefreshMap(List freshIterations,
                                    List sharedIterations)
                             throws WTException
Create a mapping between the new recently refreshed iterations and the ones currently shared to the Sandbox.

Parameters:
freshIterations - - list of newly refreshed iterations
sharedIterations - - list of iterations that are already in the Sandbox Baseline
Returns:
Map of object references for the currently shared iterations to newly refreshed iterations
Throws:
WTException