View Javadoc

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.internal;
17  
18  import net.sf.beep4j.Message;
19  
20  
21  /**
22   * Interface to be implemented by processors of reassembled messages.
23   * 
24   * @author Simon Raess
25   */
26  public interface MessageHandler {
27  	
28  	/**
29  	 * Receive a MSG message.
30  	 * 
31  	 * @param channelNumber the channel number
32  	 * @param messageNumber the message number
33  	 * @param message the Message itself
34  	 */
35  	void receiveMSG(int channelNumber, int messageNumber, Message message);
36  	
37  	/**
38  	 * Receive a RPY message.
39  	 * 
40  	 * @param channelNumber the channel number
41  	 * @param messageNumber the message number
42  	 * @param message the Message itself
43  	 */
44  	void receiveRPY(int channelNumber, int messageNumber, Message message);
45  
46  	/**
47  	 * Receive a ERR message.
48  	 * 
49  	 * @param channelNumber the channel number
50  	 * @param messageNumber the message number
51  	 * @param message the Message itself
52  	 */
53  	void receiveERR(int channelNumber, int messageNumber, Message message);
54  
55  	/**
56  	 * Receive a ANS message.
57  	 * 
58  	 * @param channelNumber the channel number
59  	 * @param messageNumber the message number
60  	 * @param answerNumber the answer number
61  	 * @param message the Message itself
62  	 */
63  	void receiveANS(int channelNumber, int messageNumber, int answerNumber, Message message);
64  
65  	/**
66  	 * Receive a NUL message.
67  	 * 
68  	 * @param channelNumber the channel number
69  	 * @param messageNumber the message number
70  	 */
71  	void receiveNUL(int channelNumber, int messageNumber);
72  	
73  }