|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectUtils.Utils
public class Utils
Class holding different utility methods for the application
Field Summary | |
---|---|
(package private) static byte[] |
HEX_CHAR_TABLE
|
Constructor Summary | |
---|---|
Utils()
|
Method Summary | |
---|---|
static java.util.Hashtable<com.adventnet.snmp.snmp2.SnmpOID,com.adventnet.snmp.snmp2.SnmpVar> |
createInterfaceList(com.adventnet.snmp.snmp2.SnmpSession session,
java.lang.String userName)
Creates a hashtable holding all the router's interfaces |
static java.util.Hashtable<com.adventnet.snmp.snmp2.SnmpOID,com.adventnet.snmp.snmp2.SnmpVar> |
createIpList(com.adventnet.snmp.snmp2.SnmpSession session,
java.lang.String userName)
Creates a Hashtable containing the IP Addresses |
static java.util.Vector<java.lang.String> |
createNeighborsList(com.adventnet.snmp.snmp2.SnmpSession session,
java.lang.String userName)
Creates a Vector holding all the IP addresses in the routing table referring to other machines. |
static void |
createRouterConnections(RouterCollection r)
Creates a .dot file containing all the information needed to create a graph of the router topology using some external tool like neato (Graphviz packet) |
static java.lang.String |
determineRouterID(java.util.Vector<com.adventnet.snmp.snmp2.SnmpVarBind> addresses)
Gets all the IP addresses of the router, and returns the lower one |
static java.lang.String |
getHexString(byte[] raw)
|
static double |
getRouterLoad(java.util.Vector<java.lang.Long> samples,
long pollingDuration)
|
static long |
inOctetsSum(java.util.Vector<com.adventnet.snmp.snmp2.SnmpVarBind> v)
Calculates the sum of inOctets for all the interfaces of the router |
static void |
printHashtable(java.util.Hashtable<com.adventnet.snmp.snmp2.SnmpOID,com.adventnet.snmp.snmp2.SnmpVar> hashTable)
|
static void |
printSnmpVarBindVectors(java.util.Vector<com.adventnet.snmp.snmp2.SnmpVarBind> v)
|
static void |
writeToFile(RouterCollection r,
java.lang.String filename)
Writes the information about the discovered routers in a file in logs directory. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static final byte[] HEX_CHAR_TABLE
Constructor Detail |
---|
public Utils()
Method Detail |
---|
public static java.lang.String determineRouterID(java.util.Vector<com.adventnet.snmp.snmp2.SnmpVarBind> addresses)
addresses
- - Vector holding the ip addresses of the router interfaces
public static java.util.Hashtable<com.adventnet.snmp.snmp2.SnmpOID,com.adventnet.snmp.snmp2.SnmpVar> createInterfaceList(com.adventnet.snmp.snmp2.SnmpSession session, java.lang.String userName)
session
- userName
-
public static java.util.Hashtable<com.adventnet.snmp.snmp2.SnmpOID,com.adventnet.snmp.snmp2.SnmpVar> createIpList(com.adventnet.snmp.snmp2.SnmpSession session, java.lang.String userName)
session
-
public static java.util.Vector<java.lang.String> createNeighborsList(com.adventnet.snmp.snmp2.SnmpSession session, java.lang.String userName)
session
-
public static long inOctetsSum(java.util.Vector<com.adventnet.snmp.snmp2.SnmpVarBind> v)
v
- Vector holding the SnmpVar Bindings for a specified router
concerning inOctets for all its interfaces
public static double getRouterLoad(java.util.Vector<java.lang.Long> samples, long pollingDuration)
samples
- pollingDuration
-
public static void printSnmpVarBindVectors(java.util.Vector<com.adventnet.snmp.snmp2.SnmpVarBind> v)
public static void printHashtable(java.util.Hashtable<com.adventnet.snmp.snmp2.SnmpOID,com.adventnet.snmp.snmp2.SnmpVar> hashTable)
public static void writeToFile(RouterCollection r, java.lang.String filename)
r
- The RouterCollection of the Discovered routersfilename
- The name of the file to save the information to.public static void createRouterConnections(RouterCollection r)
r
- The RouterCollection of the discovered routerspublic static java.lang.String getHexString(byte[] raw) throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |