1. /*
  2. * @(#)file SnmpProperties.java
  3. * @(#)author Sun Microsystems, Inc.
  4. * @(#)version 1.10
  5. * @(#)lastedit 03/12/19
  6. *
  7. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  8. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  9. */
  10. package com.sun.jmx.snmp.defaults;
  11. // java import
  12. //
  13. import java.io.FileInputStream;
  14. import java.io.InputStream;
  15. import java.io.IOException;
  16. import java.util.Properties;
  17. import java.util.Enumeration;
  18. /**
  19. * This class reads a file containing the property list defined for Java DMK
  20. * and adds all the read properties to the list of system properties.
  21. *
  22. * <p><b>This API is a Sun Microsystems internal API and is subject
  23. * to change without notice.</b></p>
  24. * @version 1.10 12/19/03
  25. * @author Sun Microsystems, Inc
  26. *
  27. * @since 1.5
  28. */
  29. public class SnmpProperties {
  30. // private constructor defined to "hide" the default public constructor
  31. private SnmpProperties() {
  32. }
  33. // PUBLIC STATIC METHODS
  34. //----------------------
  35. /**
  36. * Reads the Java DMK property list from a file and
  37. * adds the read properties as system properties.
  38. */
  39. public static void load(String file) throws IOException {
  40. Properties props = new Properties();
  41. InputStream is = new FileInputStream(file);
  42. props.load(is);
  43. is.close();
  44. for (final Enumeration e = props.keys(); e.hasMoreElements() ; ) {
  45. final String key = (String) e.nextElement();
  46. System.setProperty(key,props.getProperty(key));
  47. }
  48. }
  49. // PUBLIC STATIC VARIABLES
  50. //------------------------
  51. /**
  52. * References the property that specifies the directory where
  53. * the native libraries will be stored before the MLet Service
  54. * loads them into memory.
  55. * <p>
  56. * Property Name: <B>jmx.mlet.library.dir</B>
  57. */
  58. public static final String MLET_LIB_DIR = "jmx.mlet.library.dir";
  59. /**
  60. * References the property that specifies the ACL file
  61. * used by the SNMP protocol adaptor.
  62. * <p>
  63. * Property Name: <B>jdmk.acl.file</B>
  64. */
  65. public static final String ACL_FILE = "jdmk.acl.file";
  66. /**
  67. * References the property that specifies the Security file
  68. * used by the SNMP protocol adaptor.
  69. * <p>
  70. * Property Name: <B>jdmk.security.file</B>
  71. */
  72. public static final String SECURITY_FILE = "jdmk.security.file";
  73. /**
  74. * References the property that specifies the User ACL file
  75. * used by the SNMP protocol adaptor.
  76. * <p>
  77. * Property Name: <B>jdmk.uacl.file</B>
  78. */
  79. public static final String UACL_FILE = "jdmk.uacl.file";
  80. /**
  81. * References the property that specifies the default mib_core file
  82. * used by the mibgen compiler.
  83. * <p>
  84. * Property Name: <B>mibcore.file</B>
  85. */
  86. public static final String MIB_CORE_FILE = "mibcore.file";
  87. /**
  88. * References the property that specifies the full name of the JMX
  89. * specification implemented by this product.
  90. * <p>
  91. * Property Name: <B>jmx.specification.name</B>
  92. */
  93. public static final String JMX_SPEC_NAME = "jmx.specification.name";
  94. /**
  95. * References the property that specifies the version of the JMX
  96. * specification implemented by this product.
  97. * <p>
  98. * Property Name: <B>jmx.specification.version</B>
  99. */
  100. public static final String JMX_SPEC_VERSION = "jmx.specification.version";
  101. /**
  102. * References the property that specifies the vendor of the JMX
  103. * specification implemented by this product.
  104. * <p>
  105. * Property Name: <B>jmx.specification.vendor</B>
  106. */
  107. public static final String JMX_SPEC_VENDOR = "jmx.specification.vendor";
  108. /**
  109. * References the property that specifies the full name of this product
  110. * implementing the JMX specification.
  111. * <p>
  112. * Property Name: <B>jmx.implementation.name</B>
  113. */
  114. public static final String JMX_IMPL_NAME = "jmx.implementation.name";
  115. /**
  116. * References the property that specifies the name of the vendor of this product
  117. * implementing the JMX specification.
  118. * <p>
  119. * Property Name: <B>jmx.implementation.vendor</B>
  120. */
  121. public static final String JMX_IMPL_VENDOR = "jmx.implementation.vendor";
  122. /**
  123. * References the property that specifies the version of this product
  124. * implementing the JMX specification.
  125. * <p>
  126. * Property Name: <B>jmx.implementation.version</B>
  127. */
  128. public static final String JMX_IMPL_VERSION = "jmx.implementation.version";
  129. /**
  130. * References the property that specifies the SSL cipher suites to
  131. * be enabled by the HTTP/SSL connector.
  132. * <p>
  133. * Property Name: <B>jdmk.ssl.cipher.suite.</B>
  134. * <p>
  135. * The list of SSL cipher suites is specified in the format:
  136. * <p>
  137. * <DD><B>jdmk.ssl.cipher.suite.</B><n><B>=</B><cipher suite name></DD>
  138. * <p>
  139. * For example:
  140. * <p>
  141. * <DD>jdmk.ssl.cipher.suite.1=SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA</DD>
  142. * <DD>jdmk.ssl.cipher.suite.2=SSL_RSA_EXPORT_WITH_RC4_40_MD5</DD>
  143. * <DD>. . .</DD>
  144. */
  145. public static final String SSL_CIPHER_SUITE = "jdmk.ssl.cipher.suite.";
  146. }