wt.maturity
Class StandardMaturityService

java.lang.Object
  extended bywt.services.StandardManager
      extended bywt.maturity.StandardMaturityService
All Implemented Interfaces:
Manager, MaturityService, MaturityServiceSvr, NetFactor, Serializable

public class StandardMaturityService
extends StandardManager
implements MaturityService, MaturityServiceSvr, Serializable

Standard server-side implementation of the MaturityService interfaces. The public, static methods in this class are accessed through the syntax:

 MaturityHelper.service.[method] 

Use the newStandardMaturityService static factory method(s), not the StandardMaturityService constructor, to construct instances of this class. Instances must be constructed using the static factory(s), in order to ensure proper initialization of the instance.



Supported API: true

Extendable: false

See Also:
MaturityService, MaturityServiceFwd, MaturityHelper, Serialized Form

Field Summary
private static String CLASSNAME
           
private static String CONTAINED_CONT_ID_ATTR_NAME
           
static Set PROMOTION_NOTICE_TERMINAL_STATES
           
private static String RESOURCE
           
private static boolean VERBOSE
           
 
Fields inherited from class wt.services.StandardManager
 
Fields inherited from interface wt.services.Manager
MANAGER_SERVICE, STARTUP_AUTOMATIC, STARTUP_MANUAL, STATUS_EMERGENCY_SHUTDOWN, STATUS_EMERGENCY_SHUTTING_DOWN, STATUS_SHUTDOWN, STATUS_SHUTDOWN_ERRORS, STATUS_SHUTDOWN_FAILURE, STATUS_SHUTTING_DOWN, STATUS_STARTED, STATUS_STARTED_ERRORS, STATUS_STARTING_UP, STATUS_STARTUP_FAILURE
 
Constructor Summary
StandardMaturityService()
           
 
Method Summary
 PromotionNotice deletePromotionNotice(PromotionNotice pn)
          Deletes a PromotionNotice.
 PromotionNotice deletePromotionSeeds(PromotionNotice pn, WTSet promotables)
          Deletes the PromotionSeed link between the PromotionNotice and the Promotable.
 PromotionNotice deletePromotionTargets(PromotionNotice pn, WTSet promotables)
          Deletes the PromotionTarget link between the PromotionNotice and the Promotable.
private  QueryResult filterNonMaturityBaselines(QueryResult mbms)
           
 void generateViewables(WTCollection collection, PromotionNotice thePN, ConfigSpec configSpec, boolean defaultRep)
          Generate ProductView viewables.
 QueryResult getBaselineItems(PromotionNotice promotionNotice)
          Returns a QueryResult of MaturityVersioned, Baselineable item iterations that are part of the Maturity Baseline associated to the PromotionNotice.
 QueryResult getBaselines(Baselineable promotable, Class promotionNoticeClass)
          Returns a QueryResult of MaturityVersioned Baseline objects of a specified class that this Baselineable item iteration is part of.
 QueryResult getBaselines(Promotable promotable)
          Returns a QueryResult of MaturityVersioned Baseline objects that this MaturityVersioned Baselineable item iteration is part of.
 String getConceptualClassname()
          Deprecated.  
 WTSet getInvalidTargets(WTCollection promotionTargets, boolean includeLocks)
          Returns the set of invalid promotion targets of a given promotion notice.
 WTSet getNonInitialTargets(WTSet promotionTargets)
           
 WTCollection getPromotionNotices(WTCollection promotables)
          

Supported API: true
 QueryResult getPromotionSeeds(PromotionNotice pn)
          

Supported API: false
 QueryResult getPromotionTargets(PromotionNotice pn)
          Returns the PromotionTargets associated to the PromotionNotice.
 QueryResult getPromotionTargets(PromotionNotice pn, boolean onlyOtherSide)
          Returns the PromotionTargets associated to the PromotionNotice.
 WTKeyedHashMap getTargetPromotionNotices(WTCollection pSet)
          Returns a WTKeyedHashSet where the keys are the values of pSet and the values are a WTArrayList of PromotionTargets.
 boolean isAnyIterationInBaseline(Promotable promotable, PromotionNotice promotionNotice)
          Returns true, if for this Maturity Baselineable, any items with the same Master are part of the MaturityBaseline associated to the PromotionNotice.
 boolean isInBaseline(Promotable promotable, PromotionNotice promotionNotice)
          Returns true, if the MaturityVersioned item iteration is part of the MaturityBaseline associated to the PromotionNotice.
 void lockTargets(PromotionNotice pn)
          Given a PromotionNotice validate and set to the LOCK state the associated PromotionTargets.
static StandardMaturityService newStandardMaturityService()
          Default factory for the class.
protected  void performStartupProcess()
          

Supported API: false
private  void processPostDeleteEvent(WTCollection pnCollection)
          Emits event for the deletion of promotion requests to delete any baselines for those notices
private  void processPostStoreEvent(WTCollection pnCollection)
          Emit event for publishing the viewables on EPM Documents in the Baseline for the PromotionNotices
private  void processPreDeleteEvent(WTCollection pnCollection)
          Emits event for the deletion of promotion requests to unlock any promotables which may be locked.
 void promoteTargets(PromotionNotice pn)
          Given a PromotionNotice validate and set to the promotion state defined in the PromotionNotice.
 void registerEvents(ManagerService managerService)
          Register events with the passed ManagerService.
 PromotionNotice savePromotionNotice(PromotionNotice pn)
          Persists the PromotionNotice.
 void savePromotionSeeds(PromotionNotice pn, WTSet promotables)
          Creates and persists PromotionSeeds between the PromotionNotice and the Promotables.
 WTSet savePromotionSeeds(WTSet psSet)
          Persists PromotionSeeds in the psVector.
 void savePromotionTargets(PromotionNotice pn, WTSet promotables)
          Creates and persists PromotionTargets between the PromotionNotice and the Promotables.
 WTSet savePromotionTargets(WTSet ptSet)
          Persists PromotionTargets in the ptVector.
 void unattachPromotable(Promotable refObject, PromotionNotice promotionNotice, Class linkClass, String maturityRole)
          Deletes the association between a PromotionNotice and a Promotable.
 void unlockTargets(PromotionNotice pn)
          Given a PromotionNotice validate and set to the create state the associated PromotionTargets.
 
Methods inherited from class wt.services.StandardManager
emergencyShutdown, emergencyShutdownComplete, emergencyShuttingDown, getClassInfo, getManagerService, getManagerStatus, getName, getStartupType, init, initialize, initialize, isStarted, newStandardManager, newStandardManager, performEmergencyShutdownProcess, performShutdownProcess, setManagerService, shutdown, shutdownFailure, shutdownSuccess, shuttingDown, started, startedErrors, startingUp, startup, startupFailure, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

CONTAINED_CONT_ID_ATTR_NAME

private static final String CONTAINED_CONT_ID_ATTR_NAME
See Also:
Constant Field Values

PROMOTION_NOTICE_TERMINAL_STATES

public static final Set PROMOTION_NOTICE_TERMINAL_STATES

VERBOSE

private static boolean VERBOSE
Constructor Detail

StandardMaturityService

public StandardMaturityService()
Method Detail

getConceptualClassname

public String getConceptualClassname()
Deprecated.  

Returns the conceptual (modeled) name for the class.

Supported API: false

Specified by:
getConceptualClassname in interface NetFactor
Overrides:
getConceptualClassname in class StandardManager
Returns:
String

performStartupProcess

protected void performStartupProcess()
                              throws ManagerException


Supported API: false

Overrides:
performStartupProcess in class StandardManager
Throws:
ManagerException

registerEvents

public void registerEvents(ManagerService managerService)
Register events with the passed ManagerService.

Supported API: false

Specified by:
registerEvents in interface Manager
Overrides:
registerEvents in class StandardManager
Parameters:
managerService -

newStandardMaturityService

public static StandardMaturityService newStandardMaturityService()
                                                          throws WTException
Default factory for the class.

Supported API: false

Returns:
StandardMaturityService
Throws:
WTException

deletePromotionNotice

public PromotionNotice deletePromotionNotice(PromotionNotice pn)
                                      throws WTException,
                                             MaturityException
Deletes a PromotionNotice.

Supported API: false

Specified by:
deletePromotionNotice in interface MaturityService
Parameters:
pn -
Returns:
PromotionNotice
Throws:
WTException
MaturityException

savePromotionNotice

public PromotionNotice savePromotionNotice(PromotionNotice pn)
                                    throws WTException,
                                           MaturityException
Persists the PromotionNotice.

Supported API: false

Specified by:
savePromotionNotice in interface MaturityService
Parameters:
pn -
Returns:
PromotionNotice
Throws:
WTException
MaturityException

deletePromotionTargets

public PromotionNotice deletePromotionTargets(PromotionNotice pn,
                                              WTSet promotables)
                                       throws WTException,
                                              MaturityException
Deletes the PromotionTarget link between the PromotionNotice and the Promotable.

Supported API: false

Specified by:
deletePromotionTargets in interface MaturityService
Parameters:
pn -
promotables -
Returns:
PromotionNotice
Throws:
WTException
MaturityException

getPromotionTargets

public QueryResult getPromotionTargets(PromotionNotice pn)
                                throws WTException,
                                       MaturityException
Returns the PromotionTargets associated to the PromotionNotice.

Supported API: false

Specified by:
getPromotionTargets in interface MaturityService
Parameters:
pn -
Returns:
QueryResult
Throws:
WTException
MaturityException

savePromotionTargets

public void savePromotionTargets(PromotionNotice pn,
                                 WTSet promotables)
                          throws WTException,
                                 MaturityException,
                                 WTPropertyVetoException
Creates and persists PromotionTargets between the PromotionNotice and the Promotables.

Supported API: false

Specified by:
savePromotionTargets in interface MaturityService
Parameters:
pn -
promotables -
Throws:
WTException
MaturityException
WTPropertyVetoException

unattachPromotable

public void unattachPromotable(Promotable refObject,
                               PromotionNotice promotionNotice,
                               Class linkClass,
                               String maturityRole)
                        throws WTException,
                               MaturityException
Deletes the association between a PromotionNotice and a Promotable.

Supported API: true

Specified by:
unattachPromotable in interface MaturityService
Parameters:
refObject - A MaturityVersioned object to be disassociatd from a PromotionNotice
promotionNotice - The PromotionNotice associated to the MaturityVersioned.
linkClass - The associated link Class, which has a PromotionNotice as role A.
maturityRole - The role name.
Throws:
WTException
MaturityException

savePromotionTargets

public WTSet savePromotionTargets(WTSet ptSet)
                           throws WTException,
                                  MaturityException,
                                  WTPropertyVetoException
Persists PromotionTargets in the ptVector.

Supported API: false

Specified by:
savePromotionTargets in interface MaturityService
Parameters:
ptSet -
Returns:
WTSet
Throws:
WTException
MaturityException
WTPropertyVetoException

savePromotionSeeds

public void savePromotionSeeds(PromotionNotice pn,
                               WTSet promotables)
                        throws WTException,
                               MaturityException
Creates and persists PromotionSeeds between the PromotionNotice and the Promotables.

Supported API: false

Specified by:
savePromotionSeeds in interface MaturityService
Parameters:
pn -
promotables -
Throws:
WTException
MaturityException

savePromotionSeeds

public WTSet savePromotionSeeds(WTSet psSet)
                         throws WTException,
                                MaturityException
Persists PromotionSeeds in the psVector.

Supported API: false

Specified by:
savePromotionSeeds in interface MaturityService
Parameters:
psSet -
Returns:
WTSet
Throws:
WTException
MaturityException

getPromotionSeeds

public QueryResult getPromotionSeeds(PromotionNotice pn)
                              throws WTException,
                                     MaturityException


Supported API: false

Specified by:
getPromotionSeeds in interface MaturityService
Parameters:
pn -
Returns:
QueryResult
Throws:
WTException
MaturityException

deletePromotionSeeds

public PromotionNotice deletePromotionSeeds(PromotionNotice pn,
                                            WTSet promotables)
                                     throws WTException,
                                            MaturityException
Deletes the PromotionSeed link between the PromotionNotice and the Promotable.

Supported API: false

Specified by:
deletePromotionSeeds in interface MaturityService
Parameters:
pn -
promotables -
Returns:
PromotionNotice
Throws:
WTException
MaturityException

getBaselines

public QueryResult getBaselines(Promotable promotable)
                         throws WTException
Returns a QueryResult of MaturityVersioned Baseline objects that this MaturityVersioned Baselineable item iteration is part of. If the iteration is not part of any MaturityBaselines, then a QueryResult of size zero is returned.

Supported API: true

Specified by:
getBaselines in interface MaturityService
Parameters:
promotable -
Returns:
QueryResult
Throws:
WTException

getBaselines

public QueryResult getBaselines(Baselineable promotable,
                                Class promotionNoticeClass)
                         throws WTException
Returns a QueryResult of MaturityVersioned Baseline objects of a specified class that this Baselineable item iteration is part of. If the iteration is not part of any Baselines of that class, then a QueryResult of size zero is returned.

Supported API: true

Specified by:
getBaselines in interface MaturityService
Parameters:
promotable -
promotionNoticeClass -
Returns:
QueryResult
Throws:
WTException

getBaselineItems

public QueryResult getBaselineItems(PromotionNotice promotionNotice)
                             throws WTException
Returns a QueryResult of MaturityVersioned, Baselineable item iterations that are part of the Maturity Baseline associated to the PromotionNotice. If the Baseline contains no items, then a QueryResult of size zero is returned.

Supported API: true

Specified by:
getBaselineItems in interface MaturityService
Parameters:
promotionNotice -
Returns:
QueryResult
Throws:
WTException

isInBaseline

public boolean isInBaseline(Promotable promotable,
                            PromotionNotice promotionNotice)
                     throws WTException
Returns true, if the MaturityVersioned item iteration is part of the MaturityBaseline associated to the PromotionNotice.

Supported API: true

Specified by:
isInBaseline in interface MaturityService
Parameters:
promotable -
promotionNotice -
Returns:
boolean
Throws:
WTException

isAnyIterationInBaseline

public boolean isAnyIterationInBaseline(Promotable promotable,
                                        PromotionNotice promotionNotice)
                                 throws WTException
Returns true, if for this Maturity Baselineable, any items with the same Master are part of the MaturityBaseline associated to the PromotionNotice.

Supported API: true

Specified by:
isAnyIterationInBaseline in interface MaturityService
Parameters:
promotable -
promotionNotice -
Returns:
boolean
Throws:
WTException

getPromotionTargets

public QueryResult getPromotionTargets(PromotionNotice pn,
                                       boolean onlyOtherSide)
                                throws WTException,
                                       MaturityException
Returns the PromotionTargets associated to the PromotionNotice. If the onlyOtherSide is true, the roleB objects are returned. If the onlyOtherSide is false, the PromotionTarget Links are returned.

Supported API: false

Specified by:
getPromotionTargets in interface MaturityService
Parameters:
pn -
onlyOtherSide -
Returns:
QueryResult
Throws:
WTException
MaturityException

getInvalidTargets

public WTSet getInvalidTargets(WTCollection promotionTargets,
                               boolean includeLocks)
                        throws WTException
Returns the set of invalid promotion targets of a given promotion notice. A promotion target is invalid if its current state is not the valid locking state, if this is defined, or the initial state from when the promotion notice was created.

Supported API: true

Specified by:
getInvalidTargets in interface MaturityService
Parameters:
promotionTargets -
includeLocks - If true, validate considering lock states. If false, validate without considering lock states.
Returns:
WTSet
Throws:
WTException

getPromotionNotices

public WTCollection getPromotionNotices(WTCollection promotables)
                                 throws WTException


Supported API: true

Specified by:
getPromotionNotices in interface MaturityService
Parameters:
promotables -
Returns:
WTCollection
Throws:
WTException

generateViewables

public void generateViewables(WTCollection collection,
                              PromotionNotice thePN,
                              ConfigSpec configSpec,
                              boolean defaultRep)
                       throws WTException
Generate ProductView viewables.

Supported API: false

Specified by:
generateViewables in interface MaturityService
Parameters:
collection - Collection of objects that will have viewables generated.
thePN - PromotionNotice associated to the collection of objects.
configSpec - ConfigSpec used by ProductView viewable generation
defaultRep -
Throws:
WTException

getTargetPromotionNotices

public WTKeyedHashMap getTargetPromotionNotices(WTCollection pSet)
                                         throws WTException
Returns a WTKeyedHashSet where the keys are the values of pSet and the values are a WTArrayList of PromotionTargets.

Supported API: false

Specified by:
getTargetPromotionNotices in interface MaturityService
Parameters:
pSet - Set of Promotables
Returns:
WTKeyedHashMap
Throws:
WTException

lockTargets

public void lockTargets(PromotionNotice pn)
                 throws WTException
Given a PromotionNotice validate and set to the LOCK state the associated PromotionTargets.

Supported API: false

Specified by:
lockTargets in interface MaturityServiceSvr
Parameters:
pn -
Throws:
WTException

promoteTargets

public void promoteTargets(PromotionNotice pn)
                    throws WTException
Given a PromotionNotice validate and set to the promotion state defined in the PromotionNotice.

Supported API: false

Specified by:
promoteTargets in interface MaturityServiceSvr
Parameters:
pn -
Throws:
WTException

unlockTargets

public void unlockTargets(PromotionNotice pn)
                   throws WTException
Given a PromotionNotice validate and set to the create state the associated PromotionTargets.

Supported API: false

Specified by:
unlockTargets in interface MaturityServiceSvr
Parameters:
pn -
Throws:
WTException

processPreDeleteEvent

private void processPreDeleteEvent(WTCollection pnCollection)
                            throws WTException
Emits event for the deletion of promotion requests to unlock any promotables which may be locked.

Throws:
WTException

processPostDeleteEvent

private void processPostDeleteEvent(WTCollection pnCollection)
                             throws WTException
Emits event for the deletion of promotion requests to delete any baselines for those notices

Throws:
WTException

processPostStoreEvent

private void processPostStoreEvent(WTCollection pnCollection)
                            throws WTException
Emit event for publishing the viewables on EPM Documents in the Baseline for the PromotionNotices

Throws:
WTException

filterNonMaturityBaselines

private QueryResult filterNonMaturityBaselines(QueryResult mbms)
                                        throws WTException
Throws:
WTException

getNonInitialTargets

public WTSet getNonInitialTargets(WTSet promotionTargets)
                           throws WTException
Throws:
WTException