wt.epm.upload
Class EPMGhostResolver

java.lang.Object
  extended bywt.epm.upload.EPMGhostResolver

public class EPMGhostResolver
extends Object

If we have a dependency to an object - and that object is not found in the cache, we need to create a ghost for it. That is how we determine the ghosts that are to be created ( subject to resol options ). This approach is better than examining the neutral data because WMPro does not send neutral data for instances separately - they are hanging off the GIR of the family table. Whether the object is created in this transaction or is existing - it will be in the cache by now. Ghosts that are created here, will be added to the cache immediately. This should be called once per dependency set of a model. We create and persist the ghosts here. If the ghost is an instance, we make sure that we persist its generic first. Ghosts - just like any other created document - will be added to the pace. We assume that the client will send a resolution option for every ghost. There is no default resolution.


Nested Class Summary
private  class EPMGhostResolver.DeleteIgnoredCandidates
          Ghost documents that were ignored in this upload and do not have other dependencies must be marked for deletetion in cache.
 
Field Summary
private  EPMNonoverridableConflicts m_conflicts
           
private  EPMNDGhostResolverDelegate m_delegate
           
private  EPMGhostResolver.DeleteIgnoredCandidates m_ignored
           
private  HashSet m_ignoredDeps
           
private  WTCollection m_newGhosts
           
private  EPMUpload m_upload
           
private static String RESOURCE
           
 
Constructor Summary
EPMGhostResolver(EPMUpload upload)
           
 
Method Summary
private  void addNewGhost(EPMDocument doc)
           
private  int adjustGhostResolOption(int gostResolOption, boolean serverSideIgnore, EPMNDDependency dependency, EPMDocument depDoc, String depModelName)
           
private  CacheDocument createGhostDocument(String modelName, String type, String subType, int revNum)
           
private  void doAutoResolve(CacheDocument parentCacheDoc, CacheDocument depCacheDoc, EPMNDDependency dep, boolean serverSideIgnore)
           
private  void doBend()
          This type of ghost resolution just do nothing
private  void doDoNotResolve(CacheDocument depCacheDoc, EPMNDDependency dep)
           
private  void doIgnore(CacheDocument parentCacheDoc, CacheDocument depCacheDoc, EPMNDDependency dep)
           
private  void doResolution(int gostResolOption, CacheDocument parentCacheDoc, CacheDocument depCacheDoc, EPMNDDependency dep, boolean serverSideIgnore)
           
 void finalizeGhosts()
           
(package private)  CacheDocument getCacheDocument(String CADName)
           
private  Collection getInitialAutoresolveCollection()
           
 boolean isReadyToUse()
           
 void lookupAutoResolveDocs()
           
 void markIgnoredGhostsForDeletion()
           
private  String restoreNameFromCadName(String cadName, String type)
           
 void saveGhost(CacheDocument parentCacheDoc, EPMNDDependency dep)
           
 void saveGhosts(CacheDocument parentDoc, Collection ndDeps)
           
 
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

m_delegate

private EPMNDGhostResolverDelegate m_delegate

m_ignoredDeps

private HashSet m_ignoredDeps

m_upload

private EPMUpload m_upload

m_ignored

private EPMGhostResolver.DeleteIgnoredCandidates m_ignored

m_conflicts

private EPMNonoverridableConflicts m_conflicts

m_newGhosts

private WTCollection m_newGhosts
Constructor Detail

EPMGhostResolver

public EPMGhostResolver(EPMUpload upload)
Method Detail

finalizeGhosts

public void finalizeGhosts()
                    throws WTException
Throws:
WTException

isReadyToUse

public boolean isReadyToUse()

saveGhosts

public void saveGhosts(CacheDocument parentDoc,
                       Collection ndDeps)
                throws WTException
Throws:
WTException

saveGhost

public void saveGhost(CacheDocument parentCacheDoc,
                      EPMNDDependency dep)
               throws WTException
Throws:
WTException

markIgnoredGhostsForDeletion

public void markIgnoredGhostsForDeletion()
                                  throws WTException
Throws:
WTException

adjustGhostResolOption

private int adjustGhostResolOption(int gostResolOption,
                                   boolean serverSideIgnore,
                                   EPMNDDependency dependency,
                                   EPMDocument depDoc,
                                   String depModelName)
                            throws WTException
Throws:
WTException

lookupAutoResolveDocs

public void lookupAutoResolveDocs()

getInitialAutoresolveCollection

private Collection getInitialAutoresolveCollection()

doResolution

private void doResolution(int gostResolOption,
                          CacheDocument parentCacheDoc,
                          CacheDocument depCacheDoc,
                          EPMNDDependency dep,
                          boolean serverSideIgnore)
                   throws WTException
Throws:
WTException

doBend

private void doBend()
             throws WTException
This type of ghost resolution just do nothing

Throws:
WTException

doIgnore

private void doIgnore(CacheDocument parentCacheDoc,
                      CacheDocument depCacheDoc,
                      EPMNDDependency dep)
               throws WTException
Throws:
WTException

doDoNotResolve

private void doDoNotResolve(CacheDocument depCacheDoc,
                            EPMNDDependency dep)
                     throws WTException
Throws:
WTException

doAutoResolve

private void doAutoResolve(CacheDocument parentCacheDoc,
                           CacheDocument depCacheDoc,
                           EPMNDDependency dep,
                           boolean serverSideIgnore)
                    throws WTException
Throws:
WTException

createGhostDocument

private CacheDocument createGhostDocument(String modelName,
                                          String type,
                                          String subType,
                                          int revNum)
                                   throws WTException
Throws:
WTException

addNewGhost

private void addNewGhost(EPMDocument doc)

restoreNameFromCadName

private String restoreNameFromCadName(String cadName,
                                      String type)

getCacheDocument

CacheDocument getCacheDocument(String CADName)