Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/com/sun/jmx/snmp/SnmpEngineParameters.java
38924 views
/*1* Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package com.sun.jmx.snmp;2627import java.io.Serializable;2829/**30* This class is used to pass some specific parameters to an <CODE>31* SnmpEngineFactory </CODE>.32*33* <p><b>This API is a Sun Microsystems internal API and is subject34* to change without notice.</b></p>35* @since 1.536*/37public class SnmpEngineParameters implements Serializable {38private static final long serialVersionUID = 3720556613478400808L;3940private UserAcl uacl = null;41private String securityFile = null;42private boolean encrypt = false;43private SnmpEngineId engineId = null;4445/**46* Sets the file to use for SNMP Runtime Lcd. If no file is provided, the default location will be checked.47*/48public void setSecurityFile(String securityFile) {49this.securityFile = securityFile;50}5152/**53* Gets the file to use for SNMP Runtime Lcd.54* @return The security file.55*/56public String getSecurityFile() {57return securityFile;58}59/**60* Sets a customized user ACL. User Acl is used in order to check61* access for SNMP V3 requests. If no ACL is provided,62* <CODE>com.sun.jmx.snmp.usm.UserAcl.UserAcl</CODE> is instantiated.63* @param uacl The user ACL to use.64*/65public void setUserAcl(UserAcl uacl) {66this.uacl = uacl;67}6869/**70* Gets the customized user ACL.71* @return The customized user ACL.72*/73public UserAcl getUserAcl() {74return uacl;75}7677/**78* 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)79*80*/81public void activateEncryption() {82this.encrypt = true;83}8485/**86* 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)87*88*/89public void deactivateEncryption() {90this.encrypt = false;91}9293/**94* Check if encryption is activated. By default the encryption is not activated.95* @return The encryption activation status.96*/97public boolean isEncryptionEnabled() {98return encrypt;99}100101/**102* Set the engine Id.103* @param engineId The engine Id to use.104*/105public void setEngineId(SnmpEngineId engineId) {106this.engineId = engineId;107}108109/**110* Get the engine Id.111* @return The engineId.112*/113public SnmpEngineId getEngineId() {114return engineId;115}116}117118119