Class FlexibleAggregatorFieldProcessor

java.lang.Object
com.nt.udc.ndk.node.DCFieldProcessor
com.nt.udc.ndk.node.NPLFieldProcessor
com.nt.udc.flexibleAggregator.FlexibleAggregatorFieldProcessor
All Implemented Interfaces:
DataProviderIfc, DataReceiverIfc, FileDataProviderIfc, FileDataReceiverIfc, StateFreezable, Runnable

public class FlexibleAggregatorFieldProcessor extends NPLFieldProcessor
  • Field Details

  • Constructor Details

  • Method Details

    • init

      protected void init()
    • isAllKeyAttributesExists

      public void isAllKeyAttributesExists(NAR nar, int tableNumber)
    • shutdown

      public void shutdown()
      Description copied from class: NPLFieldProcessor
      Performs all steps necessary to gracefully stop this FieldProcessor.
      Overrides:
      shutdown in class NPLFieldProcessor
    • createKey

      public FlexibleNARKey createKey(int index, NAR nar)
      This will generate and return a key based on the record.
    • storeNAR

      public void storeNAR(NAR nar, int index, boolean setTimer)
      This will generate a key and store the NAR in the table.
    • printTimer

      public void printTimer(NAR nar, int index)
      To be used in debugging only. Print the time that a NAR will be flushed from the aggregator
    • storeNARReusingTimer

      public void storeNARReusingTimer(NAR nar, int index)
      This will generate a key and store the NAR in the table with an old timer.
    • getNARKeepTimer

      public boolean getNARKeepTimer(NAR nar, int index)
      This will remove a NAR but leave its timer.
    • removeNARTimer

      public boolean removeNARTimer(NAR nar, int index)
      This will remove the timer for a NAR from the timer table. This should be used if the record was removed from the key table, but the timer value was left in the timer table, for example, if getNarSaveTimer was used.
    • getAndRemoveNAR

      public boolean getAndRemoveNAR(NAR nar, int index)
      This will remove the NAR entry from the table.
    • removeNAR

      public boolean removeNAR(int index)
      This will remove a NAR entry from the table without returning the removed entry.
    • setCount

      public void setCount(long tempKey, long tempKey1, long tempKey2, int index)
      Sets the Count
    • getCount

      public int getCount(long tempKey, long tempKey1, long tempKey2, int index)
      Gets the Count
    • reset

      public void reset(long cleanup)
      Reset the Count
    • resetCount

      public void resetCount(long tempKey, long tempKey1, long tempKey2, int index)
    • removeDeactivatedTimer

      public void removeDeactivatedTimer(int index)
      This will remove a deactivated timer.
    • distributeTrafficVolumesPerDay

      public boolean distributeTrafficVolumesPerDay(ListField trafficVolumes, NAR destContainer, List uplinkVolumeAttrs, List downlinkVolumeAttrs, ListField unprocessedVolumes, BytesField openingTime)
      This will distribute the traffic volume uplink and downlink volumes into appropriate daily bins according to the individual times. If the traffic volumes goes past midnight, it will stop and return false. In this case, the volumes already processed for the previous day will be left processed. The list of traffic volumes will also have the processed volumes removed from the list. Only the unprocessed entries will remain. If no day change is detected, true is returned to indicate all traffic volumes have been processed.
    • populateIndividualTrafficVolume

      public int populateIndividualTrafficVolume(Map trafficVolumeMap, DCFieldContainer destContainer, List uplinkVolumeIDs, List downlinkVolumeIDs, BytesField nextOpeningTime, int dayOfYearCheck)
      Will only populate the traffic volumes if they are for the same day as dayOfYearCheck, unless dayOfYearCheck invalid input: '<' 1. If the same day, that day of the year will be returned. If a different day, 0 will be returned. If no time is provided in the traffic volume map, -1 is returned.
    • generateOpeningTimeFromTrafficVolume

      public byte[] generateOpeningTimeFromTrafficVolume(List trafficVolumes)
      Will return the integer day of year corresponding to the first traffic volume.
    • compareBytes

      public boolean compareBytes(DCFieldContainer narA, DCFieldContainer narB, FieldKey attrId)
      Performs a simple byte comparison on the attribute in the two NARs.