org.snmp4j

Class PDUv1

    • Field Detail

      • COLDSTART

        public static final int COLDSTART
        A coldStart(0) trap signifies that the SNMP entity, supporting a notification originator application, is reinitializing itself and that its configuration may have been altered.
        See Also:
        Constant Field Values
      • WARMSTART

        public static final int WARMSTART
        A warmStart(1) trap signifies that the SNMP entity, supporting a notification originator application, is reinitializing itself such that its configuration is unaltered.
        See Also:
        Constant Field Values
      • LINKDOWN

        public static final int LINKDOWN
        A linkDown(2) trap signifies that the SNMP entity, acting in an agent role, has detected that the ifOperStatus object for one of its communication links is about to enter the down state from some other state (but not from the notPresent state). This other state is indicated by the included value of ifOperStatus.
        See Also:
        Constant Field Values
      • LINKUP

        public static final int LINKUP
        A linkUp(3) trap signifies that the SNMP entity, acting in an agent role, has detected that the ifOperStatus object for one of its communication links left the down state and transitioned into some other state (but not into the notPresent state). This other state is indicated by the included value of ifOperStatus.
        See Also:
        Constant Field Values
      • AUTHENTICATIONFAILURE

        public static final int AUTHENTICATIONFAILURE
        An authenticationFailure(4) trap signifies that the SNMP entity has received a protocol message that is not properly authenticated. While all implementations of SNMP entities MAY be capable of generating this trap, the snmpEnableAuthenTraps object indicates whether this trap will be generated.
        See Also:
        Constant Field Values
      • ENTERPRISE_SPECIFIC

        public static final int ENTERPRISE_SPECIFIC
        If the generic trap identifier is ENTERPRISE_SPECIFIC(6), then the enterprise specific trap ID is given by the specificTrap member field.
        See Also:
        Constant Field Values
    • Constructor Detail

      • PDUv1

        public PDUv1()
      • PDUv1

        public PDUv1(PDUv1 other)
        Copy constructor.
        Parameters:
        other - the PDUv1 to copy from.
        Since:
        1.9.1c
    • Method Detail

      • isVariableV1

        protected boolean isVariableV1(Variable v)
        Check if the given variable can be encoded into a SNMPv1 PDU.
        Parameters:
        v - a variable value (must not be null).
        Returns:
        true if the variable is SNMPv1 compatible (or SNMP4JSettings.isAllowSNMPv2InV1() is true), false otherwise, i.e. if v is an instance of Counter64.
        Since:
        1.9.1c
      • getEnterprise

        public OID getEnterprise()
        Gets the "enterprise" OID of the SNMPv1 trap. The enterprise OID could be any OID although the name could lead to the assumption that the enterprise OID has to be an OID under the iso(1).org(3).dod(6).internet(1).private(4).enterprises(1) node, but that's not true.
        Returns:
        an OID instance.
        Throws:
        UnsupportedOperationException - if the type of this PDU is not PDU.V1TRAP.
      • setEnterprise

        public void setEnterprise(OID enterprise)
        Sets the "enterprise" OID of the SNMPv1 trap. The enterprise OID could be any OID although the name could lead to the assumption that the enterprise OID has to be an OID under the iso(1).org(3).dod(6).internet(1).private(4).enterprises(1) node, but that's not true.
        Parameters:
        enterprise - an OID instance.
        Throws:
        UnsupportedOperationException - if the type of this PDU is not PDU.V1TRAP.
      • getAgentAddress

        public IpAddress getAgentAddress()
        Gets the IP address of the originator system of this SNMPv1 trap. If this value is 0.0.0.0 (the recommended default), then the address of the peer SNMP entity should be extracted from the Target object associated with this PDU.
        Returns:
        an IpAddress instance.
        Throws:
        UnsupportedOperationException - if the type of this PDU is not PDU.V1TRAP.
      • setAgentAddress

        public void setAgentAddress(IpAddress agentAddress)
        Sets the IP address of the originator system of this SNMPv1 trap. The default value is 0.0.0.0, which should be only overriden in special cases, for example when forwarding SNMPv1 traps through a SNMP proxy.
        Parameters:
        agentAddress - a IpAddress instance.
        Throws:
        UnsupportedOperationException - if the type of this PDU is not PDU.V1TRAP.
      • getGenericTrap

        public int getGenericTrap()
        Gets the generic trap ID. If this value is ENTERPRISE_SPECIFIC(6), then getSpecificTrap() will return the trap ID of the enterprise specific trap.
        Returns:
        an Integer32 instance with a value between 0 and 6.
        Throws:
        UnsupportedOperationException - if the type of this PDU is not PDU.V1TRAP.
      • setGenericTrap

        public void setGenericTrap(int genericTrap)
        Sets the generic trap ID. If this value is ENTERPRISE_SPECIFIC(6), then setSpecificTrap(int) must be used to set the trap ID of the enterprise specific trap.
        Parameters:
        genericTrap - an integer value >= 0 and <= 6.
        Throws:
        UnsupportedOperationException - if the type of this PDU is not PDU.V1TRAP.
      • getTimestamp

        public long getTimestamp()
        Gets the TimeTicks value of the trap sender's notion of its sysUpTime value when this trap has been generated.
        Returns:
        a long value.
        Throws:
        UnsupportedOperationException - if the type of this PDU is not PDU.V1TRAP.
      • setTimestamp

        public void setTimestamp(long timeStamp)
        Sets the TimeTicks value of the trap sender's notion of its sysUpTime value when this trap has been generated.
        Parameters:
        timeStamp - a long value.
      • checkNull

        protected void checkNull(Variable parameter)
        Checks for null parameters.
        Parameters:
        parameter - an Object instance.
        Throws:
        NullPointerException - if parameter is null.
      • toString

        public String toString()
        Description copied from class: PDU
        Returns a string representation of the object.
        Overrides:
        toString in class PDU
        Returns:
        a string representation of the object.
      • equals

        public boolean equals(Object obj)
        Overrides:
        equals in class PDU
Copyright 2005-2016 Frank Fock (SNMP4J.org)

Copyright © 2016 SNMP4J.org. All rights reserved.