Inheritance diagram for org::xmlBlaster::util::queue::I_Queue:
Public Member Functions | ||||
virtual | ~I_Queue () | |||
virtual void | put (MsgQueueEntry &entry)=0 | |||
Puts a new entry into the queue. | ||||
virtual std::vector< EntryType > | peekWithSamePriority (long maxNumOfEntries=-1, long maxNumOfBytes=-1)=0 | |||
Returns the entries with the highest priority in the queue. | ||||
virtual long | randomRemove (std::vector< EntryType >::const_iterator &start, std::vector< EntryType >::const_iterator &end)=0 | |||
Deletes the entries specified in the std::vector in the argument list. | ||||
virtual long | getNumOfEntries ()=0 | |||
Access the current number of entries. | ||||
virtual long | getMaxNumOfEntries ()=0 | |||
Access the configured maximum number of elements for this queue. | ||||
virtual int64_t | getNumOfBytes ()=0 | |||
Returns the amount of bytes currently in the queue. | ||||
virtual int64_t | getMaxNumOfBytes ()=0 | |||
Access the configured capacity (maximum bytes) for this queue. | ||||
virtual void | clear ()=0 | |||
Clears (removes all entries) this queue
| ||||
virtual bool | empty ()=0 | |||
| ||||
virtual void | destroy ()=0 | |||
Removes all entries and cleans up the storage, for example with a database it would remove all tables and relating database files. |
Definition at line 27 of file I_Queue.h.
virtual org::xmlBlaster::util::queue::I_Queue::~I_Queue | ( | ) | [virtual] |
virtual void org::xmlBlaster::util::queue::I_Queue::put | ( | MsgQueueEntry & | entry | ) | [pure virtual] |
Puts a new entry into the queue.
The put() method takes a clone of the passed entry, you can safely destroy your passed entry after this invocation.
entry | A message which is stored in the queue |
XmlBlasterException | on problems |
Implemented in org::xmlBlaster::util::queue::CacheQueuePlugin, org::xmlBlaster::util::queue::RamQueuePlugin, and org::xmlBlaster::util::queue::SQLiteQueuePlugin.
Referenced by org::xmlBlaster::util::queue::CacheQueuePlugin::put(), org::xmlBlaster::util::dispatch::ConnectionsHandler::queuePublish(), org::xmlBlaster::util::dispatch::ConnectionsHandler::queueSubscribe(), org::xmlBlaster::test::TestQueue::testMaxNumOfBytes(), org::xmlBlaster::test::TestQueue::testMaxNumOfEntries(), org::xmlBlaster::test::TestQueue::testOrder(), org::xmlBlaster::test::TestQueue::testWithOneConnectEntry(), and org::xmlBlaster::test::TestQueue::testWithOnePublishEntry().
virtual std::vector<EntryType> org::xmlBlaster::util::queue::I_Queue::peekWithSamePriority | ( | long | maxNumOfEntries = -1 , |
|
long | maxNumOfBytes = -1 | |||
) | [pure virtual] |
Returns the entries with the highest priority in the queue.
If 'maxNumOfEntries' is positive, this is the maximum number of entries to return. If maxNumOfBytes is positive, only the entries which fit into the range specified are returned. If there are no such entries, an empty std::vector is returned.
XmlBlasterException | on problems |
Implemented in org::xmlBlaster::util::queue::CacheQueuePlugin, org::xmlBlaster::util::queue::RamQueuePlugin, and org::xmlBlaster::util::queue::SQLiteQueuePlugin.
Referenced by org::xmlBlaster::util::dispatch::ConnectionsHandler::flushQueueUnlocked(), org::xmlBlaster::util::queue::CacheQueuePlugin::peekWithSamePriority(), org::xmlBlaster::test::TestQueue::testOrder(), org::xmlBlaster::test::TestQueue::testWithOneConnectEntry(), and org::xmlBlaster::test::TestQueue::testWithOnePublishEntry().
virtual long org::xmlBlaster::util::queue::I_Queue::randomRemove | ( | std::vector< EntryType >::const_iterator & | start, | |
std::vector< EntryType >::const_iterator & | end | |||
) | [pure virtual] |
Deletes the entries specified in the std::vector in the argument list.
If this std::vector is empty or if the queue is empty, zero (0) is returned, otherwise it returns the number of entries really deleted.
start | The inclusive beginning of the messages to remove | |
end | The exclusive ending |
XmlBlasterException | on problems |
Implemented in org::xmlBlaster::util::queue::CacheQueuePlugin, org::xmlBlaster::util::queue::RamQueuePlugin, and org::xmlBlaster::util::queue::SQLiteQueuePlugin.
Referenced by org::xmlBlaster::util::dispatch::ConnectionsHandler::flushQueueUnlocked(), org::xmlBlaster::test::TestQueue::testOrder(), org::xmlBlaster::test::TestQueue::testWithOneConnectEntry(), and org::xmlBlaster::test::TestQueue::testWithOnePublishEntry().
virtual long org::xmlBlaster::util::queue::I_Queue::getNumOfEntries | ( | ) | [pure virtual] |
Access the current number of entries.
Implemented in org::xmlBlaster::util::queue::CacheQueuePlugin, org::xmlBlaster::util::queue::RamQueuePlugin, and org::xmlBlaster::util::queue::SQLiteQueuePlugin.
Referenced by HelloWorld2::execute(), org::xmlBlaster::util::dispatch::ConnectionsHandler::flushQueue(), org::xmlBlaster::util::dispatch::ConnectionsHandler::flushQueueUnlocked(), org::xmlBlaster::util::queue::CacheQueuePlugin::getNumOfEntries(), org::xmlBlaster::util::dispatch::ConnectionsHandler::getQueue(), org::xmlBlaster::util::dispatch::ConnectionsHandler::putToQueue(), HelloWorld2::reachedAlive(), HelloWorld2::reachedPolling(), org::xmlBlaster::test::TestQueue::testMaxNumOfBytes(), and org::xmlBlaster::test::TestQueue::testWithOnePublishEntry().
virtual long org::xmlBlaster::util::queue::I_Queue::getMaxNumOfEntries | ( | ) | [pure virtual] |
Access the configured maximum number of elements for this queue.
Implemented in org::xmlBlaster::util::queue::CacheQueuePlugin, org::xmlBlaster::util::queue::RamQueuePlugin, and org::xmlBlaster::util::queue::SQLiteQueuePlugin.
Referenced by org::xmlBlaster::util::queue::CacheQueuePlugin::getMaxNumOfEntries().
virtual int64_t org::xmlBlaster::util::queue::I_Queue::getNumOfBytes | ( | ) | [pure virtual] |
Returns the amount of bytes currently in the queue.
If the implementation of this interface is not able to return the correct number of entries (for example if the implementation must make a remote call to a DB which is temporarly not available) it will return -1.
Implemented in org::xmlBlaster::util::queue::CacheQueuePlugin, org::xmlBlaster::util::queue::RamQueuePlugin, and org::xmlBlaster::util::queue::SQLiteQueuePlugin.
Referenced by org::xmlBlaster::util::queue::CacheQueuePlugin::getNumOfBytes(), and org::xmlBlaster::test::TestQueue::testMaxNumOfBytes().
virtual int64_t org::xmlBlaster::util::queue::I_Queue::getMaxNumOfBytes | ( | ) | [pure virtual] |
Access the configured capacity (maximum bytes) for this queue.
Implemented in org::xmlBlaster::util::queue::CacheQueuePlugin, org::xmlBlaster::util::queue::RamQueuePlugin, and org::xmlBlaster::util::queue::SQLiteQueuePlugin.
Referenced by org::xmlBlaster::util::queue::CacheQueuePlugin::getMaxNumOfBytes(), and org::xmlBlaster::test::TestQueue::testMaxNumOfBytes().
virtual void org::xmlBlaster::util::queue::I_Queue::clear | ( | ) | [pure virtual] |
Clears (removes all entries) this queue
XmlBlasterException | on problems. |
Implemented in org::xmlBlaster::util::queue::CacheQueuePlugin, org::xmlBlaster::util::queue::RamQueuePlugin, and org::xmlBlaster::util::queue::SQLiteQueuePlugin.
Referenced by org::xmlBlaster::util::queue::CacheQueuePlugin::clear(), org::xmlBlaster::util::dispatch::ConnectionsHandler::disconnect(), HelloWorld2::reachedAlive(), and org::xmlBlaster::test::TestQueue::testMaxNumOfEntries().
virtual bool org::xmlBlaster::util::queue::I_Queue::empty | ( | ) | [pure virtual] |
XmlBlasterException | on problems |
Implemented in org::xmlBlaster::util::queue::CacheQueuePlugin, org::xmlBlaster::util::queue::RamQueuePlugin, and org::xmlBlaster::util::queue::SQLiteQueuePlugin.
Referenced by org::xmlBlaster::util::queue::CacheQueuePlugin::empty(), org::xmlBlaster::util::dispatch::ConnectionsHandler::flushQueueUnlocked(), org::xmlBlaster::test::TestQueue::testOrder(), org::xmlBlaster::test::TestQueue::testWithOneConnectEntry(), and org::xmlBlaster::test::TestQueue::testWithOnePublishEntry().
virtual void org::xmlBlaster::util::queue::I_Queue::destroy | ( | ) | [pure virtual] |
Removes all entries and cleans up the storage, for example with a database it would remove all tables and relating database files.
This is an administrative task. The class instance calling destroy()
is invalid after this call
XmlBlasterException | if failed |
Implemented in org::xmlBlaster::util::queue::CacheQueuePlugin, org::xmlBlaster::util::queue::RamQueuePlugin, and org::xmlBlaster::util::queue::SQLiteQueuePlugin.
Referenced by org::xmlBlaster::util::queue::CacheQueuePlugin::destroy(), and org::xmlBlaster::test::TestQueue::destroyQueue().