Class MXJavahookHandler

java.lang.Object
com.metasolv.nm.processor.MXAggregator.MXJavahookHandler
All Implemented Interfaces:
IDCMethodHandler

public class MXJavahookHandler extends Object implements IDCMethodHandler
This is the handler class for the enhancer aggregator. It provides a comprehensive interface to all the aggregator functions through java hooks. This is cloned from FlexibleAggregatorHandler, with the following modifications:
  • There's a new threadID/fpID parameter needed to pass back to the field processor in the MXAP.
  • Got rid of some of the deprecated DCField ctor calls.
    • Field Details

    • Constructor Details

      • MXJavahookHandler

        public MXJavahookHandler(MXAggregatorNode flexNode, MXAggrDispatcher dispatcher, int fpID)
        Simple constructor, just need to perform all the initializations
      • MXJavahookHandler

        public MXJavahookHandler()
    • Method Details

      • setKey

        public void setKey(DCFieldContainer nar)
        This will set the key value based on the input NAR for a specific hash table for all following operations
      • setKey

        public void setKey(DCFieldContainer nar, IntField index)
      • storeNAR

        public void storeNAR(DCFieldContainer in)
        Stores a NAR in the table indicated
      • flushImmediate

        public void flushImmediate(DCFieldContainer in)
      • flushImmediate

        public void flushImmediate(DCFieldContainer in, IntField index)
      • storeNAR

        public void storeNAR(DCFieldContainer in, IntField index)
      • storeNAR

        public void storeNAR(DCFieldContainer in, IntField index, LongField currentTime, StringField inactiveCheck)
      • printTimer

        public void printTimer(DCFieldContainer in, IntField index)
        Useful for debugging. Informs you (in milliseconds) the time that a NAR with key of nar will be flushed from the table
      • storeNARWithTimer

        public void storeNARWithTimer(DCFieldContainer in)
        Stores a NAR in the table indicated and also turns on the timer. Note that any previous timer settings are NOT removed by this method. Any previous timers that should be removed should be handled before this is called. If an entry for the currently set key already exists in the table, it will be removed and replaced.
      • storeNARWithTimer

        public void storeNARWithTimer(DCFieldContainer in, IntField index)
      • storeNARWithTimer

        public void storeNARWithTimer(DCFieldContainer in, IntField index, LongField currentTime, StringField inactiveCheck)
      • storeNARWithAbsoluteTimer

        public void storeNARWithAbsoluteTimer(DCFieldContainer in, LongField absoluteTime)
        Stores a NAR with an absolute time as the expiry . Once the given time is reached , eventually records will be flushed. The intention behind adding this method is basically to give an option to flush the records when a particular time is reached, say the Billing date as per the billing cycle of a particular subscriber.
      • storeNARWithAbsoluteTimer

        public void storeNARWithAbsoluteTimer(DCFieldContainer in, IntField index, LongField absoluteTime)
      • storeNARSavedTimer

        public void storeNARSavedTimer(DCFieldContainer in)
        Stores a NAR in the table indicated and also turns on the timer. This version of storeNAR is meant to be used in conjunction with getNARSaveTimer, as this one will re-activate the timer.
      • storeNARSavedTimer

        public void storeNARSavedTimer(DCFieldContainer in, IntField index)
      • removeTimer

        public void removeTimer()
        This will remove a timer for an item removed with getNARSaveTimer.
      • removeTimer

        public void removeTimer(IntField index)
      • getNAR

        public IntField getNAR(DCFieldContainer out)
        This will remove and return a NAR from the indicated table. Should never just get a NAR from the table without removing, as then synchronization would be required between the NPL and the timers. There would be the possibility of the timer going off and flushing a record already returned to the NPL. Returns 1 for success, 0 for failure.
      • getNAR

        public IntField getNAR(DCFieldContainer out, IntField index)
      • getNARSaveTimer

        public IntField getNARSaveTimer(DCFieldContainer out)
        This will remove and return a NAR as the functions above, but the underlying timer will be stored to be reused with the same key.
      • getNARSaveTimer

        public IntField getNARSaveTimer(DCFieldContainer out, IntField index)
      • removeNAR

        public IntField removeNAR()
        This will just remove an entry from the table. Returns 1 for success, 0 for failure.
      • removeNAR

        public IntField removeNAR(IntField index)
      • removeNARTimer

        public IntField removeNARTimer(DCFieldContainer nar)
        A nar removed from the table with getNarSaveTimer will still have a timer in the timer table. This call will explicitly remove the timer with key of the NAR
      • removeNARTimer

        public IntField removeNARTimer(DCFieldContainer nar, IntField index)
      • removeTimer

        public void removeTimer(DCFieldContainer nar)
      • removeTimer

        public void removeTimer(DCFieldContainer nar, IntField index)
      • setCount

        public void setCount(LongField tempKey, LongField tempKey1, LongField tempKey2, IntField index)
        Used for setting the count for a session
      • getCount

        public IntField getCount(LongField tempKey, LongField tempKey1, LongField tempKey2, IntField index, IntField flushCount)
        Used for getting the count for a session
      • reset

        public void reset(LongField cleanup)
        Used for Resetting the count for a session
      • resetCount

        public void resetCount(LongField tempKey, LongField tempKey1, LongField tempKey2, IntField index)
      • compareBytes

        public IntField compareBytes(DCFieldContainer recA, DCFieldContainer recB, DCField attrId)
        This should be added to NPL at some point rather than using a specific java hook.
      • getBytesValueFromListMapIp

        public IntField getBytesValueFromListMapIp(ListField theList, IntField index, DCFieldContainer dest, StringField attrId)
        Function to return a specific element from a list type. Returns 1 if successful, 0 if the copy could not be performed.
      • getDayOfYear

        public IntField getDayOfYear(BytesField bytesDate)
        This will return the day of the year as an integer.
      • getPreviousDayOfYear

        public IntField getPreviousDayOfYear(BytesField bytesDate)
        This will return the previous day of the year as an integer.
      • sumAttributes

        public void sumAttributes(DCFieldContainer source, DCFieldContainer dest, StringField attrList)
        Performs summation on each of the indicated attributes.
      • sumAttributesNoOverflow

        public IntField sumAttributesNoOverflow(DCFieldContainer source, DCFieldContainer dest, StringField attrList)
        Performs summation on each of the indicated attributes and does not allow an overflow. If an overflow occurs, the destination will be returned unchanged and the return value will be 0. If no overflow occurs this will return 1. Only checks for overflow of positive values.
      • keepMaxAttributes

        public void keepMaxAttributes(DCFieldContainer source, DCFieldContainer dest, StringField attrList)
        This will go through each of the attributes and keep the greater of the two.
      • keepMinAttributes

        public void keepMinAttributes(DCFieldContainer source, DCFieldContainer dest, StringField attrList)
        This will go through each of the attributes and keep the smaller of the two.
      • mapAttributes

        public void mapAttributes(DCFieldContainer source, DCFieldContainer dest, StringField sourceAttrs, StringField destAttrs)
        This will perform various assignments. This difference between this and replaceAttributes is this performs assignments between different attribute IDs, where replaceAttributes always assigns to the same ID.
      • mapAttributeSets

        public void mapAttributeSets(DCFieldContainer source, DCFieldContainer dest, StringField sourceSet, StringField destSet)
      • appendLists

        public void appendLists(DCFieldContainer source, DCFieldContainer dest, StringField attrList)
        This will append the source list onto the end of the dest list.
      • appendListsWithoutRepeat

        public void appendListsWithoutRepeat(DCFieldContainer source, DCFieldContainer dest, StringField attrList)
        This will append the source list onto the end of the dest list. It will not allow an appended item to be the same as the previous item. This prevents continuously appending the same item to the end of the list.
      • sumValue

        public void sumValue(LongField sourceValue, DCFieldContainer dest, StringField attrList)
        This will sum the value of each attribute and the constant passed in.
      • sumValueNoOverflow

        public IntField sumValueNoOverflow(LongField sourceValue, DCFieldContainer dest, StringField attrList)
        This will sum the value of each attribute and the constant passed in while not allowing an overflow to occur. Normally this will return 1. If an overflow occurs, none of the attributes will be summed, and 0 will be returned.
      • concatenateStrings

        public void concatenateStrings(DCFieldContainer source, DCFieldContainer dest, StringField attrList)
        This will concatenate the strings for each attribute listed with no separator.
      • concatenateStrings

        public void concatenateStrings(DCFieldContainer source, DCFieldContainer dest, StringField separator, StringField attrList)
        This will concatenate the strings for each attribute listed, using the optional separator in between each.
      • replaceAttributes

        public void replaceAttributes(DCFieldContainer source, DCFieldContainer dest, StringField attrList)
        This will replace the specified attributes in the destination with those in the source. If any source attributes do not exist, the correcponding destination attributes will not be altered.
        See Also:
      • replaceAttributeSet

        public void replaceAttributeSet(DCFieldContainer source, DCFieldContainer dest, StringField attrSetName)
        This will replace the specified attributes in the destination with those in the source. If any source attributes do not exist, the correcponding destination attributes will not be altered.
        See Also:
      • replaceAttributesWithDelete

        public void replaceAttributesWithDelete(DCFieldContainer source, DCFieldContainer dest, StringField attrList)
        This will replace the specified attributes in the destination with those in the source. If any source attributes do not exist, the correcponding destination attributes will be removed.
        See Also:
      • replaceAttributeSetWithDelete

        public void replaceAttributeSetWithDelete(DCFieldContainer source, DCFieldContainer dest, StringField attrSetName)
        This will replace the specified attributes in the destination with those in the source. If any source attributes do not exist, the correcponding destination attributes will be removed.
        See Also:
      • distributeTrafficVolumesPerDay

        public IntField distributeTrafficVolumesPerDay(DCFieldContainer inContainer, StringField trafficVolumesID, DCFieldContainer destContainer, StringField uplinkVolumeAttrs, StringField downlinkVolumeAttrs, StringField openingTimeId)
        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 a 0. 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, 1 is returned. The volumes are distributed according to their opening time. The first container's opening time is the record's opening time, specified by the openingTimeId for the inContainer. Each subsequent container's opening time is the closing time in the previous. If the volumes cross the midnight boundary, the end time for the last processed container is inserted into the record opening time ID.
      • distributeTrafficVolumeSetPerDay

        public IntField distributeTrafficVolumeSetPerDay(DCFieldContainer inContainer, StringField trafficVolumesID, DCFieldContainer destContainer, StringField uplinkSetName, StringField downlinkSetName, StringField openingTimeId)
      • removeAttributes

        public void removeAttributes(DCFieldContainer inContainer, StringField attributeIDs)
        This will remove all the indicated attributes from the given NAR.
      • removeAttributeSet

        public void removeAttributeSet(DCFieldContainer inContainer, StringField setName)
        This will remove all the indicated attributes from the given NAR.
      • generateOpeningTimeFromTrafficVolume

        public BytesField generateOpeningTimeFromTrafficVolume(ListField trafficVolumes)
        Will return the day of the year for the first traffic volume.
      • addDateStamp

        public void addDateStamp(DCFieldContainer in)
      • copyTrafficVolumeQoS

        public void copyTrafficVolumeQoS(DCFieldContainer mod, DCFieldContainer source, StringField name, StringField trafficVolumesName)
      • testCall

        public void testCall()
      • handleSequenceNumberConversion

        public void handleSequenceNumberConversion(DCFieldContainer in, DCFieldContainer out, StringField name, StringField recordNumberListName, StringField resultName, StringField ipAddrName, StringField ipAddrSourceName)
      • incrementAggregatedCount

        public void incrementAggregatedCount()
      • incrementDuplicateCount

        public void incrementDuplicateCount()
      • clearStoredRecordFlag

        public void clearStoredRecordFlag()
      • hasRecordBeenStored

        public boolean hasRecordBeenStored()
      • resetNarKeys

        public void resetNarKeys()
        new method for MXNPLFieldProcessor to call at the beginning of each new record, before it gets processed.