KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > jmx > snmp > SnmpEngineParameters


1 /**
2  * @(#)file SnmpEngineParameters.java
3  * @(#)author Sun Microsystems, Inc.
4  * @(#)version 1.13
5  * @(#)date 08/02/09
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;
12
13 import java.io.Serializable JavaDoc;
14
15 /**
16  * This class is used to pass some specific parameters to an <CODE>
17  * SnmpEngineFactory </CODE>.
18  *
19  * <p><b>This API is a Sun Microsystems internal API and is subject
20  * to change without notice.</b></p>
21  * @since 1.5
22  */

23 public class SnmpEngineParameters implements Serializable JavaDoc {
24     private UserAcl uacl = null;
25     private String JavaDoc securityFile = null;
26     private boolean encrypt = false;
27     private SnmpEngineId engineId = null;
28     
29     /**
30      * Sets the file to use for SNMP Runtime Lcd. If no file is provided, the default location will be checked.
31      */

32     public void setSecurityFile(String JavaDoc securityFile) {
33     this.securityFile = securityFile;
34     }
35     
36     /**
37      * Gets the file to use for SNMP Runtime Lcd.
38      * @return The security file.
39      */

40     public String JavaDoc getSecurityFile() {
41     return securityFile;
42     }
43     /**
44      * Sets a customized user ACL. User Acl is used in order to check
45      * access for SNMP V3 requests. If no ACL is provided,
46      * <CODE>com.sun.jmx.snmp.usm.UserAcl.UserAcl</CODE> is instantiated.
47      * @param uacl The user ACL to use.
48      */

49     public void setUserAcl(UserAcl uacl) {
50     this.uacl = uacl;
51     }
52     
53     /**
54      * Gets the customized user ACL.
55      * @return The customized user ACL.
56      */

57     public UserAcl getUserAcl() {
58     return uacl;
59     }
60     
61     /**
62      * Activate SNMP V3 encryption. By default the encryption is not activated. Be sure that the security provider classes needed for DES are in your classpath (eg:JCE classes)
63      *
64      */

65     public void activateEncryption() {
66     this.encrypt = true;
67     }
68
69     /**
70      * Deactivate SNMP V3 encryption. By default the encryption is not activated. Be sure that the security provider classes needed for DES are in your classpath (eg:JCE classes)
71      *
72      */

73     public void deactivateEncryption() {
74     this.encrypt = false;
75     }
76     
77     /**
78      * Check if encryption is activated. By default the encryption is not activated.
79      * @return The encryption activation status.
80      */

81     public boolean isEncryptionEnabled() {
82     return encrypt;
83     }
84
85     /**
86      * Set the engine Id.
87      * @param engineId The engine Id to use.
88      */

89     public void setEngineId(SnmpEngineId engineId) {
90     this.engineId = engineId;
91     }
92     
93     /**
94      * Get the engine Id.
95      * @return The engineId.
96      */

97     public SnmpEngineId getEngineId() {
98     return engineId;
99     }
100 }
101
Popular Tags