KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > activemq > store > ReferenceStore


1 /**
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one or more
4  * contributor license agreements. See the NOTICE file distributed with
5  * this work for additional information regarding copyright ownership.
6  * The ASF licenses this file to You under the Apache License, Version 2.0
7  * (the "License"); you may not use this file except in compliance with
8  * the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18
19 package org.apache.activemq.store;
20
21 import java.io.IOException JavaDoc;
22
23 import org.apache.activemq.broker.ConnectionContext;
24 import org.apache.activemq.command.MessageId;
25
26 /**
27  * Represents a message store which is used by the persistent
28  * implementations
29  *
30  * @version $Revision: 1.5 $
31  */

32 public interface ReferenceStore extends MessageStore {
33
34     public class ReferenceData {
35         long expiration;
36         int fileId;
37         int offset;
38         
39         public long getExpiration() {
40             return expiration;
41         }
42         public void setExpiration(long expiration) {
43             this.expiration = expiration;
44         }
45         public int getFileId() {
46             return fileId;
47         }
48         public void setFileId(int file) {
49             this.fileId = file;
50         }
51         public int getOffset() {
52             return offset;
53         }
54         public void setOffset(int offset) {
55             this.offset = offset;
56         }
57         
58         @Override JavaDoc
59         public String JavaDoc toString() {
60             return "ReferenceData fileId="+fileId+", offset="+offset+", expiration="+expiration;
61         }
62     }
63     
64     /**
65      * Adds a message reference to the message store
66      */

67     public void addMessageReference(ConnectionContext context, MessageId messageId, ReferenceData data) throws IOException JavaDoc;
68
69     /**
70      * Looks up a message using either the String messageID or the messageNumber. Implementations are encouraged to fill
71      * in the missing key if its easy to do so.
72      */

73     public ReferenceData getMessageReference(MessageId identity) throws IOException JavaDoc;
74     
75     /**
76      * @return true if it supports external batch control
77      */

78     public boolean supportsExternalBatchControl();
79     
80     public void setBatch(MessageId startAfter);
81     
82 }
83
Popular Tags