Package org.opennms.web.element
Class SnmpIfAdmin
- java.lang.Object
-
- org.opennms.web.element.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
-
-
Constructor Summary
Constructors Constructor Description SnmpIfAdmin(int nodeid, java.net.InetAddress inetAddress, java.lang.String community)
Construct a SnmpIfAdmin object from inetaddress objectSnmpIfAdmin(int nodeid, SnmpAgentConfig agent)
Construct a SnmpIfAdmin object from a SnmpPeer object
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getIfAdminStatus(int ifindex)
Get desired admin interface status.static java.lang.String
getReadableAdminStatus(int value)
Get status in readable human format.boolean
isIfAdminStatusDown()
isIfAdminStatusDownboolean
isIfAdminStatusUp()
isIfAdminStatusUpstatic boolean
isValidState(int status)
isValidStateboolean
setIfAdmin(int ifindex, int value)
Set admin interface status to value.boolean
setIfAdminDown(int ifindex)
setIfAdminDownboolean
setIfAdminUp(int ifindex)
Set admin interface status to "up".
-
-
-
Field Detail
-
NULL
public static final int NULL
ConstantNULL=0
- See Also:
- Constant Field Values
-
UP
public static final int UP
ConstantUP=1
- See Also:
- Constant Field Values
-
DOWN
public static final int DOWN
ConstantDOWN=2
- See Also:
- Constant Field Values
-
TESTING
public static final int TESTING
ConstantTESTING=3
- See Also:
- Constant Field Values
-
-
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
- aSnmpAgentConfig
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
- aInetAddress
object.community
- aString
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 integerjava.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 setvalue
- desired interface status value- Returns:
- The status of interface after operation
- Throws:
SnmpBadConversionException
- Throw if returned code is not an integerjava.sql.SQLException
- if any.
-
isValidState
public static boolean isValidState(int status)
isValidState
- Parameters:
status
- a int.- Returns:
- a boolean.
-
-