|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectesmska.data.Queue
public class Queue
Class representing queue of SMS
Nested Class Summary | |
---|---|
static class |
Queue.Events
|
Field Summary | |
---|---|
static int |
TIMER_TICK
Internal tick interval of the queue in milliseconds. |
Method Summary | |
---|---|
boolean |
add(SMS sms)
Add new SMS to the queue. |
boolean |
addAll(java.util.Collection<SMS> collection)
Add collection of new SMS to the queue. |
void |
addValuedListener(ValuedListener<Queue.Events,SMS> valuedListener)
|
void |
clear()
Remove all SMS from the queue. |
boolean |
contains(SMS sms)
Checks whether the SMS is in the queue. |
java.util.List<SMS> |
getAll()
Get all SMS in the queue. |
java.util.List<SMS> |
getAll(java.lang.String gatewayName)
Get all SMS in the queue for specified gateway. |
java.util.List<SMS> |
getAllWithStatus(SMS.Status status)
Get a collection of SMS with particular status. |
java.util.List<SMS> |
getAllWithStatus(SMS.Status status,
java.lang.String gatewayName)
Get a collection of SMS with particular status and gateway. |
long |
getGatewayDelay(java.lang.String gatewayName)
Return current delay for specified gateway. |
static Queue |
getInstance()
Get shared instance |
long |
getSMSDelay(SMS sms)
Return current delay for specified sms. |
boolean |
isEmpty()
Check if the queue is empty |
boolean |
isPaused()
Whether queue is currently paused |
void |
movePosition(SMS sms,
int positionDelta)
Move SMS in the queue to another position. |
boolean |
remove(SMS sms)
Remove SMS from the queue. |
void |
removeValuedListener(ValuedListener<Queue.Events,SMS> valuedListener)
|
void |
setPaused(boolean paused)
Sets whether queue is currently paused |
void |
setSMSFailed(SMS sms)
Mark SMS as failed during sending. |
void |
setSMSSending(SMS sms)
Mark SMS as currently being sent. |
void |
setSMSSent(SMS sms)
Mark the SMS as successfully sent. |
int |
size()
Get the number of SMS in the queue |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int TIMER_TICK
Method Detail |
---|
public void addValuedListener(ValuedListener<Queue.Events,SMS> valuedListener)
public void removeValuedListener(ValuedListener<Queue.Events,SMS> valuedListener)
public static Queue getInstance()
public java.util.List<SMS> getAll()
public java.util.List<SMS> getAll(java.lang.String gatewayName)
gatewayName
- name of the gateway. May be null for any gateway.
public java.util.List<SMS> getAllWithStatus(SMS.Status status)
public java.util.List<SMS> getAllWithStatus(SMS.Status status, java.lang.String gatewayName)
status
- SMS status, not nullgatewayName
- name of the gateway of the SMS, may be null for any gateway
public boolean add(SMS sms)
Collection.add(E)
.public boolean addAll(java.util.Collection<SMS> collection)
collection
- Collection of SMS. May not be null, may not contain null element.
Collection.addAll(java.util.Collection)
public boolean remove(SMS sms)
sms
- SMS to be removed. Not null.
Collection.remove(java.lang.Object)
public void clear()
public boolean contains(SMS sms)
sms
- SMS, not null
Collection.contains(java.lang.Object)
public int size()
public boolean isEmpty()
public boolean isPaused()
public void setPaused(boolean paused)
public void movePosition(SMS sms, int positionDelta)
sms
- sms to be moved, not nullpositionDelta
- direction and amount of movement. Positive number moves
to the back of the queue, negative number moves to the front of the queue.
The number corresponds to the number of positions to change. If the number
is larger than current queue dimensions, the element will simply stop as the
first or as the last element.public long getGatewayDelay(java.lang.String gatewayName)
gatewayName
- name of the gateway. May be null.
public long getSMSDelay(SMS sms)
sms
- sms, not null
public void setSMSSent(SMS sms)
sms
- sent SMS, not nullpublic void setSMSSending(SMS sms)
sms
- SMS that is currently being sent, not nullpublic void setSMSFailed(SMS sms)
sms
- SMS that has failed, not null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |