/** * Return the integer value of a property. If there is no property <code>key</code>, or the value * is not an integer, the default value is returned. * * @param key The key * @param def The default value */ public int getIntParameter(String key, int def) { int val = def; try { String v = prop.getProperty(key); if (v != null) { val = Integer.valueOf(v).intValue(); } } catch (java.lang.NumberFormatException exc) { } catch (NullPointerException exc) { } return val; }
public int getPrivProcotol() { String param = prop.getProperty(PRIV_PROTOCOL, "DES"); int proto = SnmpContextv3Face.DES_ENCRYPT; if (param != null) { char f = param.charAt(0); if (f == 'A') { proto = SnmpContextv3Face.AES_ENCRYPT; } else { proto = SnmpContextv3Face.DES_ENCRYPT; } } return proto; }
public int getAuthProcotol() { String param = prop.getProperty(AUTH_PROTOCOL, "MD5"); int proto = SnmpContextv3Face.MD5_PROTOCOL; if (param != null) { char f = param.charAt(0); if (f == 'S') { proto = SnmpContextv3Face.SHA1_PROTOCOL; } else { proto = SnmpContextv3Face.MD5_PROTOCOL; } } return proto; }
public void loadPropfile(File file) { propFile = file; try { FileInputStream in = new FileInputStream(propFile); prop.load(in); in.close(); System.out.println("Util(): Using properties file '" + propFile + "'."); } catch (FileNotFoundException exc) { propFile = null; System.out.println("Util(): FileNotFoundException " + exc.getMessage()); } catch (IOException exc) { propFile = null; System.out.println("Util(): IOException " + exc.getMessage()); } }
public String getProperty(String key, String defaultValue) { return prop.getProperty(key, defaultValue); }
public String getProperty(String key) { return prop.getProperty(key); }
public String getUserPrivPassword() { String passw = prop.getProperty(USER_PRIV_PASSWORD, "PrivPassword"); return passw; }
public String getUserName() { String userName = prop.getProperty(USERNAME, "authUser"); return userName; }
public String getUserAuthPassword() { String passw = prop.getProperty(USER_AUTH_PASSWORD, "AuthPassword"); return passw; }
public String getContextEngineIdStr() { String param = prop.getProperty(CONTEXT_ENGINE_ID); return param; }
public String getContextName() { String contextName = prop.getProperty(CONTEXT_NAME, ""); return contextName; }
/** * Returns the <code>oid</code> property. * * @param def The default value. * @return The <code>oid</code> property. * @see #OID */ public String getOid(String def) { String oid = prop.getProperty(OID, def); return oid; }
/** * Returns the <code>sockettype</code> property. The default value will be the standard socket. * * @return The <code>sockettype</code> property. * @see #SOCKETTYPE * @see SnmpContextFace#STANDARD_SOCKET */ public String getSocketType() { String socketType = prop.getProperty(SOCKETTYPE, SnmpContextFace.STANDARD_SOCKET); return socketType; }
/** * Returns the <code>port</code> property. * * @return The <code>port</code> property. * @see #PORT */ public String getPort() { String port = prop.getProperty(PORT, "" + SnmpContextBasisFace.DEFAULT_PORT); return port; }
/** * Returns the <code>bind</code> property. * * @return The <code>bind</code> property. * @see #BIND * @since 4_14 */ public String getBindAddress() { String bind = prop.getProperty(BIND); return bind; }
/** * Returns the <code>host</code> property. * * @return The <code>host</code> property. * @see #HOST */ public String getHost() { String host = prop.getProperty(HOST, myHost()); return host; }