01: /*_############################################################################
02: _##
03: _## SNMP4J - TransportListener.java
04: _##
05: _## Copyright (C) 2003-2008 Frank Fock and Jochen Katz (SNMP4J.org)
06: _##
07: _## Licensed under the Apache License, Version 2.0 (the "License");
08: _## you may not use this file except in compliance with the License.
09: _## You may obtain a copy of the License at
10: _##
11: _## http://www.apache.org/licenses/LICENSE-2.0
12: _##
13: _## Unless required by applicable law or agreed to in writing, software
14: _## distributed under the License is distributed on an "AS IS" BASIS,
15: _## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16: _## See the License for the specific language governing permissions and
17: _## limitations under the License.
18: _##
19: _##########################################################################*/
20:
21: package org.snmp4j.transport;
22:
23: import org.snmp4j.smi.Address;
24: import org.snmp4j.TransportMapping;
25: import java.nio.ByteBuffer; // JavaDoc import
26: import org.snmp4j.MessageDispatcher;
27:
28: /**
29: * The <code>TransportListener</code> interface is implemented by objects
30: * that process incoming messages from <code>TransportMapping</code>s, for
31: * example {@link MessageDispatcher}.
32: *
33: * @author Frank Fock
34: * @version 1.6
35: * @since 1.6
36: */
37: public interface TransportListener {
38:
39: /**
40: * Processes an incoming message.
41: * @param sourceTransport
42: * a <code>TransportMapping</code> instance denoting the transport that
43: * received the message and that will be used to send any responses to
44: * this message. The <code>sourceTransport</code> has to support the
45: * <code>incomingAddress</code>'s implementation class.
46: * @param incomingAddress
47: * the <code>Address</code> from which the message has been received.
48: * @param wholeMessage
49: * an <code>ByteBuffer</code> containing the received message.
50: * @since 1.6
51: */
52: void processMessage(TransportMapping sourceTransport,
53: Address incomingAddress, ByteBuffer wholeMessage);
54: }
|