2362N/A * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * This engine is conformant with the RFC 2571. It is the main object within 0N/A * an SNMP entity (agent, manager...). 0N/A * To an engine is associated an {@link com.sun.jmx.snmp.SnmpEngineId}. 0N/A * The way the engineId is retrieved is linked to the way the engine is 0N/A * instantiated. See each <CODE>SnmpEngine</CODE> constructor for more details. 0N/A * An engine is composed of a set of sub systems 0N/A * {@link com.sun.jmx.snmp.internal.SnmpSubSystem}. An <CODE>SNMP</CODE> 0N/A * engine can contain a: 0N/A *<li> Message Processing Sub System : 0N/A * {@link com.sun.jmx.snmp.internal.SnmpMsgProcessingSubSystem}</li> 0N/A *<li> Security Sub System : 0N/A * {@link com.sun.jmx.snmp.internal.SnmpSecuritySubSystem} </li> 0N/A *<li> Access Control Sub System : 0N/A * {@link com.sun.jmx.snmp.internal.SnmpAccessControlSubSystem}</li> 0N/A *<P> Each sub system contains a set of models. A model is an implementation 0N/A * of a particular treatement (eg: the User based Security Model defined in 0N/A * RFC 2574 is a functional element dealing with authentication and privacy). 0N/A * Engine instantiation is based on a factory. This factory, implementing 0N/A * mandatorily {@link com.sun.jmx.snmp.SnmpEngineFactory SnmpEngineFactory} 0N/A * is set in the method <CODE>setFactory</CODE>. 0N/A * <p><b>This API is a Sun Microsystems internal API and is subject 0N/A * to change without notice.</b></p> 0N/A * Security level. No authentication, no privacy. Value is 0, 0N/A * as defined in RFC 2572 0N/A * Security level. Authentication, no privacy. Value is 1, as 0N/A * defined in RFC 2572 0N/A * Security level. Authentication, privacy. Value is 3, 0N/A * as defined in RFC 2572 0N/A * Flag that indicates that a report is to be sent. Value is 4, as defined in RFC 2572 0N/A * Mask used to isolate authentication information within a message flag. 0N/A * Mask used to isolate privacy information within a message flag. 0N/A * Mask used to isolate authentication and privacy information within a message flag. 0N/A * Gets the engine time in seconds. This is the time from the last reboot. 0N/A * @return The time from the last reboot. 0N/A //We do the counter wrap in a lazt way. Each time Engine is asked for his time it checks. So if nobody use the Engine, the time can wrap and wrap again without incrementing nb boot. We can imagine that it is irrelevant due to the amount of time needed to wrap. 0N/A //67 years of running. That is a great thing! 0N/A //Reinitialize startTime. 0N/A //Can't do anything with this counter. 0N/A //Store for future use. 0N/A * Gets the engine Id. This is unique for each engine. 0N/A * @return The engine Id object. 0N/A * Gets the Usm key handler. 0N/A * @return The key handler. 0N/A * Gets the engine Lcd. 0N/A * @return The engine Lcd. 0N/A * Gets the engine boot number. This is the number of time this engine has rebooted. Each time an <CODE>SnmpEngine</CODE> is instantiated, it will read this value in its Lcd, and store back the value incremented by one. 0N/A * @return The engine's number of reboot. 0N/A * Constructor. A Local Configuration Datastore is passed to the engine. It will be used to store and retrieve data (engine Id, engine boots). 0N/A * <P> WARNING : The SnmpEngineId is computed as follow: 0N/A * <li> If an lcd file is provided containing the property "localEngineID", this property value is used.</li>. 0N/A * <li> If not, if the passed engineID is not null, this engine ID is used.</li> 0N/A * <li> If not, a time based engineID is computed.</li> 0N/A * This constructor should be called by an <CODE>SnmpEngineFactory</CODE>. Don't call it directly. 0N/A * @param fact The factory used to instantiate this engine. 0N/A * @param lcd The local configuration datastore. 0N/A * @param engineid The engine ID to use. If null is provided, an SnmpEngineId is computed using the current time. 0N/A * @throws UnknownHostException Exception thrown, if the host name located in the property "localEngineID" is invalid. 0N/A "SnmpEngineImpl(SnmpEngineFactory,SnmpLcd,SnmpEngineId)",
0N/A * Constructor. A Local Configuration Datastore is passed to the engine. It will be used to store and retrieve data (engine ID, engine boots). 0N/A * <P> WARNING : The SnmpEngineId is computed as follow: 0N/A * <li> If an lcd file is provided containing the property "localEngineID", this property value is used.</li>. 0N/A * <li> If not, the passed address and port are used to compute one.</li> 0N/A * This constructor should be called by an <CODE>SnmpEngineFactory</CODE>. Don't call it directly. 0N/A * @param fact The factory used to instantiate this engine. 0N/A * @param lcd The local configuration datastore. 0N/A * @param port UDP port to use in order to calculate the engine ID. 0N/A * @param address An IP address used to calculate the engine ID. 0N/A * @throws UnknownHostException Exception thrown, if the host name located in the property "localEngineID" is invalid. 0N/A "SnmpEngineImpl(SnmpEngineFactory,SnmpLcd,InetAddress,int)",
0N/A "LOCAL ENGINE NB BOOTS: " +
boot +
" / " +
0N/A * Constructor. A Local Configuration Datastore is passed to the engine. It will be used to store and retrieve data (engine ID, engine boots). 0N/A * <P> WARNING : The SnmpEngineId is computed as follow: 0N/A * <li> If an lcd file is provided containing the property "localEngineID", this property value is used.</li>. 0N/A * <li> If not, The passed port is used to compute one.</li> 0N/A * This constructor should be called by an <CODE>SnmpEngineFactory</CODE>. Don't call it directly. 0N/A * @param fact The factory used to instantiate this engine. 0N/A * @param lcd The local configuration datastore 0N/A * @param port UDP port to use in order to calculate the engine ID. 0N/A * @throws UnknownHostException Exception thrown, if the host name located in the property "localEngineID" is invalid. 0N/A "SnmpEngineImpl(SnmpEngineFactory,SnmpLcd,int)",
0N/A "LOCAL ENGINE NB BOOTS: " +
boot +
" / " +
0N/A * Constructor. A Local Configuration Datastore is passed to the engine. It will be used to store and retrieve data (engine ID, engine boots). 0N/A * <P> WARNING : The SnmpEngineId is computed as follow: 0N/A * <li> If an lcd file is provided containing the property "localEngineID", this property value is used.</li>. 0N/A * <li> If not, a time based engineID is computed.</li> 0N/A * When no configuration nor java property is set for the engine ID value, a unique time based engine ID will be generated. 0N/A * This constructor should be called by an <CODE>SnmpEngineFactory</CODE>. Don't call it directly. 0N/A * @param fact The factory used to instantiate this engine. 0N/A * @param lcd The local configuration datastore. 0N/A "SnmpEngineImpl(SnmpEngineFactory,SnmpLcd)",
0N/A "LOCAL ENGINE NB BOOTS: " +
boot +
" / " +
0N/A * Access Control will check the oids. By default is false. 0N/A * Access Control will not check the oids. By default is false. 0N/A * Access Control check or not the oids. By default is false. 0N/A //Do some check and store the nb boots value. 0N/A // Initialize internal status. 0N/A //Initialize the engineID. 0N/A * Returns the Message Processing Sub System. 0N/A * @return The Message Processing Sub System. 0N/A * Sets the Message Processing Sub System. 0N/A * @param sys The Message Processing Sub System. 0N/A * Returns the Security Sub System. 0N/A * @return The Security Sub System. 0N/A * Sets the Security Sub System. 0N/A * @param sys The Security Sub System. 0N/A * Sets the Access Control Sub System. 0N/A * @param sys The Access Control Sub System. 0N/A * Returns the Access Control Sub System. 0N/A * @return The Access Control Sub System. 0N/A * Checks the passed msg flags according to the rules specified in RFC 2572. 0N/A * @param msgFlags The msg flags.