net.fenyo.gnetwatch.actions
Class ActionSNMP

java.lang.Object
  extended by net.fenyo.gnetwatch.GUI.VisualElement
      extended by net.fenyo.gnetwatch.actions.Action
          extended by net.fenyo.gnetwatch.actions.ActionSNMP

public class ActionSNMP
extends Action

Instances of this action class use SNMP to get the interface list of their target, and to get SNMP counters for each interface.

Version:
$Id: ActionSNMP.java,v 1.37 2008/04/27 21:44:21 fenyo Exp $
Author:
Alexandre Fenyo

Nested Class Summary
 
Nested classes/interfaces inherited from class net.fenyo.gnetwatch.actions.Action
Action.InterruptCause
 
Field Summary
private  boolean interfaces_created
           
private  boolean interrupted
           
private  java.util.Map<java.lang.Integer,java.lang.Long> last_total_bytes_received
           
private  java.util.Map<java.lang.Integer,java.lang.Long> last_total_bytes_received_time
           
private  java.util.Map<java.lang.Integer,java.lang.Long> last_total_bytes_sent
           
private  java.util.Map<java.lang.Integer,java.lang.Long> last_total_bytes_sent_time
           
private static Log log
           
private  java.util.Map<java.lang.Integer,TargetInterface> targets
           
 
Constructor Summary
ActionSNMP()
          Constructor.
ActionSNMP(Target target, Background background)
          Default constructor.
 
Method Summary
protected  void disposed()
          Called when this element is being removed.
 long getMaxDelay()
          Returns the timeout associated with this action.
 java.lang.String getQueueName()
          Returns the preferred queue.
 void interrupt(Action.InterruptCause cause)
          Asks this action to stop rapidely.
 void invoke()
          Gets the interface list to create interfaces and gets snmp counters.
 
Methods inherited from class net.fenyo.gnetwatch.actions.Action
canManageThisChild, getBackground, getTarget, initialize, setBackground, setTarget
 
Methods inherited from class net.fenyo.gnetwatch.GUI.VisualElement
addParent, contains, duplicateTreeItemOnce, expandTreeItems, getAllParents, getChildren, getDescription, getGUI, getId, getItem, getParents, getProgress, getSubElements, getSubElements, getTreeItems, getType, informSelected, isDisposed, isThisOurTreeItem, removeVisualElements, selected, setChildren, setDescription, setGUI, setId, setImage, setImageExec, setImageFolder, setImageHost, setImageHost6, setImageHost6SNMP, setImageHostSNMP, setImageInterface, setImageMultiRow, setImageNetwork, setImageOscillo, setImageQueue, setImageWatch, setItem, setParent, setParent, setProgress, setType, unselected
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static Log log

interrupted

private boolean interrupted

interfaces_created

private boolean interfaces_created

targets

private java.util.Map<java.lang.Integer,TargetInterface> targets

last_total_bytes_received

private java.util.Map<java.lang.Integer,java.lang.Long> last_total_bytes_received

last_total_bytes_sent

private java.util.Map<java.lang.Integer,java.lang.Long> last_total_bytes_sent

last_total_bytes_received_time

private java.util.Map<java.lang.Integer,java.lang.Long> last_total_bytes_received_time

last_total_bytes_sent_time

private java.util.Map<java.lang.Integer,java.lang.Long> last_total_bytes_sent_time
Constructor Detail

ActionSNMP

public ActionSNMP(Target target,
                  Background background)
Default constructor.

Parameters:
target - target this action works on.
background - queue manager by which this action will add events.

ActionSNMP

public ActionSNMP()
Constructor.

Parameters:
none. -
Method Detail

getQueueName

public java.lang.String getQueueName()
Returns the preferred queue.

Overrides:
getQueueName in class Action
Parameters:
none. -
Returns:
String preferred queue.

getMaxDelay

public long getMaxDelay()
Returns the timeout associated with this action.

Overrides:
getMaxDelay in class Action
Parameters:
none. -
Returns:
long timeout.

interrupt

public void interrupt(Action.InterruptCause cause)
Asks this action to stop rapidely.

Overrides:
interrupt in class Action
Parameters:
cause - cause.
Throws:
java.io.IOException - IO exception.

invoke

public void invoke()
            throws java.io.IOException,
                   java.lang.InterruptedException
Gets the interface list to create interfaces and gets snmp counters.

Overrides:
invoke in class Action
Parameters:
none. -
Throws:
java.io.IOException - IO exception.
java.lang.InterruptedException - exception.

disposed

protected void disposed()
Called when this element is being removed.

Overrides:
disposed in class Action
Parameters:
none. -