com.adventnet.snmp.beans
Class ParsedTrapEvent

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--com.adventnet.snmp.beans.ParsedTrapEvent
All Implemented Interfaces:
java.io.Serializable

public class ParsedTrapEvent
extends java.util.EventObject

This event is generated by Trap Parser Bean. This is generated when a trap matches the criteria specified in the parser file. This event object contains all the characterstics of a Trap like Generic Type, Specific Type, Community etc.

See Also:
Serialized Form

Field Summary
 java.lang.String category
          The community string of the Trap
 java.lang.String color
           
 java.util.Date date
          Time when the Trap event occured.
 java.lang.String domain
          The domain - application specific
 java.lang.String entity
          The agent node that send the trap
 java.lang.String eoid
          Enterprise OID of the Trap
 java.lang.String helpURL
          URL having more information about the Trap received.
 int id
          A unique id for internal processing
 int localPort
           
 java.lang.String network
          The associated network - application specific
 java.lang.String node
          The node generating this event
 int remotePort
          Remote port from which the trap is received
 java.awt.Color rowColor
          The color of the row on the Trap Table, that specifies th Trap.
 int severity
          The severity of this event, viz.
 java.lang.String snmpTrapOID
           
 java.lang.String source
          Agent that sent the trap
 int specificType
          Specific Type of the Trap
 java.lang.String systemUpTime
           
 java.lang.String text
          The descriptive text message that explains the event
 int trapType
          Generic Type of the Trap
 java.lang.String version
           
 
Constructor Summary
ParsedTrapEvent(TrapEvent trap)
          Creates a ParsedTrapEvent Object.
 
Method Summary
 java.lang.String dateString()
          To get a printable date when trap is received.
 void decodeObj(byte[] bytes)
          To decode the encoded object
 byte[] encodeObj()
          To save this object for persistence
 java.awt.Color getColor()
          This method is used to get the default color for different value of severity
static long getParsedTime(java.util.Date dt)
          To get the long value of the date object.
 int getSeverity()
          To get the numeric severity value of the trap 1 - All 2 - Critical 3 - Major 4 - Minor 5 - Warning 6 - Clear 7 - Info
 java.lang.String getSnmpTrapOID()
           
 java.lang.String getStr(java.lang.String s)
          To get the characterstics of the Trap that this event contains.
 java.lang.String getSystemUpTime()
           
 java.lang.String getTimeStamp()
          To get the Time Stamp for the Trap received in String format
 java.lang.String getTrapSource()
          To get Agent that sent the trap.
 long getUpTime()
          To get the Up Time value of the Agent which sent the trap
 java.lang.String getVersion()
           
static int severityInt(java.lang.String s)
          To get the numeric value for corresponding String severity value All - 1 Critical - 2 Major - 3 Minor - 4 Warning - 5 Clear - 6 Info - 7
 java.lang.String severityStr()
          To get the severity string value
static java.lang.String severityStr(int sev)
          To get the String value for corresponding Numeric severity value All - 1 Critical - 2 Major - 3 Minor - 4 Warning - 5 Clear - 6 Info - 7
 java.lang.String toLogString()
          To get a string of all the Trap characterstics.
 java.lang.String toString()
          To convert a trap message string
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

id

public int id
A unique id for internal processing

text

public java.lang.String text
The descriptive text message that explains the event

category

public java.lang.String category
The community string of the Trap

domain

public java.lang.String domain
The domain - application specific

network

public java.lang.String network
The associated network - application specific

node

public java.lang.String node
The node generating this event

entity

public java.lang.String entity
The agent node that send the trap

severity

public int severity
The severity of this event, viz. All,Critical,Major,Minor,Warning,Clear,Info

eoid

public java.lang.String eoid
Enterprise OID of the Trap

specificType

public int specificType
Specific Type of the Trap

trapType

public int trapType
Generic Type of the Trap

remotePort

public int remotePort
Remote port from which the trap is received

localPort

public int localPort

version

public java.lang.String version

snmpTrapOID

public java.lang.String snmpTrapOID

systemUpTime

public java.lang.String systemUpTime

source

public java.lang.String source
Agent that sent the trap

helpURL

public java.lang.String helpURL
URL having more information about the Trap received.

date

public java.util.Date date
Time when the Trap event occured.

color

public java.lang.String color

rowColor

public java.awt.Color rowColor
The color of the row on the Trap Table, that specifies th Trap.
Constructor Detail

ParsedTrapEvent

public ParsedTrapEvent(TrapEvent trap)
Creates a ParsedTrapEvent Object. The Source of this object is TrapEvent.
Parameters:
trap - Trap Event generated by the Trap Receiver.
Method Detail

getSeverity

public int getSeverity()
To get the numeric severity value of the trap 1 - All 2 - Critical 3 - Major 4 - Minor 5 - Warning 6 - Clear 7 - Info
Returns:
Integer that specifies severity

getUpTime

public long getUpTime()
To get the Up Time value of the Agent which sent the trap
Returns:
Up Time value in long

getTrapSource

public java.lang.String getTrapSource()
To get Agent that sent the trap.
Returns:
Agent that sent the trap.

toString

public java.lang.String toString()
To convert a trap message string
Overrides:
toString in class java.util.EventObject

toLogString

public java.lang.String toLogString()
To get a string of all the Trap characterstics.
Returns:
String of all the Trap characterstics.

encodeObj

public byte[] encodeObj()
To save this object for persistence

decodeObj

public void decodeObj(byte[] bytes)
               throws java.io.IOException
To decode the encoded object
Throws:
java.io.IOException - is thrown on IO error.

severityStr

public static java.lang.String severityStr(int sev)
To get the String value for corresponding Numeric severity value All - 1 Critical - 2 Major - 3 Minor - 4 Warning - 5 Clear - 6 Info - 7

severityInt

public static int severityInt(java.lang.String s)
To get the numeric value for corresponding String severity value All - 1 Critical - 2 Major - 3 Minor - 4 Warning - 5 Clear - 6 Info - 7
Returns:
int value corresponding to the severity.

severityStr

public java.lang.String severityStr()
To get the severity string value

getColor

public java.awt.Color getColor()
This method is used to get the default color for different value of severity

dateString

public java.lang.String dateString()
To get a printable date when trap is received.

getTimeStamp

public java.lang.String getTimeStamp()
To get the Time Stamp for the Trap received in String format

getParsedTime

public static long getParsedTime(java.util.Date dt)
To get the long value of the date object.

getStr

public java.lang.String getStr(java.lang.String s)
To get the characterstics of the Trap that this event contains. Trap characterstics and corresponding s are : Community - categrory Source - Source Specfic Type - ST Generic Type - GT Enterprise OID - enterprise Severity - severity Message - text Remote Port - remoteport Agent Address - entity Host Name - node Help URL - helpURL Time Stamp - timeStamp Time Received - timeReceived

getSnmpTrapOID

public java.lang.String getSnmpTrapOID()

getSystemUpTime

public java.lang.String getSystemUpTime()

getVersion

public java.lang.String getVersion()


Copyright (c)AdventNet Inc., 1996-2004