1 /*------------------------------------------------------------------------------
 2 Name:      I_QueueEntry.cs
 3 Copyright: xmlBlaster.org, see xmlBlaster-LICENSE file
 4 ------------------------------------------------------------------------------*/
 5 
 6 using System.Text;
 7 using System.Collections;
 8 
 9 namespace org.xmlBlaster.util
10 {
11    public interface I_QueueEntry
12    {
13       /**
14        * Allows to query the priority of this entry.
15        * This is the highest order precedence in the sorted queue
16        * @return The priority
17        */
18       int GetPriority();
19 
20       /**
21        * Returns true if the entry is persistent (persistent on HD), false otherwise.
22        */
23       bool IsPersistent();
24 
25       /**
26        * This is the second order criteria in the queue
27        * @return The unique Id of this entry.
28        */
29       string GetUniqueId();
30 
31       /**
32        * gets the content of this queue entry (the embedded object). In
33        * persistent queues this is the data which is stored as a blob.
34        */
35       object getEmbeddedObject();
36 
37       /**
38        * Gets the type of the object embedded in this entry, how the object is serialized.
39        * @return String the identifier which tells the I_EntryFactory how to
40        *         deserialize this entry.<br />
41        *         ServerEntryFactory.ENTRY_TYPE_MSG_XML or ServerEntryFactory.ENTRY_TYPE_MSG_SERIAL or ClientEntryFactory.ENTRY_TYPE_MSG_XML
42        */
43       string getEmbeddedType();
44 
45       /**
46        * Return a human readable identifier for logging output.
47        * <p>
48        * See the derived class for a syntax description.
49        * </p>
50        */
51       string getLogId();
52 
53       /**
54        * returns the size in bytes of this entry.
55        */
56       long GetSizeInBytes();
57 
58       /**
59        * Notification if this entry is added to storage. 
60        * <p>
61        * NOTE: This event is NOT triggered on startup if entries come from harddisk
62        * from the last run. It is NOT triggered during swapping.
63        *</p>
64        * <p>This callback may or may not be called from within the queue specific synchronized block</p>
65        * <p>NOTE: This callback is currently only implemented for I_Queue, but not for I_Map!</p>
66        */
67       //void added(StorageId storageId);

68 
69       /**
70        * Notification if this entry is removed from storage
71        * <p>
72        * NOTE: This event is NOT triggered during swapping.
73        *</p>
74        * <p>
75        * The callback is guaranteed to be NEVER called from inside a queue specific synchronized block.
76        * </p>
77        * <p>NOTE: This callback is currently only implemented for I_Queue, but not for I_Map!</p>
78        * @param storageId The storage id
79        */
80       //void removed(StorageId storageId);

81 
82       /**
83        * Dump content to xml representation
84        * @param out The stream to dump to
85        * @param props Control porperties
86        */
87       //void embeddedObjectToXml(java.io.OutputStream out, java.util.Properties props) throws java.io.IOException;

88 
89       /**
90        * Needed for sorting in queue
91        */
92       int compare(I_QueueEntry m2);
93 
94       /**
95        * Needed for sorting in queue
96        */
97       bool equals(I_QueueEntry m2);
98    }
99 } // namespace


syntax highlighted by Code2HTML, v. 0.9.1