Class DCNode

java.lang.Object
com.nt.udc.ndk.node.DCNode
All Implemented Interfaces:
AdminIfc, ConfigIfc, LoggerIfc, NodeHealthIfc, NodeStateManagementIfc, PropertyIfc, StateManagementIfc
Direct Known Subclasses:
EINode, MXAggregatorNode, OINode, PartitionedDCNode, ProcessorNode

public abstract class DCNode extends Object implements AdminIfc, ConfigIfc, LoggerIfc, NodeHealthIfc, PropertyIfc, NodeStateManagementIfc
  • Field Details

    • DEFAULT_PROCESSING_INTERVAL

      public static final long DEFAULT_PROCESSING_INTERVAL
      See Also:
    • OCOMC_POD_NAME

      public static final String OCOMC_POD_NAME
      See Also:
    • KUBERNETES_POD_NAME

      public static final String KUBERNETES_POD_NAME
      See Also:
    • OCOMC_NODE_ID

      public static final String OCOMC_NODE_ID
      See Also:
    • OCOMC_REPLICA_INDEX

      public static final String OCOMC_REPLICA_INDEX
      See Also:
    • OCOMC_STS_NAME

      public static final String OCOMC_STS_NAME
      See Also:
    • logger

      protected Logger logger
      An instance of a LoggerIfc class that will be used to write data to the log file.
    • config

      protected ConfigIfc config
      An instance of a ConfigIfc class. When instantiated, this class reads the configuration file that is sent as an argument to this program and stores all the configuration parameters in the file. The generated configuation table is sent to all other data collector functions as constructor parameters.
    • fileMngr

      protected DCStreamHandler fileMngr
      The DCStreamHandler class manages all access to all streams/files that are used to transfer data between nodes.
      Currently, this provides file management capabilities.
    • dcHandls

      protected ArrayList<DCStreamHandler> dcHandls
    • processingInterval

      protected long processingInterval
      Time interval at which the node will check for data. Default is 20 seconds.
    • udcHome

      protected File udcHome
    • configFile

      protected File configFile
    • configDir

      protected File configDir
    • scratchDir

      protected File scratchDir
    • backupDir

      protected File backupDir
    • logDir

      protected File logDir
    • suspenseDir

      protected File suspenseDir
    • nodeid

      protected String nodeid
    • majorType

      protected String majorType
    • minorType

      protected String minorType
    • configClass

      protected String configClass
    • configGUIClass

      protected String configGUIClass
    • shutdown

      protected boolean shutdown
      Indicates whether the node is running
    • nodeStartTime

      protected long nodeStartTime
      Time in millis that the node started
    • reconfiguring

      protected boolean reconfiguring
      Indicates whether the node is being reconfigured
    • node_pm

      protected DCNodePerformance node_pm
    • NODEINIT

      public static final String NODEINIT
    • NODERECONFIG

      public static final String NODERECONFIG
    • savingStateOn

      protected boolean savingStateOn
    • stateManager

      protected StateManager stateManager
    • nodeStateFileName

      protected static String nodeStateFileName
    • inputMonitoringEnabled

      protected boolean inputMonitoringEnabled
    • inputMonitoringSilenceInterval

      protected long inputMonitoringSilenceInterval
    • generalMonitoringTimer

      protected Timer generalMonitoringTimer
    • inputMonitoringAlarmRaised

      protected boolean inputMonitoringAlarmRaised
    • inputMonitoringPreviousCount

      protected long inputMonitoringPreviousCount
    • inputMonitoringNARFileMgr

      protected NARStreamHandler inputMonitoringNARFileMgr
    • inputMonitoringPollingInterval

      protected long inputMonitoringPollingInterval
    • inputMonitoringSilenceCounter

      protected long inputMonitoringSilenceCounter
    • inputMonitoringSilenceIntervalText

      protected String inputMonitoringSilenceIntervalText
    • TRANSACTION_NAR_ID

      public static final String TRANSACTION_NAR_ID
      See Also:
  • Constructor Details

    • DCNode

      public DCNode()
      Default Constructor; instantiates objects necessary to define the DCNodeTypeIfc methods.
    • DCNode

      public DCNode(String[] args) throws NodeStartException
      Constructor for the class used to instantiate all objects needed by this node. Sets up directory space for this node under the following directories below udcHome :
        invalid input: '&nbsp' /backup
        invalid input: '&nbsp' /config
        invalid input: '&nbsp' /log
        invalid input: '&nbsp' /scratch
      Parameters:
      args - Values are as follows:
         arg[0]    Numeric identifier for this node.
         arg[1]    Directory location for the UDC installation (udcHome). All sub-directories created for the node will reside below this directory.
         arg[2]    Location of this node's Configuration file
      Throws:
      NodeStartException
  • Method Details

    • createCounters

      public void createCounters(String nodeID)
    • initialize

      public void initialize() throws NodeStartException
      Specified by:
      initialize in interface AdminIfc
      Throws:
      NodeStartException
    • addNodeEventListener

      public void addNodeEventListener(NodeEventListener nodeEventListener)
    • getNodeEventListeners

      public List getNodeEventListeners()
    • getDCNodeType

      public DCNodeTypeIfc getDCNodeType()
    • getLogger

      public LoggerIfc getLogger()
      Returns the node's logger.
    • setConfig

      public void setConfig(ConfigIfc c)
      Sets the node's configuration Object.
    • getConfig

      public ConfigIfc getConfig()
      Returns the node's configuration Object.
    • setStreamHandler

      public void setStreamHandler(DCStreamHandler sh)
      Sets the node's stream handler.
    • setStreamHandler

      public void setStreamHandler(DCStreamHandler sh, int i)
    • getStreamHandler

      public DCStreamHandler getStreamHandler()
      Returns the node's stream handler.
    • getStreamHandler

      public DCStreamHandler getStreamHandler(int i)
    • getHomeDir

      public File getHomeDir()
      Returns the node's home directory.
    • getConfigFile

      public File getConfigFile()
      Returns the node's configuration file.
    • getConfigDir

      public File getConfigDir()
      Returns the node's configuration directory.
    • getScratchDir

      public File getScratchDir()
      Returns the node's scratch directory.
    • getBackupDir

      public File getBackupDir()
      Returns the node's backup directory.
    • getSuspenseDir

      public File getSuspenseDir()
      Returns the node's suspense directory.
    • getLogDir

      public File getLogDir()
      Returns the node's log directory.
    • backup

      public void backup()
      Empty implementation
    • getNodeId

      public String getNodeId()
      Returns Node's ID
      Returns:
      null
    • getPerformanceMetrics

      public DCNodePerformanceIfc getPerformanceMetrics()
      Returns the stream handler's node performance object
      Specified by:
      getPerformanceMetrics in interface AdminIfc
      Returns:
      DCNodePerformanceIfc object
    • shutdown

      public void shutdown()
      Performs all necessary functions to stop this node and any processes that it has created.
      Specified by:
      shutdown in interface AdminIfc
    • clearStatus

      public void clearStatus()
      Clears the status table for the node
      Specified by:
      clearStatus in interface AdminIfc
      Specified by:
      clearStatus in interface LoggerIfc
    • clearStatus

      public void clearStatus(StatusMessage sm)
      RMI method that clears the worst status currently in existence for the node.
    • getStatus

      public StatusMessage getStatus()
      RMI call that returns the most recent worst status that currently exists for the node.
      Specified by:
      getStatus in interface AdminIfc
      Returns:
      StatusMessage reflecting the most recent, worst status for this node.
    • reconfigure

      public void reconfigure() throws NodeStartException
      Call that reconfigures a DC node process. This method performs node reconfiguration processing specific to a DCNode object. Derived classes that need to perform their own reconfiguration processing should override reconfigure() and then call this method from there. This method sets a flag indicating this node is in the reconfiguration state. The most derived class should use the setIsReconfiguringFlag method just before returning from its reconfigure() method to set the reconfiguration state to false.
      Specified by:
      reconfigure in interface AdminIfc
      Throws:
      NodeStartException
    • startup

      public void startup() throws NodeStartException
      Call that starts a node. This method performs startup processing specific to a DCNode object. Derived classes that need to perform their own startup processing should override startup() and then call this method first from there.
      Specified by:
      startup in interface AdminIfc
      Throws:
      NodeStartException
    • isReconfigPending

      public boolean isReconfigPending()
      RMI call that indicates if a reconfigure operation is pending in an DC process. Empty method.
      Returns:
      false
    • getItem

      public String getItem(String key)
      Retrieves a configuration value for this node for the given key
      Specified by:
      getItem in interface ConfigIfc
      Parameters:
      key - String name of the desired configuration parameter value
      Returns:
      Value for the given key, null if the value could not be found, or the key does not exist.
    • setItem

      public void setItem(String key, String value)
      Sets a configuration value for this node with the given key
      Specified by:
      setItem in interface ConfigIfc
      Parameters:
      key - String name of the desired configuration parameter value
      value - value to store
    • getProperty

      public String getProperty(String type, String key)
      Retrieves the property value for the specified type and key.
      Specified by:
      getProperty in interface PropertyIfc
      Parameters:
      type - A String indicating the subset to which the property belongs (i.e. environment, runtime, etc.)
      key - A String indicating the specific property to be retrieved
      Returns:
      The value of the specified property, or null if the property has not been set
    • getPropertyTypes

      public String[] getPropertyTypes()
      Retrieve a list of 'property type' subsets.
      Specified by:
      getPropertyTypes in interface PropertyIfc
      Returns:
      A String[] of the various 'types' of properties
    • getPropertyKeys

      public String[] getPropertyKeys(String type)
      Retrieve a list of 'property keys' for the given type subset.
      Specified by:
      getPropertyKeys in interface PropertyIfc
      Returns:
      A String[] containing the various 'keys' for the given type
    • setProperty

      public void setProperty(String type, String key, String value) throws IllegalArgumentException
      Set the property value for the specified type and key.
      Specified by:
      setProperty in interface PropertyIfc
      Parameters:
      type - A String indicating the subset the property to which the property belongs (i.e. init, runtime, etc.)
      key - A String indicating the specific property to be set
      value - The value of the property to be set. A null value will cause the current property to be unset.
      Throws:
      IllegalArgumentException - if type or key is null
    • logError

      public void logError(String message, boolean autoClear, Exception exception)
      Description copied from interface: LoggerIfc
      Do NOT use this method for Release 3.3 or later. Logs an Error message (which is indicated with a red alarm) with the given text and clearing capabilities.
      Specified by:
      logError in interface LoggerIfc
      Parameters:
      message - Desired text for the error message to be written into the log file.
      autoClear - if true, this message will clear any previous alarm in the system, otherwise a red alarm and an error message will be logged.
      exception - The exception which causes this alarm.
      See Also:
    • logWarning

      public void logWarning(String message, boolean autoClear, Exception exception)
      Description copied from interface: LoggerIfc
      Do NOT use this method for Release 3.3 or later. Logs a Warning message (which is indicated with a yellow alarm) with the given text and clearing capabilities
      Specified by:
      logWarning in interface LoggerIfc
      Parameters:
      message - Desired text for the error message to be written into the log file.
      autoClear - if true, this message will clear any previous alarm in the system, otherwise a yellow alarm and an warning message will be logged.
      exception - The exception which causes this alarm.
      See Also:
    • logInfo

      public void logInfo(String message, Exception exception)
      Description copied from interface: LoggerIfc
      Logs an informational message (no alarm is generated)
      Specified by:
      logInfo in interface LoggerIfc
      Parameters:
      message - Desired text for the error message to be written into the log file.
      exception - The exception which causes this alarm
    • isDebugEnabled

      public boolean isDebugEnabled()
      Specified by:
      isDebugEnabled in interface LoggerIfc
    • isInfoEnabled

      public boolean isInfoEnabled()
      Specified by:
      isInfoEnabled in interface LoggerIfc
    • logDebug

      public void logDebug(String message, Exception exception)
      Specified by:
      logDebug in interface LoggerIfc
    • logTrace

      public void logTrace(String message, Exception exception)
      Description copied from interface: LoggerIfc
      Logs a trace message (no alarm is generated). This message will only be written out if the debugLevel is set appropriately via the node's configuration at runtime.
      Specified by:
      logTrace in interface LoggerIfc
      Parameters:
      message - Desired text for the error message to be written into the log file.
      exception - The exception which causes this exception
    • logCritical

      public void logCritical(String faultCategory, String specificFault, String additionalFaultText, Exception exception)
      Description copied from interface: LoggerIfc
      Logs a Critical Error message (which is indicated with a red alarm) with the given text. The Critical severity level indicates that a service affecting condition has occurred and an immediate corrective action is required. Such a severity can be reported, for example, when a managed object becomes totally out of service and its capability must be restored.
      Specified by:
      logCritical in interface LoggerIfc
      Parameters:
      faultCategory - A general category of the error. One of Initialization, Configuration, Connectivity Invalid data, Resources, Internal Error
      specificFault - A clearly worded description of this fault condition, with NO variable component (i.e. node names, port numbers, time stamps, etc.).
      additionalFaultText - Any desirable additional text. The variable information.
      exception - exception which causes this critical issue.
    • logMajor

      public void logMajor(String faultCategory, String specificFault, String additionalFaultText, Exception exception)
      Description copied from interface: LoggerIfc
      Logs a Major Error message (which is indicated with a Orange alarm) with the given text. The Major severity level indicates that a service affecting condition has developed and an urgent corrective action is required. Such a severity can be reported, for example, when there is a severe degradation in the capability of the managed object and its full capability must be restored.
      Specified by:
      logMajor in interface LoggerIfc
      Parameters:
      faultCategory - A general category of the error. One of Initialization, Configuration, Connectivity Invalid data, Resources, Internal Error
      specificFault - A clearly worded description of this fault condition, with NO variable component (i.e. node names, port numbers, time stamps, etc.).
      additionalFaultText - Any desirable additional text. The variable information.
      exception - Exception which causes this major issue.
    • logMinor

      public void logMinor(String faultCategory, String specificFault, String additionalFaultText, Exception exception)
      Description copied from interface: LoggerIfc
      Logs a Minor Error message (which is indicated with a yellow alarm) with the given text. The Minor severity level indicates the existence of a non-service affecting fault condition and that corrective action should be taken in order to prevent a more serious (for example, service affecting) fault. Such a severity can be reported, for example, when the detected alarm condition is not currently degrading the capacity of the managed object.
      Specified by:
      logMinor in interface LoggerIfc
      Parameters:
      faultCategory - A general category of the error. One of Initialization, Configuration, Connectivity Invalid data, Resources, Internal Error
      specificFault - A clearly worded description of this fault condition, with NO variable component (i.e. node names, port numbers, time stamps, etc.).
      additionalFaultText - Any desirable additional text. The variable information.
      exception - Exception which causes this minor issue
    • logWarning

      public void logWarning(String faultCategory, String specificFault, String additionalFaultText, Exception exception)
      Description copied from interface: LoggerIfc
      Logs a Warning message (which is indicated with a blue alarm) with the given text. The Warning severity level indicates the detection of a potential or impending service affecting fault, before any significant effects have been felt. Action should be taken to further diagnose (if necessary) and correct the problem in order to prevent it from becoming a more serious service affecting fault.
      Specified by:
      logWarning in interface LoggerIfc
      Parameters:
      faultCategory - A general category of the error. One of Initialization, Configuration, Connectivity Invalid data, Resources, Internal Error
      specificFault - A clearly worded description of this fault condition, with NO variable component (i.e. node names, port numbers, time stamps, etc.).
      additionalFaultText - Any desirable additional text. The variable information.
      exception - Exception which causes this warning
    • clearStatus

      public void clearStatus(String faultCategory, String specificFault)
      Description copied from interface: LoggerIfc
      Clears all log messages with a given fault category, and specific fault type.
      Specified by:
      clearStatus in interface LoggerIfc
    • getMajorType

      public abstract String getMajorType()
    • getMinorType

      public abstract String getMinorType()
    • getConfigDataGuiClass

      public abstract String getConfigDataGuiClass()
    • getConfigDataClass

      public String getConfigDataClass()
      Returns:
      "com.nt.udc.ndk.gui.DCNodeConfigData"
    • getDisplayString

      public final String getDisplayString()
      Returns:
      Values of getMajorType() and getMinorType() separated by a colon.
    • getNodeClass

      public final String getNodeClass()
      Returns:
      Value of getClass().getName()
    • warmRestartImplemented

      public boolean warmRestartImplemented()
      Returns:
      boolean indicating if the node implements a warm restart capability
    • setDCStreamHandler

      public void setDCStreamHandler(DCStreamHandler handler)
      Sets the DCStreamHandler object that this node is using for inter-node communication.
      Parameters:
      handler - DCStreamHandler that this node should use
    • setDCStreamHandler

      public void setDCStreamHandler(DCStreamHandler handler, int i)
    • getDCStreamHandler

      public DCStreamHandler getDCStreamHandler()
      Returns the DCStreamHandler object that this node is using for inter-node communication.
      Returns:
      DCStreamHandler that this node should use
    • getDCStreamHandler

      public DCStreamHandler getDCStreamHandler(int i)
    • saveState

      public void saveState(Callback stateFinishedCallback)
      Tells the Node to save its state to disk.
      Specified by:
      saveState in interface StateManagementIfc
      Parameters:
      stateFinishedCallback - An Object to notify when the state has been successfully saved.
    • saveState

      public void saveState()
      Tells the Node to save its state to disk.
      Specified by:
      saveState in interface StateManagementIfc
    • restoreState

      public void restoreState()
      Tells the Node to restore its state from disk.
      Specified by:
      restoreState in interface StateManagementIfc
    • isNodeStateUsed

      public boolean isNodeStateUsed()
      Returns whether the node state is used (and whether the node can be recovered.)
      Specified by:
      isNodeStateUsed in interface NodeStateManagementIfc
      Returns:
      true, if node state is being used
    • isStateUsed

      public boolean isStateUsed()
      Returns whether the node state is used (and whether the node can be recovered.)
      Specified by:
      isStateUsed in interface StateManagementIfc
      Returns:
      true, if node state is being used
    • getStateManagementType

      public StateManagementType getStateManagementType()
      Returns the type of state management this node is using.
      Specified by:
      getStateManagementType in interface StateManagementIfc
      Returns:
      appropriate StateManagementType
    • getNodeStateManager

      public StateManager getNodeStateManager()
      Returns the Node's StateManager object.
      Specified by:
      getNodeStateManager in interface NodeStateManagementIfc
      Returns:
      StateManager object
    • getStateManager

      public StateManager getStateManager()
      Returns the Node's StateManager object.
      Specified by:
      getStateManager in interface StateManagementIfc
      Returns:
      StateManager object
    • isNodeStateImplemented

      public boolean isNodeStateImplemented()
      Returns whether the derived node can save and restore its state.
      Returns:
      true, if node implements node state save and restore
    • isShutdown

      protected boolean isShutdown()
      Indicates whether the node is running, by returning the value of shutdown
      Returns:
      True, if the node has been stopped.
    • shuttingDown

      protected void shuttingDown()
      This method is should be overridden if a particular derived node needs to do some processing just prior to the node being shut down. Default implementation does nothing.
    • setSNMPTrapGenerator

      protected void setSNMPTrapGenerator(SnmpTrapSenderIfc stg)
      This method allows the node to set it's SNMP Trap Generator, so that when severe messages are sent to the logger they can be sent to SNMP Trap Hosts that are listening.
      Parameters:
      stg - The Snmp_Trap_APIInterface implementation that is being used to send SNMP traps.
    • isReconfiguring

      protected boolean isReconfiguring()
      Indicates whether the node is being reconfigured for warm restart.
      Returns:
      True, if the node is being reconfigured for warm restart.
    • setIsReconfiguringFlag

      protected void setIsReconfiguringFlag(boolean value)
      Set value of reconfiguring flag to true or false. This method is provided to allow derived classes to have control over when the node is in the state of being reconfigured.
    • shutdownDCStreamHandler

      protected void shutdownDCStreamHandler()
      Shutdown the DCStreamHandler. The DCStreamHandler should continue to run until all data has been received, and processed, from the FieldProcessor.
    • isHealthy

      public boolean isHealthy()
      This method is part of the NodeHealthIfc interface. It is to be sub-classed by children to account for node-specific criteria of determining a node's state of health.
      Specified by:
      isHealthy in interface NodeHealthIfc
      Returns:
      true if the node is fully functional (healthy), false otherwise
    • registerThreadForHealthMonitoring

      public void registerThreadForHealthMonitoring(Thread t)
      This method is part of the NodeHealthIfc interface. It is called to register a node for health monitoring.
      Specified by:
      registerThreadForHealthMonitoring in interface NodeHealthIfc
    • unregisterThreadFromHealthMonitoring

      public void unregisterThreadFromHealthMonitoring(Thread t)
      This method is part of the NodeHealthIfc interface. It is called to unregister a node from health monitoring.
      Specified by:
      unregisterThreadFromHealthMonitoring in interface NodeHealthIfc
    • inputMonitoringCallback

      public void inputMonitoringCallback()
      Default behaviour is to check the NARFileManager's input to see if anything has changed, and either raise or clear the Silent Input alarm. May be overridden by subclasses to do something else.
    • inputMonitoringPollInputCounter

      public long inputMonitoringPollInputCounter()
    • getInputStatsProcessor

      public InputStatisticsMonitorIfc getInputStatsProcessor()
      Get the input record Statistics Monitor.
      Returns:
    • getOutputStatsProcessor

      public OutputStatisticsMonitorIfc getOutputStatsProcessor()
      Get the output record Statistics Monitor.
      Returns:
    • getStoredStatsProcessor

      public StoredStatisticsMonitorIfc getStoredStatsProcessor()
    • getDuplicateStatsProcessor

      public DuplicateStatisticsMonitorIfc getDuplicateStatsProcessor()
    • getDiscardedStatsProcessor

      public DiscardedStatisticsMonitorIfc getDiscardedStatsProcessor()
    • getAndResetRecordStatistics

      public ReadOnlyStatisticsMonitorIfc getAndResetRecordStatistics()
      Description copied from interface: AdminIfc
      Retrieves record statistics for this node. (Record statistics are different from performance information, in that the record statistics get reset to 0 periodically, usually every hour.)
      Specified by:
      getAndResetRecordStatistics in interface AdminIfc
      Returns:
      An object that contains the statistics for the previous polling period.
    • rejectTransaction

      public void rejectTransaction(String transactionId)
    • isRejectTransaction

      public boolean isRejectTransaction()
    • getRejectTransactionId

      public String getRejectTransactionId()