Class DCNodeConfigGUI

All Implemented Interfaces:
DCNodeConfigGUIIfc, ImageObserver, MenuContainer, Serializable, Accessible
Direct Known Subclasses:
EINodeConfigGUI, OINodeConfigGUI, ProcessorNodeConfigGUI

public abstract class DCNodeConfigGUI extends JPanel implements DCNodeConfigGUIIfc
See Also:
  • Field Details

    • tabbedPane

      protected JTabbedPane tabbedPane
      Tabbed pane which contains all of the panels needed for configuring a particular node.
    • narBackupBox

      protected JCheckBox narBackupBox
      Used to determine whether the input NAR files for this node should be backed up.
    • bulkIOCheckBox

      protected JCheckBox bulkIOCheckBox
      This field is used to determine if entire nar file data would be held in memory before writing to file or while reading from file.
    • fileLevelTransactionLabel

      protected static String fileLevelTransactionLabel
      Label string for fileLevelTransactionCheckBox
    • fileLevelTransCheckBox

      protected JCheckBox fileLevelTransCheckBox
      This field is used to determine if the cartridge participates in file level transaction node chain This field will not be added to the default tab, any cartridge wanting to to have file level transaction functionality should add this field to extended UI panel
    • fileLevelTransactionJLable

      protected JLabel fileLevelTransactionJLable
    • narBackupLabel

      protected static String narBackupLabel
      Label string for narBackupBox
    • narBackupDaysField

      protected com.nt.common.gui.SMGIntField narBackupDaysField
      Number of days to retain NAR files in backup directory.
    • narBackupDaysLabel

      protected static String narBackupDaysLabel
      Label string for narBackupDaysField
    • backupBox

      protected JCheckBox backupBox
      Used to determine whether the raw data for this node (not NAR data) should be backed up periodically.
    • backupLabel

      protected String backupLabel
      Label string for backupBox
    • inputMonitorEnableField

      protected JCheckBox inputMonitorEnableField
      Check to turn on silent input monitoring
    • inputMonitorTimeField

      protected UDCNumericField inputMonitorTimeField
      Number input field, minimum silent input time interval to wait before generating an alarm
    • inputMonitorTimeUnitsField

      protected JComboBox inputMonitorTimeUnitsField
      The time units used for the inputMonitorTimeField
    • recordCountEnableField

      protected JCheckBox recordCountEnableField
      Used to turn on/off the Record Statistics Counter feature
    • nodeConfig

      protected DCNodeConfigData nodeConfig
      Object which will contain the configuration values for a given node that were provided by the user in this GUI.
    • nodeFieldsDirty

      protected boolean nodeFieldsDirty
      Indicates whether the user has altered any fields in this GUI.
    • destGUI

      protected NodeDestinationsGUI destGUI
      Indicates whether this node is routing its output to other nodes.
    • defaultFont

      protected static final Font defaultFont
  • Constructor Details

    • DCNodeConfigGUI

      public DCNodeConfigGUI()
      Default constructor
    • DCNodeConfigGUI

      public DCNodeConfigGUI(DCNodeConfigData ncd)
      Initializes nodeConfig with the given DCNodeConfigData object and sets up the GUI components. This method calls init() before any abstract methods are called to allow derived classes to perform any necessary initialization. This method then calls setDefaults() and then addGUIComponents().
      Parameters:
      ncd - DCNodeConfigData object to be used for storing information provided by the user in this GUI.
  • Method Details

    • init

      protected void init()
      Allows derived classes to perform any necessary initialization before any abstract methods are called. Base class provides an empty implementation.
    • makePanel

      protected static JPanel makePanel(Vector labels, Vector components)
      Creates a panel which contains the given components with the given labels. Using the default label alignment of SwingConstants.RIGHT
    • makePanel

      protected static JPanel makePanel(Vector labels, Vector components, int alignment)
      Creates a panel which contains the given components with the given labels. Using the given alignment for the labels.
    • allFieldsValid

      public boolean allFieldsValid()
      Check and warn the user if the Input Stream Monitoring interval will last longer than one week.
      Specified by:
      allFieldsValid in interface DCNodeConfigGUIIfc
      Returns:
      true if either the input stream monitoring interval is less than one week, or that the user is OK with the interval longer than one week.
    • isAnyConfigAction

      public boolean isAnyConfigAction()
      If user needs to perform any config action then this method needs to be override in the NodeConfigGUI class to return true.
      Specified by:
      isAnyConfigAction in interface DCNodeConfigGUIIfc
    • getConfigActionObject

      public ConfigActionIfc getConfigActionObject()
      Be default returns false. If some config action needs to be performed while configuring node then this method should return the ConfigActionIfc object.
      Specified by:
      getConfigActionObject in interface DCNodeConfigGUIIfc
    • getDCNodeConfigData

      public DCNodeConfigData getDCNodeConfigData()
      Populates the DCNodeConfigData Object with values from fields contained in the "General" tab panel which includes the debugLevel, maxLogFileSize, recordStatistics and backup fields.
      Calls the derived class's getNodeSpecificConfigData() method to pick up any derived node specific configuration items.
      Specified by:
      getDCNodeConfigData in interface DCNodeConfigGUIIfc
    • hasDestinations

      public boolean hasDestinations()
      Indicates whether the node can send output to other nodes.
      true for EI and Processor nodes. Default returns false.
      Specified by:
      hasDestinations in interface DCNodeConfigGUIIfc
      Returns:
      false
    • getDestinations

      public final Vector getDestinations()
      Returns a Vector of NodeInfo objects representing the nodes that will receive output from the node being configured by this GUI.
      Specified by:
      getDestinations in interface DCNodeConfigGUIIfc
      Returns:
      Vector of NodeInfo objects
    • setDestinations

      public final void setDestinations(Vector inTargets)
      Description copied from interface: DCNodeConfigGUIIfc
      Accepts a Vector of NodeInfo objects representing one or more nodes that the user has selected as a destination for this node's output. (That is, the node that is being configured by this DCNodeConfigGUIIfc object.)
      This method will only be called if hasDestinations() returns true.
      Specified by:
      setDestinations in interface DCNodeConfigGUIIfc
      Parameters:
      inTargets - Vector of NodeInfo objects
    • getNodeId

      public final String getNodeId()
      Description copied from interface: DCNodeConfigGUIIfc
      Returns the node identifier for the node that is being configured by this DCNodeConfigGUIIfc object.
      Specified by:
      getNodeId in interface DCNodeConfigGUIIfc
      Returns:
      null, if nodeId has not been set using setNodeId()
    • setNodeId

      public final void setNodeId(String inNodeId)
      Description copied from interface: DCNodeConfigGUIIfc
      Sets the node identifier for the node that is being configured by this DCNodeConfigGUIIfc object.
      Specified by:
      setNodeId in interface DCNodeConfigGUIIfc
      Parameters:
      inNodeId - String representing the node id
    • setNodeInfo

      public final void setNodeInfo(com.nt.udc.admin.NodeInfo ni)
      Description copied from interface: DCNodeConfigGUIIfc
      Sets the current node info
      Specified by:
      setNodeInfo in interface DCNodeConfigGUIIfc
      Parameters:
      ni - Current NodeInfo object
    • getDebugLevel

      public String getDebugLevel()
      Retrieves the value that the user has entered for the "Debug Level" field. Valid values are:
         OFF    None - no messages are logged
         ON    Messages are logged with Exception trace if the cause is an Exception
    • setDebugLevel

      public void setDebugLevel(String value)
      Sets the value to display in the "Debug Level" field. Valid values are:
         OFF    None - no messages are logged
         ON    Messages are logged with Exception trace if the cause is an Exception
    • addNarBackupCheckbox

      public void addNarBackupCheckbox(com.nt.common.gui.SMGJLCPanel panel)
      Adds the "Backup NAR Files" checkbox to the "General" tab panel
    • getNarBackupValue

      public boolean getNarBackupValue()
      Indicates whether the user has checked the "Backup NAR Files" checkbox
    • setNarBackupValue

      public void setNarBackupValue(boolean value)
      Sets the value of the "Backup NAR Files" checkbox
    • getNarBackupDaysValue

      public int getNarBackupDaysValue()
      Returns the number of days to retain the NAR files in the node's backup directory
    • setNarBackupDaysValue

      public void setNarBackupDaysValue(int value)
      Sets the value of the "NAR File Retention Period"
    • enableBackupCheckbox

      protected void enableBackupCheckbox()
      Displays the "Backup Node Data" checkbox in the "General" tab
    • disableBackupCheckbox

      protected void disableBackupCheckbox()
      Hides the "Backup Node Data" checkbox in the "General" tab
    • getBackupValue

      public boolean getBackupValue()
      Indicates whether the user has checked the "Backup Node Data" checkbox
    • setBackupValue

      public void setBackupValue(boolean value)
      Sets the value of the "Backup Node Data" checkbox
    • getMaxLogSizeValue

      public int getMaxLogSizeValue()
      Returns the value of the "Max Log File Size" field.
      If a message needs to be logged which causes this value to be exceeded, the log file will be moved to an archive file and a new log file will be started.

      Default maximum value is DCNodeConfigDefaults.MAX_LOG_FILE_SIZE

    • setMaxLogSizeValue

      public void setMaxLogSizeValue(int size)
      Sets the value of the "Max Log File Size" field.
      If a message needs to be logged which causes this value to be exceeded, the log file will be moved to an archive file and a new log file will be started.

      Default maximum value is DCNodeConfigDefaults.MAX_LOG_FILE_SIZE

    • setMaxValueForLogSize

      public void setMaxValueForLogSize(int maxValue)
      Sets the maximum value that the user may enter in the "Max Log File Size:" field.
    • getNodeDestinationsGUI

      public NodeDestinationsGUI getNodeDestinationsGUI()
      Description copied from interface: DCNodeConfigGUIIfc
      Returns the existing node destinations GUI
      Specified by:
      getNodeDestinationsGUI in interface DCNodeConfigGUIIfc
    • getMinLogFileSize

      public int getMinLogFileSize()
    • getMaxLogFileSize

      public int getMaxLogFileSize()
    • setMinLogFileSize

      public void setMinLogFileSize(int min)
    • setMaxLogFileSize

      public void setMaxLogFileSize(int max)
    • addGUIComponents

      protected void addGUIComponents()
      Sets the layout for this panel to a BorderLayout. Calls makeNodePanel to layout the necessary panels for this GUI, including any node specific panels, and adds tabbedPane as the BorderLayout.CENTER component and calls validate().
    • setPanelsTab

      protected void setPanelsTab(JPanel nodePanel)
    • addPanel

      protected void addPanel(String label, JPanel new_panel)
      Adds a panel to tabbedPane with the given label.
      Parameters:
      label - Name for the panel
      new_panel - Panel to be added
    • addScrollPanel

      protected void addScrollPanel(String label, JPanel new_panel, int height, int unit_inc)
      Adds a panel in a ScrollPane to tabbedPane with the given label.
      Parameters:
      label - Name for the panel
      new_panel - Panel to be added
      height - Preferred Height for the Scroll Pane
      unit_inc - Unit Increment value for the scroll bars (if non-zero)
    • makeNodePanel

      protected JPanel makeNodePanel()
      Lays out the configuration panels for this GUI.
      Allows the user to set values for the following fields:
    • addInputMonitoringFieldsToPanel

      protected void addInputMonitoringFieldsToPanel(com.nt.common.gui.SMGJLCPanel panel)
      Adds a checkbox, a number input box, and a combo box to the general tab panel. These 3 fields are the input to the Input Monitoring feature.
      Parameters:
      panel - This should be the General Tab Panel.
    • makeTextField

      protected JTextField makeTextField(String contents, String toolTip)
      Returns:
      value of makeTextField() with a size of 5 and editable set to true
    • makeTextField

      protected JTextField makeTextField(String contents, int size, boolean editable, String toolTip)
      Creates a JTextField of the given size with the given properties.
      Parameters:
      contents - Text, if any, to display in the text field
      size - Width of the text field
      editable - Indicates whether the contents of the field may be changed by the user
      toolTip - String to display when the user's cursor lingers over the field
    • defaultValue

      public void defaultValue(String name, String value)
      Sets the default value for the given configuration item.
    • defaultValue

      public void defaultValue(String name, long value, long min, long max)
      Sets the default value for the given configuration item, and will enforce the value to be within the specified range.
      Parameters:
      name - name of the configuration item to be set
      value - desired "default" value for this item
      min - minimum value for this item
      max - maximum value for this item
    • setConfigRange

      public void setConfigRange(String name, long min, long max)
      Sets the range of values for the given configuration item.
      Parameters:
      name - name of the configuration item to set the range for
      min - minimum value for this item
      max - maximum value for this item
    • getMinValue

      public Long getMinValue(String name)
      Returns the minimum value for the given configuration item. Returns null, if no range has been set for the specified item.
    • getMaxValue

      public Long getMaxValue(String name)
      Returns the maximum value for the given configuration item. Returns null, if no range has been set for the specified item.
    • makeNumericTextField

      protected JTextField makeNumericTextField(String contents, String toolTip)
      Creates an editable JTextField containing the given value with the specified tool tip. By default, the column width is 5, minimum value is 0, and maximum is Long.MAX_VALUE.
      Parameters:
      contents - Text, if any, to display in the text field
      toolTip - String to display when the user's cursor lingers over the field
    • makeNumericTextField

      protected JTextField makeNumericTextField(String contents, String toolTip, int maxValue)
      Creates an editable JTextField containing the given value with the specified tool tip. The column width is 5, and the given maximum value is imposed. The minimum value is 0.
      Parameters:
      contents - Text, if any, to display in the text field
      toolTip - String to display when the user's cursor lingers over the field
      maxValue - Indicates the maximum value that the user may enter in the field.
    • makeNumericTextField

      protected JTextField makeNumericTextField(String contents, String toolTip, long minValue, long maxValue)
      Creates an editable JTextField containing the given value with the specified tool tip. The column width is 5, and the given minimum or maximum values are imposed.

      Validation is performed when the component loses focus. If the user enters a value that is non-numeric or is less than the given minimum value, the minimum value will be used (and displayed in the textfield). If the user enters a value greater than the maximum value, the maximum value will be used.

      If the given minValue is greater than the given maxValue, then minValue value will be equal to maxValue.

      Parameters:
      contents - Text, if any, to display in the text field
      toolTip - String to display when the user's cursor lingers over the field
      minValue - Indicates the minimum value that the user may enter in the field.
      maxValue - Indicates the maximum value that the user may enter in the field.
    • makeIPAddressField

      protected UDCIPAddressField makeIPAddressField(String contents, String toolTip)
      Creates an editable panel, containing 4 text fields, which allows the user to enter an IP Address. If contents is null, a default of "0.0.0.0" is used to initially populate the fields.
      Parameters:
      contents - IP Address, if any, to display in the text field
      toolTip - String to display when the user's cursor lingers over the component
    • validateConfig

      protected void validateConfig(DCNodeConfigData config)
      Validates the values in the given config object, for those items which have been set with a valid range.

      If a range has been specified for a configuration item, and the current value of that item is outside the given range, the current value will be updated to reflect either the minimum or maximum value. If the current value is less than the minimum, the value in the config will be updated to reflect the minimum value of the range. The maximum value will be used if the value is greater than the maximum value of the range. If the current value is invalid (i.e. text instead of a number), the minimum value will be used.

      See Also:
    • setRangeValues

      protected void setRangeValues()
      Sets the min and max values for "Debug Level" and "MaxLogFileSize" fields.
    • getNodeSpecificConfigData

      public abstract void getNodeSpecificConfigData(DCNodeConfigData nodeData)
      Implemented by the derived class to populate the node specific config items in the nodeData object
      Specified by:
      getNodeSpecificConfigData in interface DCNodeConfigGUIIfc
    • extendConfigGUI

      public abstract void extendConfigGUI()
      Must be implemented in the derived class to add a node specific UI panel to the tabbed pane
      Specified by:
      extendConfigGUI in interface DCNodeConfigGUIIfc
    • setDefaults

      public abstract void setDefaults()
      Method which sets the default configuration values for this node.