Class SnmpIfAdmin


  • public class SnmpIfAdmin
    extends java.lang.Object

    SnmpIfAdmin class.

    Since:
    1.8.1
    Version:
    $Id: $
    Author:
    micmas Per modificare il modello associato al commento di questo tipo generato, aprire Finestra>Preferenze>Java>Generazione codice>Codice e commenti
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int DOWN
      Constant DOWN=2
      static int NULL
      Constant NULL=0
      static int TESTING
      Constant TESTING=3
      static int UP
      Constant UP=1
    • Constructor Summary

      Constructors 
      Constructor Description
      SnmpIfAdmin​(int nodeid, java.net.InetAddress inetAddress, java.lang.String community)
      Construct a SnmpIfAdmin object from inetaddress object
      SnmpIfAdmin​(int nodeid, SnmpAgentConfig agent)
      Construct a SnmpIfAdmin object from a SnmpPeer object
    • Constructor Detail

      • SnmpIfAdmin

        public SnmpIfAdmin​(int nodeid,
                           SnmpAgentConfig agent)
                    throws java.net.SocketException
        Construct a SnmpIfAdmin object from a SnmpPeer object
        Parameters:
        nodeid - a int.
        agent - a SnmpAgentConfig object.
        Throws:
        java.net.SocketException - if any.
        java.net.SocketException - if any.
      • SnmpIfAdmin

        public SnmpIfAdmin​(int nodeid,
                           java.net.InetAddress inetAddress,
                           java.lang.String community)
                    throws java.net.SocketException,
                           java.lang.Exception
        Construct a SnmpIfAdmin object from inetaddress object
        Parameters:
        inetAddress - a InetAddress object.
        community - a String object.
        nodeid - a int.
        Throws:
        java.net.SocketException - if any.
        java.net.SocketException - if any.
        java.lang.Exception - if any.
    • Method Detail

      • setIfAdminUp

        public boolean setIfAdminUp​(int ifindex)
                             throws java.sql.SQLException

        Set admin interface status to "up".

        Parameters:
        ifindex - interface index to set
        Returns:
        The status of interface
        Throws:
        SnmpBadConversionException - Throw if returned code is not an integer
        java.sql.SQLException - if any.
      • setIfAdminDown

        public boolean setIfAdminDown​(int ifindex)
                               throws java.sql.SQLException

        setIfAdminDown

        Parameters:
        ifindex - a int.
        Returns:
        a boolean.
        Throws:
        java.sql.SQLException - if any.
      • isIfAdminStatusUp

        public boolean isIfAdminStatusUp()

        isIfAdminStatusUp

        Returns:
        a boolean.
      • isIfAdminStatusDown

        public boolean isIfAdminStatusDown()

        isIfAdminStatusDown

        Returns:
        a boolean.
      • getIfAdminStatus

        public int getIfAdminStatus​(int ifindex)

        Get desired admin interface status.

        Parameters:
        ifindex - interface index to get
        Returns:
        The status of interface
        Throws:
        SnmpBadConversionException - Throw if returned code is not an integer
      • getReadableAdminStatus

        public static java.lang.String getReadableAdminStatus​(int value)

        Get status in readable human format.

        Parameters:
        value - a int.
        Returns:
        The status of interface in human format
      • setIfAdmin

        public boolean setIfAdmin​(int ifindex,
                                  int value)
                           throws java.sql.SQLException

        Set admin interface status to value.

        Parameters:
        ifindex - interface index to set
        value - desired interface status value
        Returns:
        The status of interface after operation
        Throws:
        SnmpBadConversionException - Throw if returned code is not an integer
        java.sql.SQLException - if any.
      • isValidState

        public static boolean isValidState​(int status)

        isValidState

        Parameters:
        status - a int.
        Returns:
        a boolean.