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.server.queue;
22
23 import org.apache.qpid.framing.ContentHeaderBody;
24 import org.apache.qpid.framing.abstraction.MessagePublishInfo;
25
26 /**
27 * Encapsulates a publish body and a content header. In the context of the message store these are treated as a
28 * single unit.
29 */
30 public class MessageMetaData
31 {
32 private MessagePublishInfo _messagePublishInfo;
33
34 private ContentHeaderBody _contentHeaderBody;
35
36 private int _contentChunkCount;
37
38 private long _arrivalTime;
39
40 public MessageMetaData(MessagePublishInfo publishBody, ContentHeaderBody contentHeaderBody, int contentChunkCount)
41 {
42 this(publishBody,contentHeaderBody, contentChunkCount, System.currentTimeMillis());
43 }
44
45 public MessageMetaData(MessagePublishInfo publishBody, ContentHeaderBody contentHeaderBody, int contentChunkCount, long arrivalTime)
46 {
47 _contentHeaderBody = contentHeaderBody;
48 _messagePublishInfo = publishBody;
49 _contentChunkCount = contentChunkCount;
50 _arrivalTime = arrivalTime;
51 }
52
53 public int getContentChunkCount()
54 {
55 return _contentChunkCount;
56 }
57
58 public void setContentChunkCount(int contentChunkCount)
59 {
60 _contentChunkCount = contentChunkCount;
61 }
62
63 public ContentHeaderBody getContentHeaderBody()
64 {
65 return _contentHeaderBody;
66 }
67
68 public void setContentHeaderBody(ContentHeaderBody contentHeaderBody)
69 {
70 _contentHeaderBody = contentHeaderBody;
71 }
72
73 public MessagePublishInfo getMessagePublishInfo()
74 {
75 return _messagePublishInfo;
76 }
77
78 public void setMessagePublishInfo(MessagePublishInfo messagePublishInfo)
79 {
80 _messagePublishInfo = messagePublishInfo;
81 }
82
83 public long getArrivalTime()
84 {
85 return _arrivalTime;
86 }
87
88 public void setArrivalTime(long arrivalTime)
89 {
90 _arrivalTime = arrivalTime;
91 }
92 }
|