ContentHeaderProperties.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.framing;
22 
23 import org.apache.mina.common.ByteBuffer;
24 
25 /**
26  * There will be an implementation of this interface for each content type. All content types have associated
27  * header properties and this provides a way to encode and decode them.
28  */
29 public interface ContentHeaderProperties
30 {
31     /**
32      * Writes the property list to the buffer, in a suitably encoded form.
33      @param buffer The buffer to write to
34      */
35     void writePropertyListPayload(ByteBuffer buffer);
36 
37     /**
38      * Populates the properties from buffer.
39      @param buffer The buffer to read from.
40      @param propertyFlags he property flags.
41      @throws AMQFrameDecodingException when the buffer does not contain valid data
42      */
43     void populatePropertiesFromBuffer(ByteBuffer buffer, int propertyFlags, int size)
44         throws AMQFrameDecodingException;
45 
46     /**
47      @return the size of the encoded property list in bytes.
48      */
49     int getPropertyListSize();
50 
51     /**
52      * Gets the property flags. Property flags indicate which properties are set in the list. The
53      * position and meaning of each flag is defined in the protocol specification for the particular
54      * content type with which these properties are associated.
55      @return flags
56      */
57     int getPropertyFlags();
58 
59     void updated();
60 }