com.localmatters.collector.queue.consumer
Interface ConsumerService

All Known Subinterfaces:
ConsumerLocal, ConsumerRemote
All Known Implementing Classes:
ConsumerBean

public interface ConsumerService

The collector consumer service interface.

Author:
Daniel Cavalcanti

Method Summary
 java.lang.String retrieve()
          Retrieves a message from the queue.
 java.lang.String retrieveImmediate()
          Retrieves a message from the queue.
 java.lang.String retrieveTimed(long timeout)
          Retrieves a message from the queue.
 

Method Detail

retrieve

java.lang.String retrieve()
                          throws CollectorQueueException
Retrieves a message from the queue. If there are no messages in the queue, blocks until a message becomes available.

Returns:
The message.
Throws:
com.localmatters.collector.queue.consumer.CollectorQueueException - If there is an error in the collector queue.
CollectorQueueException

retrieveTimed

java.lang.String retrieveTimed(long timeout)
                               throws CollectorQueueException
Retrieves a message from the queue. If there are no messages in the queue, blocks until a message becomes available, or the timeout expires.

Parameters:
timeout - The message timeout period in milliseconds.
Returns:
The message if one was available; otherwise, null.
Throws:
com.localmatters.collector.queue.consumer.CollectorQueueException - If there is an error in the collector queue.
CollectorQueueException

retrieveImmediate

java.lang.String retrieveImmediate()
                                   throws CollectorQueueException
Retrieves a message from the queue. If there are no messages in the queue, the call does not block but returns a null immediately.

Returns:
The message if one was available; otherwise, null.
Throws:
com.localmatters.collector.queue.consumer.CollectorQueueException - If there is an error in the collector queue.
CollectorQueueException