示例#1
0
 /**
  * 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;
 }
示例#2
0
 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;
 }
示例#3
0
 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;
 }
示例#4
0
 public String getProperty(String key, String defaultValue) {
   return prop.getProperty(key, defaultValue);
 }
示例#5
0
 public String getProperty(String key) {
   return prop.getProperty(key);
 }
示例#6
0
 public String getUserPrivPassword() {
   String passw = prop.getProperty(USER_PRIV_PASSWORD, "PrivPassword");
   return passw;
 }
示例#7
0
 public String getUserName() {
   String userName = prop.getProperty(USERNAME, "authUser");
   return userName;
 }
示例#8
0
 public String getUserAuthPassword() {
   String passw = prop.getProperty(USER_AUTH_PASSWORD, "AuthPassword");
   return passw;
 }
示例#9
0
 public String getContextEngineIdStr() {
   String param = prop.getProperty(CONTEXT_ENGINE_ID);
   return param;
 }
示例#10
0
 public String getContextName() {
   String contextName = prop.getProperty(CONTEXT_NAME, "");
   return contextName;
 }
示例#11
0
 /**
  * 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;
 }
示例#12
0
 /**
  * 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;
 }
示例#13
0
 /**
  * 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;
 }
示例#14
0
 /**
  * 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;
 }
示例#15
0
 /**
  * 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;
 }