1 /*
2 * Copyright 2006 Simon Raess
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package net.sf.beep4j;
17
18 /**
19 * Callback interface used to notify the application about a
20 * reply to a message. Whenever the application sends a message
21 * ({@link Channel#sendMessage(Message, ReplyListener)}) it
22 * specifies a ReplyListener.
23 *
24 * @author Simon Raess
25 */
26 public interface ReplyHandler {
27
28 /**
29 * Invoked when an ANS response is received. For a one-to-many
30 * exchange style this method can be invoked 0 or more times.
31 *
32 * @param message the received message
33 */
34 void receivedANS(Message message);
35
36 /**
37 * Invoked when a NUL response is received. For a one-to-many
38 * exchange style this method marks the end of such an exchange.
39 * No further methods must be invoked on the listener after
40 * this method has been invoked.
41 */
42 void receivedNUL();
43
44 /**
45 * Invoked when an ERR response is received. This type of response
46 * is also termed negativ reply.
47 *
48 * @param message the received message
49 */
50 void receivedERR(Message message);
51
52 /**
53 * Invoked when a RPY response is received. This type of response
54 * is also termed positiv reply.
55 *
56 * @param message the received message
57 */
58 void receivedRPY(Message message);
59
60 }