Active Virtual Network Management Prediction (AVNMP) Classes

snmp
Class Pdu

java.lang.Object
  |
  +--java.util.Observable
        |
        +--snmp.Pdu
All Implemented Interfaces:
java.lang.Runnable, java.io.Serializable
Direct Known Subclasses:
GetNextPdu, GetPdu_vec, GetRspPdu, OneIntPdu, SetPdu, StringPdu

public abstract class Pdu
extends java.util.Observable
implements java.lang.Runnable, java.io.Serializable

This class implements a Pdu.

Version:
$Revision: 1.1.1.1 $ $State: Exp $
Author:
Steve Bush
See Also:
Serialized Form

Field Summary
 boolean answered
           
 int errind
           
 int errstat
           
 byte msg_type
           
 int reqid
           
 java.util.Vector varbinds
           
 
Constructor Summary
Pdu(SnmpAgentContext con)
          Construct an empty PDU to be sent.
Pdu(SnmpContext con)
          Construct an empty PDU to be sent.
 
Method Summary
 void add_oid(java.lang.String oid)
          Add a new oid with a null value to the varbind list.
 void add_vb(varbind vb)
          Add a new varbind to the list.
 boolean agentSend(java.lang.String community)
          Send this Pdu over the channel.
 void fillin(AsnPduSequence seq)
          Replace the varbinds of this Pdu with varbinds from a Pdu sequence.
 int getErrorIndex()
           
 int getErrorStatus()
           
abstract  void new_value(int n, varbind var)
          Over-ride this method with one to set a new internal value.
 void run()
          Use this new thread to repeatly attempt to send the SNMP request.
 void send(java.lang.String com)
          Start a new thread to do the send.
 boolean sendme(java.lang.String community)
          Send this Pdu over the channel.
 void set_msg_type(byte type)
          Change the default (get request) message type.
abstract  void tell_them()
          Over-ride this method with one to notify observers of a new value.
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

reqid

public int reqid

errstat

public int errstat

errind

public int errind

varbinds

public java.util.Vector varbinds

answered

public boolean answered

msg_type

public byte msg_type
Constructor Detail

Pdu

public Pdu(SnmpContext con)
Construct an empty PDU to be sent.
Parameters:
con - SNMP connection information.

Pdu

public Pdu(SnmpAgentContext con)
Construct an empty PDU to be sent.
Parameters:
con - SNMP connection information.
Method Detail

new_value

public abstract void new_value(int n,
                               varbind var)
Over-ride this method with one to set a new internal value.
Parameters:
n - Appears to be an index for a vector of varbinds.
var - The varbind to set.

tell_them

public abstract void tell_them()
Over-ride this method with one to notify observers of a new value.

fillin

public void fillin(AsnPduSequence seq)
Replace the varbinds of this Pdu with varbinds from a Pdu sequence.
Parameters:
seq - A PDU sequence whose varbinds will be placed into this Pdu.

sendme

public boolean sendme(java.lang.String community)
               throws java.io.IOException
Send this Pdu over the channel.
Parameters:
community - The SNMP community name.
Returns:
True if successful.

agentSend

public boolean agentSend(java.lang.String community)
                  throws java.io.IOException
Send this Pdu over the channel.
Parameters:
community - The SNMP community name.
Returns:
True if successful.

send

public void send(java.lang.String com)
Start a new thread to do the send.
Parameters:
com - The community name.

add_oid

public void add_oid(java.lang.String oid)
Add a new oid with a null value to the varbind list.
Parameters:
oid - The oid to be added to the list.

add_vb

public void add_vb(varbind vb)
Add a new varbind to the list.
Parameters:
vb - New varbind to be added.

set_msg_type

public void set_msg_type(byte type)
Change the default (get request) message type.
Parameters:
type - The message type.

getErrorStatus

public int getErrorStatus()
Returns:
The error status.

getErrorIndex

public int getErrorIndex()
Returns:
The error index.

run

public void run()
Use this new thread to repeatly attempt to send the SNMP request.
Specified by:
run in interface java.lang.Runnable

Active Virtual Network Management Prediction (AVNMP) Classes