com.ptc.windchill.esi.rnd
Class ESIEffectivityHandlerImpl

java.lang.Object
  extended by com.ptc.windchill.esi.rnd.ESIEffectivityHandlerImpl
All Implemented Interfaces:
ESIEffectivityHandler, Externalizable, Serializable

public class ESIEffectivityHandlerImpl
extends Object
implements ESIEffectivityHandler, Externalizable

The default implementation of ESI effectivity handler.

Supported API: true

Extendable: true

See Also:
Serialized Form

Method Summary
protected  Eff getLastExportedEffectivity(WTPart part, ESITarget target)
          Returns the last released Eff object for associated with a WTPart and an ESITarget.
protected  Eff getLastExportedEffectivity(WTPart part, ESITarget target, int type)
          Returns an Eff instance of the passed type that was last exported to the given distribution target for the given WTPart.
 Eff[] getLatestEffectivities(WTPart part)
          Fetches the latest date, serial number and lot number effectivities associated with a given part, stores them in an array of Eff instances and returns the array to the caller.
 Eff getLatestEffectivity(EffManagedVersion part)
          Returns the latest non-product-specific Date Effectivity that is associated with an object.
 Eff getLatestEffectivity(EffManagedVersion part, int type)
          Returns the latest Effectivity of a given type that is associated with a given object.
protected  ESITransactionUtility getTransactionUtility()
          Gets the value of the attribute: transactionUtility; A reference to an ESITransactionUtility.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getTransactionUtility

protected ESITransactionUtility getTransactionUtility()
Gets the value of the attribute: transactionUtility; A reference to an ESITransactionUtility. Use lazy-initializing getter method to access this attribute.

Supported API: true

Returns:
ESITransactionUtility

getLatestEffectivity

public Eff getLatestEffectivity(EffManagedVersion part)
                         throws WTException
Returns the latest non-product-specific Date Effectivity that is associated with an object.

Supported API: true

Specified by:
getLatestEffectivity in interface ESIEffectivityHandler
Parameters:
part - The part whose effectivity is to be obtained
Returns:
Eff
Throws:
WTException

getLatestEffectivity

public Eff getLatestEffectivity(EffManagedVersion part,
                                int type)
                         throws WTException
Returns the latest Effectivity of a given type that is associated with a given object. The method tries to fetch the required information from cache to start with, failing which it invokes EffHelper.service.getEffs(). The PersistInfo associated with each Eff instance is looked up to determine the latest among the multiple Eff instances (of the given type) that getEffs() may return. The latest Eff instance thus fetched is then cached, so it may be fetched conveniently from the cache during a subsequent call, without having to hit the database.

Supported API: true

Specified by:
getLatestEffectivity in interface ESIEffectivityHandler
Parameters:
part - WTPart iteration whose effectivity needs to be returned.
type - This is either ESIEffectivityHandler.DATE_EFFECTIVITY_TYPE, ESIEffectivityHandler.SERIAL_NUMBER_EFFECTIVITY_TYPE or ESIEffectivityHandler.LOT_NUMBER_EFFECTIVITY_TYPE, according as the latest Date, Serial Number or Lot Number effectivity associated with the given part is to be fetched respectively.
Returns:
Eff
Throws:
WTException

getLatestEffectivities

public Eff[] getLatestEffectivities(WTPart part)
                             throws com.ptc.windchill.esi.rnd.ESIRendererException
Fetches the latest date, serial number and lot number effectivities associated with a given part, stores them in an array of Eff instances and returns the array to the caller. Some of the elements in the output array could be null, depending on whether or not the given part has the given type of effectivity associated with it.

Supported API: true

Specified by:
getLatestEffectivities in interface ESIEffectivityHandler
Parameters:
part - WTPart instance for which to fetch the latest date, serial number and lot number effectivities.
Returns:
Eff[]
Throws:
com.ptc.windchill.esi.rnd.ESIRendererException

getLastExportedEffectivity

protected Eff getLastExportedEffectivity(WTPart part,
                                         ESITarget target)
                                  throws WTException
Returns the last released Eff object for associated with a WTPart and an ESITarget. Delegates the work to ESITransactionUtility.latestEffExport().

Supported API: true

Parameters:
part - The part of interest.
target - The ESITarget where the part is to be released.
Returns:
Eff
Throws:
WTException

getLastExportedEffectivity

protected Eff getLastExportedEffectivity(WTPart part,
                                         ESITarget target,
                                         int type)
                                  throws WTException
Returns an Eff instance of the passed type that was last exported to the given distribution target for the given WTPart. The method tries to fetch the required information from cache to start with, failing which it invokes ESITransactionUtility.latestEffExport(WTPart part, ESITarget target, int type), an overloaded version that takes the additional argument type.

Supported API: true

Parameters:
part - WTPart instance for which to determine the last exported effectivity.
target - Given distribution target.
type - Specifies the type of effectivity - takes any of the named constants defined in the interface ESIEffectivityHandler for its value.
Returns:
Eff
Throws:
WTException