1. /**
  2. * @(#)file SnmpEngineParameters.java
  3. * @(#)author Sun Microsystems, Inc.
  4. * @(#)version 1.13
  5. * @(#)date 04/09/15
  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;
  11. import java.io.Serializable;
  12. /**
  13. * This class is used to pass some specific parameters to an <CODE>
  14. * SnmpEngineFactory </CODE>.
  15. *
  16. * <p><b>This API is a Sun Microsystems internal API and is subject
  17. * to change without notice.</b></p>
  18. * @since 1.5
  19. */
  20. public class SnmpEngineParameters implements Serializable {
  21. private UserAcl uacl = null;
  22. private String securityFile = null;
  23. private boolean encrypt = false;
  24. private SnmpEngineId engineId = null;
  25. /**
  26. * Sets the file to use for SNMP Runtime Lcd. If no file is provided, the default location will be checked.
  27. */
  28. public void setSecurityFile(String securityFile) {
  29. this.securityFile = securityFile;
  30. }
  31. /**
  32. * Gets the file to use for SNMP Runtime Lcd.
  33. * @return The security file.
  34. */
  35. public String getSecurityFile() {
  36. return securityFile;
  37. }
  38. /**
  39. * Sets a customized user ACL. User Acl is used in order to check
  40. * access for SNMP V3 requests. If no ACL is provided,
  41. * <CODE>com.sun.jmx.snmp.usm.UserAcl.UserAcl</CODE> is instantiated.
  42. * @param uacl The user ACL to use.
  43. */
  44. public void setUserAcl(UserAcl uacl) {
  45. this.uacl = uacl;
  46. }
  47. /**
  48. * Gets the customized user ACL.
  49. * @return The customized user ACL.
  50. */
  51. public UserAcl getUserAcl() {
  52. return uacl;
  53. }
  54. /**
  55. * 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)
  56. *
  57. */
  58. public void activateEncryption() {
  59. this.encrypt = true;
  60. }
  61. /**
  62. * 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)
  63. *
  64. */
  65. public void deactivateEncryption() {
  66. this.encrypt = false;
  67. }
  68. /**
  69. * Check if encryption is activated. By default the encryption is not activated.
  70. * @return The encryption activation status.
  71. */
  72. public boolean isEncryptionEnabled() {
  73. return encrypt;
  74. }
  75. /**
  76. * Set the engine Id.
  77. * @param engineId The engine Id to use.
  78. */
  79. public void setEngineId(SnmpEngineId engineId) {
  80. this.engineId = engineId;
  81. }
  82. /**
  83. * Get the engine Id.
  84. * @return The engineId.
  85. */
  86. public SnmpEngineId getEngineId() {
  87. return engineId;
  88. }
  89. }