org.opennms.netmgt.snmp
Class SnmpUtils
java.lang.Object
org.opennms.netmgt.snmp.SnmpUtils
public class SnmpUtils
- extends java.lang.Object
|
Method Summary |
static boolean |
allBytesDisplayable(byte[] bytes)
If the value is in the unprintable ASCII range (< 32) and is not a: |
static SnmpWalker |
createWalker(SnmpAgentConfig agentConfig,
java.lang.String name,
CollectionTracker... trackers)
|
static SnmpWalker |
createWalker(SnmpAgentConfig agentConfig,
java.lang.String name,
CollectionTracker tracker)
|
static SnmpValue |
get(SnmpAgentConfig agentConfig,
SnmpObjId oid)
|
static SnmpValue[] |
get(SnmpAgentConfig agentConfig,
SnmpObjId[] oids)
|
static SnmpValue[] |
getBulk(SnmpAgentConfig agentConfig,
SnmpObjId[] oids)
|
static java.util.List<SnmpValue> |
getColumns(SnmpAgentConfig agentConfig,
java.lang.String name,
SnmpObjId oid)
|
static java.util.Properties |
getConfig()
|
static SnmpValue |
getNext(SnmpAgentConfig agentConfig,
SnmpObjId oid)
|
static SnmpValue[] |
getNext(SnmpAgentConfig agentConfig,
SnmpObjId[] oids)
|
static java.util.Map<SnmpInstId,SnmpValue> |
getOidValues(SnmpAgentConfig agentConfig,
java.lang.String name,
SnmpObjId oid)
|
static SnmpStrategy |
getStrategy()
|
static SnmpV1TrapBuilder |
getV1TrapBuilder()
|
static SnmpTrapBuilder |
getV2TrapBuilder()
|
static SnmpValueFactory |
getValueFactory()
|
static void |
registerForTraps(TrapNotificationListener listener,
TrapProcessorFactory processorFactory,
int snmpTrapPort)
|
static SnmpValue[] |
set(SnmpAgentConfig agentConfig,
SnmpObjId[] oids,
SnmpValue[] values)
|
static SnmpValue |
set(SnmpAgentConfig agentConfig,
SnmpObjId oid,
SnmpValue value)
|
static void |
setConfig(java.util.Properties config)
|
static void |
unregisterForTraps(TrapNotificationListener listener,
int snmpTrapPort)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SnmpUtils
public SnmpUtils()
createWalker
public static SnmpWalker createWalker(SnmpAgentConfig agentConfig,
java.lang.String name,
CollectionTracker... trackers)
createWalker
public static SnmpWalker createWalker(SnmpAgentConfig agentConfig,
java.lang.String name,
CollectionTracker tracker)
get
public static SnmpValue get(SnmpAgentConfig agentConfig,
SnmpObjId oid)
get
public static SnmpValue[] get(SnmpAgentConfig agentConfig,
SnmpObjId[] oids)
getNext
public static SnmpValue getNext(SnmpAgentConfig agentConfig,
SnmpObjId oid)
getNext
public static SnmpValue[] getNext(SnmpAgentConfig agentConfig,
SnmpObjId[] oids)
getBulk
public static SnmpValue[] getBulk(SnmpAgentConfig agentConfig,
SnmpObjId[] oids)
set
public static SnmpValue set(SnmpAgentConfig agentConfig,
SnmpObjId oid,
SnmpValue value)
set
public static SnmpValue[] set(SnmpAgentConfig agentConfig,
SnmpObjId[] oids,
SnmpValue[] values)
getConfig
public static java.util.Properties getConfig()
getColumns
public static java.util.List<SnmpValue> getColumns(SnmpAgentConfig agentConfig,
java.lang.String name,
SnmpObjId oid)
throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
getOidValues
public static java.util.Map<SnmpInstId,SnmpValue> getOidValues(SnmpAgentConfig agentConfig,
java.lang.String name,
SnmpObjId oid)
throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
setConfig
public static void setConfig(java.util.Properties config)
getStrategy
public static SnmpStrategy getStrategy()
registerForTraps
public static void registerForTraps(TrapNotificationListener listener,
TrapProcessorFactory processorFactory,
int snmpTrapPort)
throws java.io.IOException
- Throws:
java.io.IOException
unregisterForTraps
public static void unregisterForTraps(TrapNotificationListener listener,
int snmpTrapPort)
throws java.io.IOException
- Throws:
java.io.IOException
getValueFactory
public static SnmpValueFactory getValueFactory()
getV1TrapBuilder
public static SnmpV1TrapBuilder getV1TrapBuilder()
getV2TrapBuilder
public static SnmpTrapBuilder getV2TrapBuilder()
allBytesDisplayable
public static boolean allBytesDisplayable(byte[] bytes)
If the value is in the unprintable ASCII range (< 32) and is not a:
- Tab (9)
- Linefeed (10)
- Carriage return (13)
or the byte is Delete (127) then this method will return false. Also, if the byte
array has a NULL byte (0) that occurs anywhere besides the last character, return false.
We will allow the NULL byte as a special case at the end of the string.
Copyright © 2010. All Rights Reserved.