atg.markers
Class CompareByProperties

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.markers.CompareByProperties
All Implemented Interfaces:
MarkerDuplicateComparator, NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener

public class CompareByProperties
extends GenericService
implements MarkerDuplicateComparator

This class is a MarkerDuplicateComparator that compares two markers by type and property value. The property names that are compared are defined by the propertyNamesToCheck array.

Each property is compared using object.equals().

To return true both markers must be of the same type and all the compared properties must be equal.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 java.lang.String[] mPropertiesToCompare
           
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
CompareByProperties()
           
 
Method Summary
 java.lang.String[] getPropertiesToCompare()
          Returns the the property names to compare
 boolean isDuplicateMarker(RepositoryItem pMarker1, RepositoryItem pMarker2)
          This method determines if the two markers are duplicates of each other.
 void setPropertiesToCompare(java.lang.String[] pPropertiesToCompare)
          Sets the property names to compare
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string


mPropertiesToCompare

public java.lang.String[] mPropertiesToCompare
Constructor Detail

CompareByProperties

public CompareByProperties()
Method Detail

setPropertiesToCompare

public void setPropertiesToCompare(java.lang.String[] pPropertiesToCompare)
Sets the property names to compare


getPropertiesToCompare

public java.lang.String[] getPropertiesToCompare()
Returns the the property names to compare


isDuplicateMarker

public boolean isDuplicateMarker(RepositoryItem pMarker1,
                                 RepositoryItem pMarker2)
                          throws MarkerException
This method determines if the two markers are duplicates of each other.

Specified by:
isDuplicateMarker in interface MarkerDuplicateComparator
Parameters:
pMarker1 - marker 1 to use in comparison
pMarker2 - marker 2 to use in comparison
Returns:
boolean true if markers are duplicates of each other
Throws:
MarkerException