Package com.nt.udc.aggregator.util
Class AggrShifter
java.lang.Object
com.nt.udc.aggregator.AggregatorModule
com.nt.udc.aggregator.util.AggrShifter
This class handles those fields that need to be moved, or shifted,
from one field id to another field id. This is done with a simple
factor value which is added to the field id when shifting occurs.
Shifting occurs conditionally, when a certain field matches the
pre-configured value.
-
Field Summary
FieldsFields inherited from class com.nt.udc.aggregator.AggregatorModule
config, logger
-
Constructor Summary
ConstructorsConstructorDescriptionAggrShifter
(ConfigIfc config, LoggerIfc logger) Creates a shifter object with the configuration and logger objects. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Gets the shifting-related rulesboolean
Checks if the given NAR needs shifting.int[]
Returns those fields needed by a newly created recordvoid
Shifts the appropriate fields of the given NAR by the configured shift factor.void
shutdown()
Performs shutdown procedures.
-
Field Details
-
shift_factor
protected int shift_factor -
shiftAttrs
protected int[] shiftAttrs -
shiftAttrID
protected int shiftAttrID -
shiftAttrValue
-
-
Constructor Details
-
AggrShifter
Creates a shifter object with the configuration and logger objects.
-
-
Method Details
-
getConfigData
protected void getConfigData()Gets the shifting-related rules- Specified by:
getConfigData
in classAggregatorModule
-
recordInitFields
public int[] recordInitFields()Returns those fields needed by a newly created record- Specified by:
recordInitFields
in classAggregatorModule
- Returns:
- Field ID's to include in a new record that is inserted into the table.
-
shutdown
public void shutdown()Performs shutdown procedures.- Specified by:
shutdown
in classAggregatorModule
-
needShift
Checks if the given NAR needs shifting.- Parameters:
nar
- NAR to check- Returns:
- true, if this record needs shifting
-
shift
Shifts the appropriate fields of the given NAR by the configured shift factor.- Parameters:
nar
- NAR to shift
-