Exemple #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;
 }
Exemple #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;
 }
Exemple #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;
 }
Exemple #4
0
 public String getProperty(String key, String defaultValue) {
   return prop.getProperty(key, defaultValue);
 }
Exemple #5
0
 public String getProperty(String key) {
   return prop.getProperty(key);
 }
Exemple #6
0
 public String getUserPrivPassword() {
   String passw = prop.getProperty(USER_PRIV_PASSWORD, "PrivPassword");
   return passw;
 }
Exemple #7
0
 public String getUserName() {
   String userName = prop.getProperty(USERNAME, "authUser");
   return userName;
 }
Exemple #8
0
 public String getUserAuthPassword() {
   String passw = prop.getProperty(USER_AUTH_PASSWORD, "AuthPassword");
   return passw;
 }
Exemple #9
0
 public String getContextEngineIdStr() {
   String param = prop.getProperty(CONTEXT_ENGINE_ID);
   return param;
 }
Exemple #10
0
 public String getContextName() {
   String contextName = prop.getProperty(CONTEXT_NAME, "");
   return contextName;
 }
Exemple #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;
 }
Exemple #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;
 }
Exemple #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;
 }
Exemple #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;
 }
Exemple #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;
 }