0N/A/*
2362N/A * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
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 *
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 *
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.
0N/A *
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
2362N/A * questions.
0N/A */
0N/Apackage com.sun.jmx.snmp.internal;
0N/A
0N/Aimport java.net.InetAddress;
0N/Aimport com.sun.jmx.snmp.SnmpPduFactory;
0N/Aimport com.sun.jmx.snmp.SnmpSecurityParameters;
0N/Aimport com.sun.jmx.snmp.SnmpSecurityException;
0N/Aimport com.sun.jmx.snmp.SnmpTooBigException;
0N/Aimport com.sun.jmx.snmp.SnmpStatusException;
0N/Aimport com.sun.jmx.snmp.SnmpPdu;
0N/Aimport com.sun.jmx.snmp.SnmpMsg;
0N/A
0N/Aimport com.sun.jmx.snmp.internal.SnmpSecurityCache;
0N/Aimport com.sun.jmx.snmp.SnmpBadSecurityLevelException;
0N/A/**
0N/A * <P> An <CODE>SnmpIncomingResponse</CODE> handles the unmarshalling of the received response.</P>
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 * @since 1.5
0N/A */
0N/A
0N/Apublic interface SnmpIncomingResponse {
0N/A /**
0N/A * Returns the source address.
0N/A * @return The source address.
0N/A */
0N/A public InetAddress getAddress();
0N/A
0N/A /**
0N/A * Returns the source port.
0N/A * @return The source port.
0N/A */
0N/A public int getPort();
0N/A
0N/A /**
0N/A * Gets the incoming response security parameters.
0N/A * @return The security parameters.
0N/A **/
0N/A public SnmpSecurityParameters getSecurityParameters();
0N/A /**
0N/A * Call this method in order to reuse <CODE>SnmpOutgoingRequest</CODE> cache.
0N/A * @param cache The security cache.
0N/A */
0N/A public void setSecurityCache(SnmpSecurityCache cache);
0N/A /**
0N/A * Gets the incoming response security level. This level is defined in
0N/A * {@link com.sun.jmx.snmp.SnmpEngine SnmpEngine}.
0N/A * @return The security level.
0N/A */
0N/A public int getSecurityLevel();
0N/A /**
0N/A * Gets the incoming response security model.
0N/A * @return The security model.
0N/A */
0N/A public int getSecurityModel();
0N/A /**
0N/A * Gets the incoming response context name.
0N/A * @return The context name.
0N/A */
0N/A public byte[] getContextName();
0N/A
0N/A /**
0N/A * Decodes the specified bytes and initializes itself with the received
0N/A * response.
0N/A *
0N/A * @param inputBytes The bytes to be decoded.
0N/A *
0N/A * @exception SnmpStatusException If the specified bytes are not a valid encoding.
0N/A */
0N/A public SnmpMsg decodeMessage(byte[] inputBytes,
0N/A int byteCount,
0N/A InetAddress address,
0N/A int port)
0N/A throws SnmpStatusException, SnmpSecurityException;
0N/A
0N/A /**
0N/A * Gets the request PDU encoded in the received response.
0N/A * <P>
0N/A * This method decodes the data field and returns the resulting PDU.
0N/A *
0N/A * @return The resulting PDU.
0N/A * @exception SnmpStatusException If the encoding is not valid.
0N/A */
0N/A public SnmpPdu decodeSnmpPdu()
0N/A throws SnmpStatusException;
0N/A
0N/A /**
0N/A * Returns the response request Id.
0N/A * @param data The flat message.
0N/A * @return The request Id.
0N/A */
0N/A public int getRequestId(byte[] data) throws SnmpStatusException;
0N/A
0N/A /**
0N/A * Returns a stringified form of the message to send.
0N/A * @return The message state string.
0N/A */
0N/A public String printMessage();
0N/A}