HOME

com.ireasoning.protocol.snmp
Class TrapSink

java.lang.Object
  extended bycom.ireasoning.protocol.snmp.TrapSink
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
SnmpV3TrapSink

public class TrapSink
extends Object
implements Serializable

This class represents the trapSink XML node in config file

See Also:
Serialized Form

Constructor Summary
TrapSink()
          Constructor
TrapSink(Map attributes)
          Construct a TrapSink object based on the name/value pair contained in passed attributes object
TrapSink(String hostname, int port, String community, int version, boolean isInform)
          Constructor
 
Method Summary
 String getCommunity()
          Returns the community string of trap receiver
 String getHostName()
          Returns the host name or ip of the trap receiver
 int getPort()
          Returns the port number of trap receiver
 String getProperty(String key)
          Gets the trapsink property indicated by the specified key.
 int getVersion()
          Returns trap receiver's version number
 boolean isEnabled()
          Tests if this trapsink is enabled.
 boolean isInform()
          Returns true if it's an SNMP Inform notification
 void setCommunity(String community)
          Sets the community string of trap receiver
 void setEnabled(boolean b)
          Enables or disables this trapsink.
 void setHostName(String hostName)
          Sets the host name or ip of the trap receiver
 void setInform(boolean isInform)
           
 void setPort(int port)
          Sets the port number of trap receiver
 void setProperty(String key, String value)
          Sets the property indicated by the specified key.
 void setVersion(int version)
          Sets trap receiver's version number.
 Map toMap()
          Returns a map object which contains name/value pair representing data of this object
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TrapSink

public TrapSink()
Constructor


TrapSink

public TrapSink(String hostname,
                int port,
                String community,
                int version,
                boolean isInform)
Constructor


TrapSink

public TrapSink(Map attributes)
Construct a TrapSink object based on the name/value pair contained in passed attributes object

Method Detail

getVersion

public int getVersion()
Returns trap receiver's version number


setVersion

public void setVersion(int version)
Sets trap receiver's version number. 1 : SNMPv1 ; 2 : SNMPv2c


getPort

public int getPort()
Returns the port number of trap receiver


setPort

public void setPort(int port)
Sets the port number of trap receiver


getCommunity

public String getCommunity()
Returns the community string of trap receiver


setCommunity

public void setCommunity(String community)
Sets the community string of trap receiver


getHostName

public String getHostName()
Returns the host name or ip of the trap receiver


setHostName

public void setHostName(String hostName)
Sets the host name or ip of the trap receiver


isInform

public boolean isInform()
Returns true if it's an SNMP Inform notification


setInform

public void setInform(boolean isInform)

isEnabled

public boolean isEnabled()
Tests if this trapsink is enabled. If not enabled, trap will not be sent to this trap destination


setEnabled

public void setEnabled(boolean b)
Enables or disables this trapsink. It will not persist into config file.


toString

public String toString()

getProperty

public String getProperty(String key)
Gets the trapsink property indicated by the specified key.

Parameters:
key - - the name of the system property.
Returns:
the string value of the system property, or null if there is no property with that key.

setProperty

public void setProperty(String key,
                        String value)
Sets the property indicated by the specified key.

Parameters:
key - the name of the property
value - the value of the property

toMap

public Map toMap()
Returns a map object which contains name/value pair representing data of this object


HOME

Copyright © 2002 iReasoning Inc. All Rights Reserved.