KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > jmx > snmp > defaults > SnmpProperties


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
11 package com.sun.jmx.snmp.defaults;
12
13 // java import
14
//
15
import java.io.FileInputStream JavaDoc;
16 import java.io.InputStream JavaDoc;
17 import java.io.IOException JavaDoc;
18 import java.util.Properties JavaDoc;
19 import java.util.Enumeration JavaDoc;
20
21 /**
22  * This class reads a file containing the property list defined for Java DMK
23  * and adds all the read properties to the list of system properties.
24  *
25  * <p><b>This API is a Sun Microsystems internal API and is subject
26  * to change without notice.</b></p>
27  * @version 1.10 12/19/03
28  * @author Sun Microsystems, Inc
29  *
30  * @since 1.5
31  */

32 public class SnmpProperties {
33
34     // private constructor defined to "hide" the default public constructor
35
private SnmpProperties() {
36     }
37
38     // PUBLIC STATIC METHODS
39
//----------------------
40

41     /**
42      * Reads the Java DMK property list from a file and
43      * adds the read properties as system properties.
44      */

45     public static void load(String JavaDoc file) throws IOException JavaDoc {
46         Properties JavaDoc props = new Properties JavaDoc();
47         InputStream JavaDoc is = new FileInputStream JavaDoc(file);
48         props.load(is);
49         is.close();
50     for (final Enumeration JavaDoc e = props.keys(); e.hasMoreElements() ; ) {
51         final String JavaDoc key = (String JavaDoc) e.nextElement();
52         System.setProperty(key,props.getProperty(key));
53     }
54     }
55
56     // PUBLIC STATIC VARIABLES
57
//------------------------
58

59     /**
60      * References the property that specifies the directory where
61      * the native libraries will be stored before the MLet Service
62      * loads them into memory.
63      * <p>
64      * Property Name: <B>jmx.mlet.library.dir</B>
65      */

66     public static final String JavaDoc MLET_LIB_DIR = "jmx.mlet.library.dir";
67
68     /**
69      * References the property that specifies the ACL file
70      * used by the SNMP protocol adaptor.
71      * <p>
72      * Property Name: <B>jdmk.acl.file</B>
73      */

74     public static final String JavaDoc ACL_FILE = "jdmk.acl.file";
75
76     /**
77      * References the property that specifies the Security file
78      * used by the SNMP protocol adaptor.
79      * <p>
80      * Property Name: <B>jdmk.security.file</B>
81      */

82     public static final String JavaDoc SECURITY_FILE = "jdmk.security.file";
83
84     /**
85      * References the property that specifies the User ACL file
86      * used by the SNMP protocol adaptor.
87      * <p>
88      * Property Name: <B>jdmk.uacl.file</B>
89      */

90     public static final String JavaDoc UACL_FILE = "jdmk.uacl.file";
91
92     /**
93      * References the property that specifies the default mib_core file
94      * used by the mibgen compiler.
95      * <p>
96      * Property Name: <B>mibcore.file</B>
97      */

98     public static final String JavaDoc MIB_CORE_FILE = "mibcore.file";
99
100     /**
101      * References the property that specifies the full name of the JMX
102      * specification implemented by this product.
103      * <p>
104      * Property Name: <B>jmx.specification.name</B>
105      */

106      public static final String JavaDoc JMX_SPEC_NAME = "jmx.specification.name";
107     
108     /**
109      * References the property that specifies the version of the JMX
110      * specification implemented by this product.
111      * <p>
112      * Property Name: <B>jmx.specification.version</B>
113      */

114      public static final String JavaDoc JMX_SPEC_VERSION = "jmx.specification.version";
115     
116     /**
117      * References the property that specifies the vendor of the JMX
118      * specification implemented by this product.
119      * <p>
120      * Property Name: <B>jmx.specification.vendor</B>
121      */

122      public static final String JavaDoc JMX_SPEC_VENDOR = "jmx.specification.vendor";
123     
124     /**
125      * References the property that specifies the full name of this product
126      * implementing the JMX specification.
127      * <p>
128      * Property Name: <B>jmx.implementation.name</B>
129      */

130     public static final String JavaDoc JMX_IMPL_NAME = "jmx.implementation.name";
131     
132     /**
133      * References the property that specifies the name of the vendor of this product
134      * implementing the JMX specification.
135      * <p>
136      * Property Name: <B>jmx.implementation.vendor</B>
137      */

138     public static final String JavaDoc JMX_IMPL_VENDOR = "jmx.implementation.vendor";
139     
140     /**
141      * References the property that specifies the version of this product
142      * implementing the JMX specification.
143      * <p>
144      * Property Name: <B>jmx.implementation.version</B>
145      */

146     public static final String JavaDoc JMX_IMPL_VERSION = "jmx.implementation.version";
147
148     /**
149      * References the property that specifies the SSL cipher suites to
150      * be enabled by the HTTP/SSL connector.
151      * <p>
152      * Property Name: <B>jdmk.ssl.cipher.suite.</B>
153      * <p>
154      * The list of SSL cipher suites is specified in the format:
155      * <p>
156      * <DD><B>jdmk.ssl.cipher.suite.</B>&lt;n&gt;<B>=</B>&lt;cipher suite name&gt;</DD>
157      * <p>
158      * For example:
159      * <p>
160      * <DD>jdmk.ssl.cipher.suite.1=SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA</DD>
161      * <DD>jdmk.ssl.cipher.suite.2=SSL_RSA_EXPORT_WITH_RC4_40_MD5</DD>
162      * <DD>. . .</DD>
163      */

164     public static final String JavaDoc SSL_CIPHER_SUITE = "jdmk.ssl.cipher.suite.";
165 }
166
Popular Tags