com.endeca.cas.extension
Class PipelineComponentConfiguration<C extends PipelineComponentConfiguration<C>>

java.lang.Object
  extended by com.endeca.cas.extension.PipelineComponentConfiguration<C>

public abstract class PipelineComponentConfiguration<C extends PipelineComponentConfiguration<C>>
extends Object

The configuration of a PipelineComponent instance in a pipeline. Subclasses should use the annotations from the com.endeca.cas.extension.annotation package to make properties available in crawl configurations. The CAS Server uses reflection to set these properties before invoking any methods on this class.

Implementations must have a zero argument constructor.

See Also:
BooleanProperty, ConfigurationGroupOrder, DoubleProperty, IntegerProperty, StringProperty

Constructor Summary
PipelineComponentConfiguration()
           
 
Method Summary
 boolean equals(Object obj)
           Default implementation for testing equality using all non-static, non-transient class fields including private ones.
protected  PipelineComponentContext getComponentContext()
          Used to access the component's context
 InstanceId getInstanceId()
          Used to access the component's instance ID
 int hashCode()
           Default implementation for calculating the HashCode using all non-static, non-transient class fields including private ones.
 boolean isFullAcquisitionRequired(C oldConfiguration)
          Indicates whether a full acquisition is required.
 void setComponentContext(PipelineComponentContext componentContext)
          Called immediately after the Configuration is instantiated to set up the context for this component.
 void setInstanceId(InstanceId instanceId)
          Called after the configuration is instantiated to set the instance ID for this component.
 List<ValidationFailure> validate()
          Validates a configuration after validation of the specifications from the annotations has already been done.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PipelineComponentConfiguration

public PipelineComponentConfiguration()
Method Detail

isFullAcquisitionRequired

public boolean isFullAcquisitionRequired(C oldConfiguration)
Indicates whether a full acquisition is required. This is called when the configuration is changed from the current configuration to newConfiguration. The component must indicate whether a saved configuration change should invalidate any previous acquisitions performed with the old configuration. If a call to this method returns true and the DataSourceRuntime constructed with this new configuration implements IncrementalDataSourceRuntime, then CAS will not call IncrementalDataSourceRuntime.runIncrementalAcquisition(), but only call DataSourceRuntime.runFullAcquisition(). If the DataSourceRuntime does not implement IncrementalDataSourceRuntime, then CAS will clear its record of any previous acquisitions before calling runFullAcquisition(). The default implementation will return true if any field in the configuration object is different. This is done using reflection.

Parameters:
oldConfiguration - the previous version of the configuration
Returns:
true if a full acquisition is required after this configuration change

validate

public List<ValidationFailure> validate()
Validates a configuration after validation of the specifications from the annotations has already been done. By default returns no failures.

Returns:
a list of validation failures

setComponentContext

public final void setComponentContext(PipelineComponentContext componentContext)
Called immediately after the Configuration is instantiated to set up the context for this component.

Parameters:
componentContext - context for the component

getComponentContext

protected final PipelineComponentContext getComponentContext()
Used to access the component's context


setInstanceId

public final void setInstanceId(InstanceId instanceId)
Called after the configuration is instantiated to set the instance ID for this component.

Parameters:
instanceId - instance ID for the component

getInstanceId

public final InstanceId getInstanceId()
Used to access the component's instance ID


equals

public boolean equals(Object obj)

Default implementation for testing equality using all non-static, non-transient class fields including private ones. It does not include the PipelineComponentContext object for the test.

It uses AccessibleObject.setAccessible to gain access to private fields. This means that it will throw a security exception if run under a security manager, if the permissions are not set up correctly. It is also not as efficient as testing explicitly.

Overrides:
equals in class Object

hashCode

public int hashCode()

Default implementation for calculating the HashCode using all non-static, non-transient class fields including private ones. It does not include the PipelineComponentContext as a part of the HashCode

It uses AccessibleObject.setAccessible to gain access to private fields. This means that it will throw a security exception if run under a security manager, if the permissions are not set up correctly. It is also not as efficient as testing explicitly.

Overrides:
hashCode in class Object


Copyright © 2011 Endeca. All Rights Reserved.