com.ptc.core.ocmp.service
Class StandardObjComparisonService

java.lang.Object
  extended by wt.services.StandardManager
      extended by com.ptc.core.ocmp.service.StandardObjComparisonService
All Implemented Interfaces:
ObjComparisonService, Serializable, NetFactor, wt.services.Manager

public class StandardObjComparisonService
extends StandardManager
implements ObjComparisonService, Serializable

The default implementation of the object comparison service. It's main job is to identify the comparison operation and delegate the actual comparison to any of the comparators configured in the object comparison configuration resource.

Use the newStandardObjComparisonService static factory method(s), not the StandardObjComparisonService 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:
ObjComparisonHelper, ComparisonSpec, ComparisonResult, com.ptc.core.ocmp.framework.ComfigResourceReader, com.ptc.core.ocmp.framework.ComfigResourceHandler, Serialized Form

Method Summary
 boolean areAttrsConfiguredForDomainType(WTReference domainObjRef)
          Determines whether any attributes are configred in the configuration resource for the type represented by the passed in reference object.
 boolean areLinksConfiguredForDomainType(WTReference domainObjRef)
          Determines whether any links (associations) are configured in the configuration resource for the object type represented by the passed in reference object.
 ComparisonResult compareDomainObjs(ComparisonSpec spec)
          Compares business objects specified as part of a ComparisonSpec.
 Set<String> getLinksConfiguredForType(WTReference domainObjRef)
          Returns any links (associations) configured in the configuration resource for the domain type represented by the passed in reference object.
 boolean isDomainTypeSupportedForComparison(String logicalTypeId)
          Identifies whether the type specified is supported for comparison by the comparison service, which in turn depends on whether the domain type (or any of its parent type) is configured in the object comparison configuration resource.
 
Methods inherited from class wt.services.StandardManager
getManagerService, getManagerStatus, getName, getStartupType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

compareDomainObjs

public ComparisonResult compareDomainObjs(ComparisonSpec spec)
                                   throws com.ptc.core.ocmp.framework.ConfigResourceException,
                                          WTException
Compares business objects specified as part of a ComparisonSpec. The results are tailored as per the various options specified as part of the ComparisonSpec.

The domain type (or one of its parent types) in context must be configured in the object comparison configuration resource for its objects to be supported for comparison by the comparison service. If a SimpleComparisonSpec is to be used as the comparison specification object for the comparison service, any attributes and links (associations) to be compared as part of the comparison operation must be configured in the resource too. An AdvancedComparisonSpec on the other hand allows such specification to be specified at runtime, and these values take precedence over the values configured in the resource (if any).



Supported API: true

Specified by:
compareDomainObjs in interface ObjComparisonService
Parameters:
spec - A non-null ComparisonSpec instance must be specified for a successful comparison operation. The list of domain objects to be compared must be non null too and must contain at least 2 objects specified for comparison.
Returns:
A ComparisonResult instance that aggregates and organizes the various comparison results, in a fashion such that the results are easily and efficiently retrieved and / or queried.
Throws:
NullPointerException - when the spec is null
IllegalArgumentException - when the ComparisonSpec instance has less than 2 objects specified for comparison.
com.ptc.core.ocmp.framework.ConfigResourceException - when an error is encountered while accesing the configuration resource.
com.ptc.core.ocmp.framework.ConfigResourceException
WTException
See Also:
ComparisonSpec, ComparisonResult

isDomainTypeSupportedForComparison

public boolean isDomainTypeSupportedForComparison(String logicalTypeId)
                                           throws WTException
Identifies whether the type specified is supported for comparison by the comparison service, which in turn depends on whether the domain type (or any of its parent type) is configured in the object comparison configuration resource.

The domain type (or one of its parent types) in context must be configured in this resource for its objects to be supported for comparison by the comparison service. If a SimpleComparisonSpec is to be used as the comparison specification object for the comparison service, any attributes and links (associations) to be compared as part of the comparison operation must be configured in the resource too. AdvancedComparisonSpec on the other hand allows such specification to be specified at runtime, and these values take precedence over the values configured in the resource (if any).

Supported API: true

Specified by:
isDomainTypeSupportedForComparison in interface ObjComparisonService
Parameters:
logicalTypeId - the logical type identifier (form) of the type which is to be checked for comparison support. The logical type identifier universally identifies a type in windchill using a logical identifier/form.
Returns:
trueif the type is supported for comparison; false otherwise.
Throws:
WTException
See Also:
Business Admin's Guide for more information on logical type identifiers.

areAttrsConfiguredForDomainType

public boolean areAttrsConfiguredForDomainType(WTReference domainObjRef)
                                        throws WTException
Determines whether any attributes are configred in the configuration resource for the type represented by the passed in reference object.

Supported API: true

Specified by:
areAttrsConfiguredForDomainType in interface ObjComparisonService
Parameters:
domainObjRef -
Returns:
true if any attributes are configured; false otherwise.
Throws:
WTException

areLinksConfiguredForDomainType

public boolean areLinksConfiguredForDomainType(WTReference domainObjRef)
                                        throws WTException
Determines whether any links (associations) are configured in the configuration resource for the object type represented by the passed in reference object.

Supported API: true

Specified by:
areLinksConfiguredForDomainType in interface ObjComparisonService
Parameters:
domainObjRef -
Returns:
true if any links are configured; false otherwise.
Throws:
WTException

getLinksConfiguredForType

public Set<String> getLinksConfiguredForType(WTReference domainObjRef)
                                      throws WTException
Returns any links (associations) configured in the configuration resource for the domain type represented by the passed in reference object.

Supported API: true

Specified by:
getLinksConfiguredForType in interface ObjComparisonService
Parameters:
domainObjRef -
Returns:
the set of configured links for the domain type represented by the reference object; empty set if no configured links identified.
Throws:
WTException