@Test public void testOidFromVsName() { for (Entry<String, String> ent : knownOidMaps.entrySet()) { String oid = ent.getKey(); String vsName = ent.getValue(); assertEquals(oid, getOidFromVirtualServerName(baseOid, vsName)); } }
public static String getOidFromVirtualServerName(String baseOid, String vsName) { StringBuilder sb = new StringBuilder(); char[] vsChars = vsName.toCharArray(); sb.append(baseOid); sb.append(".").append(vsChars.length); for (int i = 0; i < vsChars.length; i++) { sb.append(".").append((int) vsChars[i]); } return sb.toString(); }
StingraySnmpClient { public static String getOidFromVirtualServerName(String baseOid, String vsName) { StringBuilder sb = new StringBuilder(); char[] vsChars = vsName.toCharArray(); sb.append(baseOid); sb.append(".").append(vsChars.length); for (int i = 0; i < vsChars.length; i++) { sb.append(".").append((int) vsChars[i]); } return sb.toString(); } }
StingraySnmpClient { public static String getOidFromVirtualServerName(String baseOid, String vsName) { StringBuilder sb = new StringBuilder(); char[] vsChars = vsName.toCharArray(); sb.append(baseOid); sb.append(".").append(vsChars.length); for (int i = 0; i < vsChars.length; i++) { sb.append(".").append((int) vsChars[i]); } return sb.toString(); } StingraySnmpClient();  StingraySnmpClient(String address);  StingraySnmpClient(String address, String port);  StingraySnmpClient(String address, String port, String community); }
StingraySnmpClient { public static String getOidFromVirtualServerName(String baseOid, String vsName) { StringBuilder sb = new StringBuilder(); char[] vsChars = vsName.toCharArray(); sb.append(baseOid); sb.append(".").append(vsChars.length); for (int i = 0; i < vsChars.length; i++) { sb.append(".").append((int) vsChars[i]); } return sb.toString(); } StingraySnmpClient();  StingraySnmpClient(String address);  StingraySnmpClient(String address, String port);  StingraySnmpClient(String address, String port, String community); static long getTimeout(); static void setTimeout(long aTimeout); static Random getRnd(); @Override String toString(); synchronized static int incRequestId(); Map<String, Long> getLongOidVals(String oid); Map<String, RawSnmpUsage> getSnmpUsage(); long getBytesIn(String vsName, boolean zeroOnNotFound, boolean negativeOneOnNotFoundException); long getBytesOut(String vsName, boolean zeroOnNotFound, boolean negativeOneOnNotFoundException); long getConcurrentConnections(String vsName, boolean zeroOnNotFound, boolean negativeOneOnNotFoundException); int getMaxConnections(String vsName, boolean zeroOnNotFound, boolean negativeOneOnNotFoundException); int getConnectTimedOut(String vsName, boolean zeroOnNotFound, boolean negativeOneOnNotFoundException); int getDataTimedOut(String vsName, boolean zeroOnNotFound, boolean negativeOneOnNotFoundException); int getKeepAliveTimedOut(String vsName, boolean zeroOnNotFound, boolean negativeOneOnNotFoundException); int getConnectionErrors(String vsName, boolean zeroOnNotFound, boolean negativeOneOnNotFoundException); int getConnectionFailures(String vsName, boolean zeroOnNotFound, boolean negativeOneOnNotFoundException); int getIntegerValueForVirtualServer(String vsName, String baseOid, boolean zeroOnNotFoundException, boolean negativeOneOnNotFoundException); long getLongValueForVirtualServer(String vsName, String baseOid, boolean zeroOnNotFoundException, boolean negativeOneOnNotFoundException); org.snmp4j.smi.Variable getValueForVirtualServer(String vsName, String baseOid, boolean zeroOnNotFoundException, boolean negativeOneOnNotFoundException); List<VariableBinding> getBulkOidBindingList(String oid); static String getOidFromVirtualServerName(String baseOid, String vsName); static String getVirtualServerNameFromOid(String baseOid, String oid); @Override boolean equals(Object o); @Override int hashCode(); String getAddress(); String getPort(); String getCommunity(); void setAddress(String address); void setPort(String port); void setCommunity(String community); static void nop(); static int getRequestId(); int getMaxRetrys(); void setMaxRetrys(int maxRetrys); int getVersion(); void setVersion(int version); synchronized static void setRequestId(int aRequestId); long getReportUdpCountEveryNMilliSeconds(); void setReportUdpCountEveryNMilliSeconds(long reportUdpCountEveryNMilliSeconds); int getNonRepeaters(); void setNonRepeaters(int nonRepeaters); int getMaxRepetitions(); void setMaxRepetitions(int maxRepetitions); }
StingraySnmpClient { public static String getOidFromVirtualServerName(String baseOid, String vsName) { StringBuilder sb = new StringBuilder(); char[] vsChars = vsName.toCharArray(); sb.append(baseOid); sb.append(".").append(vsChars.length); for (int i = 0; i < vsChars.length; i++) { sb.append(".").append((int) vsChars[i]); } return sb.toString(); } StingraySnmpClient();  StingraySnmpClient(String address);  StingraySnmpClient(String address, String port);  StingraySnmpClient(String address, String port, String community); static long getTimeout(); static void setTimeout(long aTimeout); static Random getRnd(); @Override String toString(); synchronized static int incRequestId(); Map<String, Long> getLongOidVals(String oid); Map<String, RawSnmpUsage> getSnmpUsage(); long getBytesIn(String vsName, boolean zeroOnNotFound, boolean negativeOneOnNotFoundException); long getBytesOut(String vsName, boolean zeroOnNotFound, boolean negativeOneOnNotFoundException); long getConcurrentConnections(String vsName, boolean zeroOnNotFound, boolean negativeOneOnNotFoundException); int getMaxConnections(String vsName, boolean zeroOnNotFound, boolean negativeOneOnNotFoundException); int getConnectTimedOut(String vsName, boolean zeroOnNotFound, boolean negativeOneOnNotFoundException); int getDataTimedOut(String vsName, boolean zeroOnNotFound, boolean negativeOneOnNotFoundException); int getKeepAliveTimedOut(String vsName, boolean zeroOnNotFound, boolean negativeOneOnNotFoundException); int getConnectionErrors(String vsName, boolean zeroOnNotFound, boolean negativeOneOnNotFoundException); int getConnectionFailures(String vsName, boolean zeroOnNotFound, boolean negativeOneOnNotFoundException); int getIntegerValueForVirtualServer(String vsName, String baseOid, boolean zeroOnNotFoundException, boolean negativeOneOnNotFoundException); long getLongValueForVirtualServer(String vsName, String baseOid, boolean zeroOnNotFoundException, boolean negativeOneOnNotFoundException); org.snmp4j.smi.Variable getValueForVirtualServer(String vsName, String baseOid, boolean zeroOnNotFoundException, boolean negativeOneOnNotFoundException); List<VariableBinding> getBulkOidBindingList(String oid); static String getOidFromVirtualServerName(String baseOid, String vsName); static String getVirtualServerNameFromOid(String baseOid, String oid); @Override boolean equals(Object o); @Override int hashCode(); String getAddress(); String getPort(); String getCommunity(); void setAddress(String address); void setPort(String port); void setCommunity(String community); static void nop(); static int getRequestId(); int getMaxRetrys(); void setMaxRetrys(int maxRetrys); int getVersion(); void setVersion(int version); synchronized static void setRequestId(int aRequestId); long getReportUdpCountEveryNMilliSeconds(); void setReportUdpCountEveryNMilliSeconds(long reportUdpCountEveryNMilliSeconds); int getNonRepeaters(); void setNonRepeaters(int nonRepeaters); int getMaxRepetitions(); void setMaxRepetitions(int maxRepetitions);  }