com.ptc.windchill.uwgm.proesrv.cache
Class IterationRequestCacheAdapter

java.lang.Object
  extended bycom.ptc.windchill.uwgm.proesrv.cache.RequestCacheAdapter
      extended bycom.ptc.windchill.uwgm.proesrv.cache.IterationRequestCacheAdapter
All Implemented Interfaces:
IterationRequestCache
Direct Known Subclasses:
WorkspaceIterationRequestCacheAdapter

public abstract class IterationRequestCacheAdapter
extends RequestCacheAdapter
implements IterationRequestCache

RequestCacheAdapter for all IterationRequestCache implementations


Nested Class Summary
private  class IterationRequestCacheAdapter.IterationVisitor
          Implements the Visitor interface from IterationRequestProcessor for caching the iterations in a WTCollection.
 
Field Summary
private  List errorMessages
          List of UWGM messages about not found iterations
private static Log log
          logging
private  WTKeyedMap masterOidVsUwgmIteration
          map [MasterOid, UwgmIteration] for iteration specified by master
protected  WTKeyedMap objectVsUwgmIteration
          map of objects v/s UWGM iterations
protected  ObjectIdentifierHelper oidHelper
           
 
Fields inherited from class com.ptc.windchill.uwgm.proesrv.cache.RequestCacheAdapter
 
Constructor Summary
IterationRequestCacheAdapter()
           
 
Method Summary
protected  void addIterationNotFoundMessage(com.ptc.windchill.uwgm.soap.uwgmdb.Iteration iteration)
          utility method to record iteration not found message in UwgmMessages
 WTCollection getIterations()
          Returns the collection of iterations found by validateRequestData() method above.
protected abstract  PartDocumentFinder getPartDocumentFinder()
          returns approproate PartDocumentFinder finder implementation to resolve iterations specified by Masters
private  WTKeyedMap matchIteratedToIterations(Iterated[] iterations, WTKeyedMap masterOidToUwgmIteration)
          matches Iterated Objects to corresponding UwgmIterations from [Master, UwgmIterations] map
protected  WTKeyedMap resolveIterationByMasters(WTKeyedMap masterOidToUwgmIteration, PartDocumentFinder retriever)
          resolves Iteration specified by Master
protected  void validateIterations(RequestContext requestContext, com.ptc.windchill.uwgm.soap.uwgmdb.Iteration[] iterations)
          Validates UWGM Iterations and inflates them to full-fledged Windchill objects for use by the Pro/E service request classes.
protected  void validateRequestData(RequestContext requestContext, com.ptc.windchill.uwgm.soap.uwgm.UwgmRequest uwgmRequest)
          Validates UWGM IterationRequest and inflates the iterations in the request to full-fledged Windchill objects for use by the Pro/E service request classes.
 
Methods inherited from class com.ptc.windchill.uwgm.proesrv.cache.RequestCacheAdapter
checkCacheData, isValid, setValid, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

objectVsUwgmIteration

protected WTKeyedMap objectVsUwgmIteration
map of objects v/s UWGM iterations


oidHelper

protected final ObjectIdentifierHelper oidHelper

masterOidVsUwgmIteration

private WTKeyedMap masterOidVsUwgmIteration
map [MasterOid, UwgmIteration] for iteration specified by master


errorMessages

private List errorMessages
List of UWGM messages about not found iterations


log

private static Log log
logging

Constructor Detail

IterationRequestCacheAdapter

public IterationRequestCacheAdapter()
Method Detail

validateRequestData

protected void validateRequestData(RequestContext requestContext,
                                   com.ptc.windchill.uwgm.soap.uwgm.UwgmRequest uwgmRequest)
                            throws RequestValidationException,
                                   UwgmErrorException
Validates UWGM IterationRequest and inflates the iterations in the request to full-fledged Windchill objects for use by the Pro/E service request classes.

checks:

1. If each iteration in the request has a valid object ID 2. If each iteration can be retrieved from this object ID. 3. Collects the UwgmMessages for all the iterations not found and throws a RequestValidationException in that case. 4. Throws any WTException as a UwgmErrorException

Specified by:
validateRequestData in class RequestCacheAdapter
Parameters:
uwgmRequest - IterationRequest
requestContext - RequestContext
Throws:
RequestValidationException
UwgmErrorException

validateIterations

protected void validateIterations(RequestContext requestContext,
                                  com.ptc.windchill.uwgm.soap.uwgmdb.Iteration[] iterations)
                           throws RequestValidationException,
                                  UwgmErrorException
Validates UWGM Iterations and inflates them to full-fledged Windchill objects for use by the Pro/E service request classes.

checks:

1. If each iteration in the request has a valid object ID 2. If each iteration can be retrieved from this object ID. 3. Collects the UwgmMessages for all the iterations not found and throws a RequestValidationException in that case.

Parameters:
requestContext - RequestContext
iterations - Iteration[]
Throws:
RequestValidationException
UwgmErrorException

resolveIterationByMasters

protected WTKeyedMap resolveIterationByMasters(WTKeyedMap masterOidToUwgmIteration,
                                               PartDocumentFinder retriever)
                                        throws WTException
resolves Iteration specified by Master

Parameters:
masterOidToUwgmIteration - WTKeyedMap
Returns:
WTKeyedMap
Throws:
WTException

matchIteratedToIterations

private WTKeyedMap matchIteratedToIterations(Iterated[] iterations,
                                             WTKeyedMap masterOidToUwgmIteration)
matches Iterated Objects to corresponding UwgmIterations from [Master, UwgmIterations] map

Parameters:
iterations - Iterated[]
masterOidToUwgmIteration - WTKeyedMap
Returns:
WTKeyedMap

getIterations

public WTCollection getIterations()
Returns the collection of iterations found by validateRequestData() method above.

Specified by:
getIterations in interface IterationRequestCache
Returns:
WTCollection

getPartDocumentFinder

protected abstract PartDocumentFinder getPartDocumentFinder()
returns approproate PartDocumentFinder finder implementation to resolve iterations specified by Masters

Returns:
PartDocumentFinder

addIterationNotFoundMessage

protected void addIterationNotFoundMessage(com.ptc.windchill.uwgm.soap.uwgmdb.Iteration iteration)
utility method to record iteration not found message in UwgmMessages