|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An interface for managing a "SNAC queue," which controls when individual
SNAC commands are sent on a ClientSnacProcessor
. Such a system
is useful for, for example, implementing an automatic rate limiting
mechanism.
Method Summary | |
void |
attached(ClientSnacProcessor processor)
Called when this SNAC queue manager has been set as the SNAC queue manager for the given processor. |
void |
clearQueue(ClientSnacProcessor processor)
Clears all pending (queued) SNAC commands in this SNAC manager for the given SNAC processor. |
void |
detached(ClientSnacProcessor processor)
Called when this SNAC queue manager has been removed from being the SNAC queue manager for the given processor. |
void |
pause(ClientSnacProcessor processor)
A method called to indicate that the queue should be paused until a call to unpause(net.kano.joscar.snac.ClientSnacProcessor) . |
void |
queueSnac(ClientSnacProcessor processor,
SnacRequest request)
Enqueues the given SNAC request for the given SNAC processor. |
void |
unpause(ClientSnacProcessor processor)
A method called to indicate that the queue for the given SNAC processor can once again send SNACs. |
Method Detail |
public void attached(ClientSnacProcessor processor)
processor
- the SNAC processor for which this manager has been setpublic void detached(ClientSnacProcessor processor)
attached
.
processor
- the SNAC processor for which this manager has been setpublic void pause(ClientSnacProcessor processor)
unpause(net.kano.joscar.snac.ClientSnacProcessor)
. This method will never be called for a given
ClientSnacProcessor
twice without a call to
unpause
in between; that is, it will never be called twice
in a row. Note that calls to queueSnac(net.kano.joscar.snac.ClientSnacProcessor, net.kano.joscar.snac.SnacRequest)
can and probably will be
made before a call to unpause(net.kano.joscar.snac.ClientSnacProcessor)
; that is, the queue must still
accept the queueing of SNAC commands while it is paused.
processor
- the SNAC processor on which to pausepublic void unpause(ClientSnacProcessor processor)
pause(net.kano.joscar.snac.ClientSnacProcessor)
, and will never be called twice for a SNAC processor
without a call to pause(net.kano.joscar.snac.ClientSnacProcessor)
in between; that is, essentially, it
will never be called twice in a row for a given SNAC processor.
processor
- the SNAC processor on which to pausepublic void queueSnac(ClientSnacProcessor processor, SnacRequest request)
sendSnac
) as it can enqueue it to be sent later. Note that
the given request will not be sent at all until it is sent from
this SNAC queue manager using sendSnac
. It is not
recommended that a request be modified before it is sent.
processor
- the SNAC processor on which the given request was
created and on which it is to be sentrequest
- the request being enqueuedpublic void clearQueue(ClientSnacProcessor processor)
unpause(net.kano.joscar.snac.ClientSnacProcessor)
for the given SNAC processor as well,
although no queued SNACs should be sent (as they might be with an actual
call to unpause
}.
processor
- the SNAC processor for which pending SNACs should be
erased
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |