public class MessageQueue
extends java.util.TimerTask
Constructor and Description |
---|
MessageQueue(Connection connection,
int timeout) |
Modifier and Type | Method and Description |
---|---|
int |
add(IpmiCommandCoder request)
Adds request to the queue and generates the tag.
|
boolean |
containsId(int sequenceNumber)
Checks if queue contains message with the given sequence number.
|
IpmiCommandCoder |
getMessageFromQueue(int tag)
Returns message with the given sequence number from the queue or null if
no message with the given tag is currently in the queue.
|
int |
getMessageIndexFromQueue(int tag)
Returns index of the message with the given sequence number from the
queue or -1 if no message with the given tag is currently in the queue.
|
int |
getMessageRetries(int tag)
Deprecated.
|
int |
getMessageSequenceNumber(int tag)
Returns the ID of the
QueueElement in the queue with the given
tag. |
int |
getSequenceNumber()
Returns valid session sequence number that cannot be used as a tag though
|
int |
getTimeout() |
void |
remove(int tag)
Removes message with the given tag from the queue.
|
void |
removeAt(int index)
Removes message from queue at given index.
|
void |
run()
TimerTask runner - periodically checks queue for timed out
messages. |
void |
setTimeout(int timeout) |
void |
tearDown()
Stops the MessageQueue
|
public MessageQueue(Connection connection, int timeout) throws java.io.FileNotFoundException, java.io.IOException
java.io.FileNotFoundException
java.io.IOException
public int getTimeout()
public void setTimeout(int timeout)
public void tearDown()
public int add(IpmiCommandCoder request)
public void remove(int tag)
public void removeAt(int index)
index
- public boolean containsId(int sequenceNumber)
public int getSequenceNumber()
public IpmiCommandCoder getMessageFromQueue(int tag)
public int getMessageIndexFromQueue(int tag)
@Deprecated public int getMessageRetries(int tag)
public int getMessageSequenceNumber(int tag)
QueueElement
in the queue with the given
tag.tag
- Tag of the message to findpublic void run()
TimerTask
runner - periodically checks queue for timed out
messages.run
in interface java.lang.Runnable
run
in class java.util.TimerTask