AMQVersionAwareProtocolSession.java
01 /*
02  *
03  * Licensed to the Apache Software Foundation (ASF) under one
04  * or more contributor license agreements.  See the NOTICE file
05  * distributed with this work for additional information
06  * regarding copyright ownership.  The ASF licenses this file
07  * to you under the Apache License, Version 2.0 (the
08  * "License"); you may not use this file except in compliance
09  * with the License.  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,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  */
21 package org.apache.qpid.protocol;
22 
23 import org.apache.qpid.framing.*;
24 import org.apache.qpid.transport.Sender;
25 import org.apache.qpid.AMQException;
26 
27 import java.nio.ByteBuffer;
28 
29 
30 /**
31  * AMQVersionAwareProtocolSession is implemented by all AMQP session classes, that need to provide an awareness to
32  * callers of the version of the AMQP protocol that they are able to work with.
33  *
34  <p/><table id="crc"><caption>CRC Card</caption>
35  <tr><th> Responsibilities
36  <tr><td> Provide the method registry for a specific version of the AMQP.
37  </table>
38  *
39  * @todo Why is this a seperate interface to {@link ProtocolVersionAware}, could they be combined into a single
40  *       interface and one of them eliminated? Move getRegistry method to ProtocolVersionAware, make the sessions
41  *       implement AMQProtocolWriter directly and drop this interface.
42  */
43 public interface AMQVersionAwareProtocolSession extends AMQProtocolWriter, ProtocolVersionAware
44 {
45     /**
46      * Gets the method registry for a specific version of the AMQP.
47      *
48      @return The method registry for a specific version of the AMQP.
49      */
50 //    public VersionSpecificRegistry getRegistry();
51 
52     MethodRegistry getMethodRegistry();
53 
54 
55     public void methodFrameReceived(int channelId, AMQMethodBody bodythrows AMQException;
56     public void contentHeaderReceived(int channelId, ContentHeaderBody bodythrows AMQException;
57     public void contentBodyReceived(int channelId, ContentBody bodythrows AMQException;
58     public void heartbeatBodyReceived(int channelId, HeartbeatBody bodythrows AMQException;
59 
60 
61     public void setSender(Sender<ByteBuffer> sender);
62     public void init();
63 
64 }