wt.enterprise
Class StandardEnterpriseService

java.lang.Object
  extended bywt.services.StandardManager
      extended bywt.enterprise.StandardEnterpriseService
All Implemented Interfaces:
EnterpriseService, Manager, NetFactor, Serializable

public class StandardEnterpriseService
extends StandardManager
implements EnterpriseService, Serializable

This implementation of EnterpriseService registers listeners in performStartupProcess() and emits EnterpriseServiceEvents.

Use the newStandardEnterpriseService static factory method(s), not the StandardEnterpriseService 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: false

Extendable: false

See Also:
Serialized Form

Nested Class Summary
private  class StandardEnterpriseService.NameComparator
           
 
Field Summary
private static CopyRules ALLRULES
           
private static String CLASSNAME
           
private static Vector constraintParameter
           
private static CopyMultiRules MULTIRULES
           
private  ReferenceFactory referenceFactory
           
private static String RESOURCE
           
private static Vector SERVICERULES
           
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
StandardEnterpriseService()
           
 
Method Summary
protected  void checkRenameWithVersion(Master target)
           
private  void copyIBAValues(WTKeyedMap origToCopyMap)
           
private  void copyRelationships(CopyRules rules, WTObject original, WTObject copy)
           
protected  void dispatchVetoableEvent(String eventType, CopyObjectInfo[] copyInformation, CopyMultiRules rules)
          Dispatch a EnterpriseServiceEvent that includes the event type and target (i.e., CopyObjectInfo).
protected  void dispatchVetoableEvent(String eventType, RevisionControlled original, RevisionControlled copy, CopyRules rules)
          Dispatch a EnterpriseServiceEvent that includes the event type and target (i.e., Copied object).
protected  void dispatchVetoableEvent(String eventType, WTKeyedMap eventTarget, Map ruleMap)
          Dispatch a EnterpriseServiceEvent that includes the event type and target (i.e., Copied object).
private  void doCopyRelationships(CopyRules rules, WTObject original, WTObject copy, Hashtable copyObjectMap)
           
private  void doMultiCopyRelationships(CopyMultiRules rules, WTObject original, WTObject copy, Hashtable copyObjectMap)
           
 String getConceptualClassname()
          Deprecated.  
private static Vector getServiceRules(String rules)
           
 QueryResult getTemplates(WTContainer container, QuerySpec querySpec, OrderBy[] orderBys, boolean includeEnabledOnly, boolean lookup, boolean removeOverridden)
          Returns a QueryResult of Templateable objects.
private  void handleMultiRelationships(CopyMultiRules rules, CopyObjectInfo[] items)
           
private  void handleSingleRelationships(CopyRules rules, WTObject original, WTObject copy)
           
 RevisionControlled navigateMadeFrom(RevisionControlled object)
          Return the object that this object was made from (copied).
 QueryResult navigateMadeInto(RevisionControlled object)
          Return a query result of the objects that were made from (copied from) this version of the object.
 RevisionControlled newCopy(RevisionControlled object)
          Copy the object, but do not persist it.
 CopyObjectInfo[] newMultiObjectCopy(RevisionControlled[] originalObjects)
          Copy the objects, but do not persist them.
static StandardEnterpriseService newStandardEnterpriseService()
          Default factory for the class.
protected  void performStartupProcess()
          Perform the startup for this service.
private  void persistCopyObjects(Map ruleMap, WTKeyedMap saveMap)
           
 SortedEnumeration presentMadeInto(RevisionControlled object, Vector displayAttributes, String sortPreference, Locale locale)
          Return a sorted enumeration of the objects that were made from (copied from) this version of this object.
 void registerEvents(ManagerService manager)
          Overrides the registration of all applicable enterprise service events with the service manager.
 RevisionControlled saveCopy(CopyRules rules, RevisionControlled original, RevisionControlled copy)
          Used after the client has called newCopy and set any attributes on the object that it wants to change.
 RevisionControlled saveCopy(RevisionControlled original, RevisionControlled copy)
          Used after the client has called newCopy and set any attributes on the object that it wants to change.
 CopyObjectInfo[] saveMultiObjectCopy(CopyMultiRules copyMultiRules, CopyObjectInfo[] copyInformation)
          Used after the client has called newMultiObjectCopy and set any attributes on the objects that it wants to change.
 CopyObjectInfo[] saveMultiObjectCopy(CopyObjectInfo[] copyInformation)
          Used after the client has called newMultiObjectCopy and set any attributes on the objects that it wants to change.
private  boolean serviceDoCopy(Class relationship)
           
 boolean templatesExist(WTContainer container, Class templateClass, boolean enabledOnly, boolean lookup)
          Returns true if Templateable objects exist; otherwise returns false.
 
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

VERBOSE

private static final boolean VERBOSE

ALLRULES

private static final CopyRules ALLRULES

MULTIRULES

private static final CopyMultiRules MULTIRULES

SERVICERULES

private static final Vector SERVICERULES

constraintParameter

private static Vector constraintParameter

referenceFactory

private ReferenceFactory referenceFactory
Constructor Detail

StandardEnterpriseService

public StandardEnterpriseService()
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
Perform the startup for this service. This service registers for events that it is interested in.

Supported API: false

Overrides:
performStartupProcess in class StandardManager
Throws:
ManagerException

dispatchVetoableEvent

protected void dispatchVetoableEvent(String eventType,
                                     CopyObjectInfo[] copyInformation,
                                     CopyMultiRules rules)
                              throws WTException
Dispatch a EnterpriseServiceEvent that includes the event type and target (i.e., CopyObjectInfo).

Supported API: false

Parameters:
eventType -
copyInformation -
rules -
Throws:
WTException

dispatchVetoableEvent

protected void dispatchVetoableEvent(String eventType,
                                     RevisionControlled original,
                                     RevisionControlled copy,
                                     CopyRules rules)
                              throws WTException
Dispatch a EnterpriseServiceEvent that includes the event type and target (i.e., Copied object).

Supported API: false

Parameters:
eventType -
original - The original of the copy operation.
copy - The copy created by the copy operation.
rules - The rules that the listener should use to determine if that particular part of the copy should be executed.
Throws:
WTException

dispatchVetoableEvent

protected void dispatchVetoableEvent(String eventType,
                                     WTKeyedMap eventTarget,
                                     Map ruleMap)
                              throws WTException
Dispatch a EnterpriseServiceEvent that includes the event type and target (i.e., Copied object).

Supported API: false

Parameters:
eventType -
eventTarget - A map where the key is the original and the value is the object to be copied.
ruleMap - A map where the key is an ObjectReference of the original and the value is a CopyRule.
Throws:
WTException

registerEvents

public void registerEvents(ManagerService manager)
Overrides the registration of all applicable enterprise service events with the service manager.

Supported API: false

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

newStandardEnterpriseService

public static StandardEnterpriseService newStandardEnterpriseService()
                                                              throws WTException
Default factory for the class.

Supported API: false

Returns:
StandardEnterpriseService
Throws:
WTException

newCopy

public RevisionControlled newCopy(RevisionControlled object)
                           throws WTException
Copy the object, but do not persist it. Serves as a begining step to initialize all of the business attributes.

Supported API: false

Specified by:
newCopy in interface EnterpriseService
Parameters:
object - The original object to copy.
Returns:
RevisionControlled
Throws:
WTException

saveCopy

public RevisionControlled saveCopy(RevisionControlled original,
                                   RevisionControlled copy)
                            throws WTException
Used after the client has called newCopy and set any attributes on the object that it wants to change. Persists the object and creates any of the post persistance processing such as copying content or creating relationships. Uses the rules in the properties.

Supported API: false

Specified by:
saveCopy in interface EnterpriseService
Parameters:
original - The original object that was copied.
copy - The new copy that needs to be persisted..
Returns:
RevisionControlled
Throws:
WTException

saveCopy

public RevisionControlled saveCopy(CopyRules rules,
                                   RevisionControlled original,
                                   RevisionControlled copy)
                            throws WTException
Used after the client has called newCopy and set any attributes on the object that it wants to change. Persists the object and creates any of the post persistance processing such as copying content or creating relationships. Uses the rules passed in as an argument and not the ones in the properties.

Supported API: false

Specified by:
saveCopy in interface EnterpriseService
Parameters:
rules - The rules that configure the save as. These rules will override the rules in the property file.
original - The original object that was copied.
copy - The new copy that needs to be persisted..
Returns:
RevisionControlled
Throws:
WTException

navigateMadeFrom

public RevisionControlled navigateMadeFrom(RevisionControlled object)
                                    throws WTException
Return the object that this object was made from (copied).

Supported API: false

Specified by:
navigateMadeFrom in interface EnterpriseService
Parameters:
object - Object to find what it was copied from.
Returns:
RevisionControlled
Throws:
WTException

navigateMadeInto

public QueryResult navigateMadeInto(RevisionControlled object)
                             throws WTException
Return a query result of the objects that were made from (copied from) this version of the object.

Supported API: false

Specified by:
navigateMadeInto in interface EnterpriseService
Parameters:
object - Object to find what was copied from it.
Returns:
QueryResult
Throws:
WTException

presentMadeInto

public SortedEnumeration presentMadeInto(RevisionControlled object,
                                         Vector displayAttributes,
                                         String sortPreference,
                                         Locale locale)
                                  throws WTException
Return a sorted enumeration of the objects that were made from (copied from) this version of this object. Presentable version of results.

Supported API: false

Specified by:
presentMadeInto in interface EnterpriseService
Parameters:
object - Object to find what was copied from it.
displayAttributes - The list of attributes that the client wants to display from the results.
sortPreference - To specify the sort preference for post processing of the results.
locale - The locale of the client, used in the sorting of the results.
Returns:
SortedEnumeration
Throws:
WTException

newMultiObjectCopy

public CopyObjectInfo[] newMultiObjectCopy(RevisionControlled[] originalObjects)
                                    throws WTException
Copy the objects, but do not persist them. Serves as a begining step to initialize all of the business attributes.

Supported API: false

Specified by:
newMultiObjectCopy in interface EnterpriseService
Parameters:
originalObjects - The original objects to copy.
Returns:
CopyObjectInfo[]
Throws:
WTException

saveMultiObjectCopy

public CopyObjectInfo[] saveMultiObjectCopy(CopyObjectInfo[] copyInformation)
                                     throws WTException
Used after the client has called newMultiObjectCopy and set any attributes on the objects that it wants to change. Persists the objects and creates any of the post persistance processing such as copying content or creating relationships. Uses the rules in the properties.

Supported API: false

Specified by:
saveMultiObjectCopy in interface EnterpriseService
Parameters:
copyInformation - Contains original, copy and rules for each object.
Returns:
CopyObjectInfo[]
Throws:
WTException

saveMultiObjectCopy

public CopyObjectInfo[] saveMultiObjectCopy(CopyMultiRules copyMultiRules,
                                            CopyObjectInfo[] copyInformation)
                                     throws WTException
Used after the client has called newMultiObjectCopy and set any attributes on the objects that it wants to change. Persists the objects and creates any of the post persistance processing such as copying content or creating relationships. Uses the rules in the properties.

Supported API: false

Specified by:
saveMultiObjectCopy in interface EnterpriseService
Parameters:
copyMultiRules - The multi-rules that configure the save as. These rules will override the rules in the property file.
copyInformation - Container for original, copy and rules for each object.
Returns:
CopyObjectInfo[]
Throws:
WTException

getTemplates

public QueryResult getTemplates(WTContainer container,
                                QuerySpec querySpec,
                                OrderBy[] orderBys,
                                boolean includeEnabledOnly,
                                boolean lookup,
                                boolean removeOverridden)
                         throws WTException
Returns a QueryResult of Templateable objects. The templates returned are found in the given container and, if lookup is true, up the container hierarchy. The querySpec provides the class to query against as well as any additional query criteria.

Supported API: false

Specified by:
getTemplates in interface EnterpriseService
Parameters:
container - The container to search for templates in.
querySpec - The QuerySpec (whose query class must be class assignable to Templateable) to use when searching for templates.
orderBys - If not null, an array of OrderBy statements for sorting the query result. Note: do not append these statements to the querySpec; all ordering should be done by passing OrderBy clauses in this array.
includeEnabledOnly - If true, return only enabled templates; otherwise, return latest iterations.
lookup - If true, go up the container's hierarchy when searching for templates; otherwise, find only templates in this container.
removeOverridden - If true, remove templates that have been overridden; otherwise, return all. An overridden template is a template for which there is another template of the same name in a descendent container.
Returns:
QueryResult
Throws:
WTException

templatesExist

public boolean templatesExist(WTContainer container,
                              Class templateClass,
                              boolean enabledOnly,
                              boolean lookup)
                       throws WTException
Returns true if Templateable objects exist; otherwise returns false. Templates are searched for in the given container and, if lookup is true, up the container hierarchy.

Supported API: false

Specified by:
templatesExist in interface EnterpriseService
Parameters:
container - The container to search for templates in.
templateClass - The class of templates to search for. Children of this class are also searched.
enabledOnly - If true, search for only enabled templates; otherwise, search for any templates (regardless of enabled status).
lookup - If true, go up the container's hierarchy when searching for templates; otherwise, find only templates in this container.
Returns:
boolean
Throws:
WTException

copyRelationships

private void copyRelationships(CopyRules rules,
                               WTObject original,
                               WTObject copy)
                        throws WTException
Throws:
WTException

doCopyRelationships

private void doCopyRelationships(CopyRules rules,
                                 WTObject original,
                                 WTObject copy,
                                 Hashtable copyObjectMap)
                          throws WTException
Throws:
WTException

doMultiCopyRelationships

private void doMultiCopyRelationships(CopyMultiRules rules,
                                      WTObject original,
                                      WTObject copy,
                                      Hashtable copyObjectMap)
                               throws WTException
Throws:
WTException

handleSingleRelationships

private void handleSingleRelationships(CopyRules rules,
                                       WTObject original,
                                       WTObject copy)
                                throws WTException
Throws:
WTException

handleMultiRelationships

private void handleMultiRelationships(CopyMultiRules rules,
                                      CopyObjectInfo[] items)
                               throws WTException
Throws:
WTException

persistCopyObjects

private void persistCopyObjects(Map ruleMap,
                                WTKeyedMap saveMap)
                         throws WTException
Throws:
WTException

checkRenameWithVersion

protected void checkRenameWithVersion(Master target)
                               throws PersistenceException,
                                      WTException
Throws:
PersistenceException
WTException

getServiceRules

private static Vector getServiceRules(String rules)
                               throws ClassNotFoundException
Throws:
ClassNotFoundException

serviceDoCopy

private boolean serviceDoCopy(Class relationship)

copyIBAValues

private void copyIBAValues(WTKeyedMap origToCopyMap)
                    throws WTException
Throws:
WTException