|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--PaP.SubscribeRequestServer
Server for individual subscription requests from clients. The server receives event registrations, checks whether or not they shall be reported, and keep registrations to be reported until the report is sent. Reports are sent only when registrations exists, but it is the clien that specifies when or how often the reports shall be sent.
Field Summary | |
private BaseFrame |
bf
Debug trace window (only temporarly) |
private ActorContext |
context
The context that defines who shall be the sender of the reports |
private int |
next
The number of registrations in the store |
private SubscribeRequest |
req
The received subscribe request specification to be handled by this server |
private java.lang.String[] |
store
The store to keep registrations until they are reported |
private javax.swing.Timer |
timer
Timer used to measure time until next report |
Constructor Summary | |
SubscribeRequestServer(SubscribeRequest sr,
ActorContext ctx,
BaseFrame frame)
Initiate the subscribe server instance. |
Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent e)
Reported timeout from the initiated timer |
private void |
addEvent(int et,
GAI sc,
java.lang.String at)
Store an event evaluated to be stored. |
boolean |
cancelSubscribe()
Cancel this subscription. |
private void |
initiateTimer()
Check if timer needs to be initiated and eventually initiate it |
private boolean |
inSetGAI(GAI[] set,
GAI value)
Check if specified value satisfies requirement to be stored. |
private boolean |
inSetInt(int[] set,
int value)
Check if specified value satisfies requirement to be stored. |
private boolean |
inSetString(java.lang.String[] set,
java.lang.String value)
Check if specified value satisfies requirement to be stored. |
void |
registerEvent(int et,
GAI sc,
java.lang.String at)
Report of an event. |
private void |
reportEvents()
Report to subscription client registered event |
private void |
terminateTimer()
Terminate and discard eventually initiated timer |
Methods inherited from class java.lang.Object |
|
Field Detail |
private SubscribeRequest req
private java.lang.String[] store
private int next
private javax.swing.Timer timer
private ActorContext context
private BaseFrame bf
Constructor Detail |
public SubscribeRequestServer(SubscribeRequest sr, ActorContext ctx, BaseFrame frame)
sr
- The specification of the subscribe request.ctx
- The context to be used to specify the sender of the subscribe reports.frame
- Debugging trace window (temporarly)Method Detail |
public boolean cancelSubscribe()
public void registerEvent(int et, GAI sc, java.lang.String at)
et
- Event typesc
- Address of the entity the event concernsat
- Application specific informationprivate void addEvent(int et, GAI sc, java.lang.String at)
et
- Event typesc
- Address of the entity the event concernsat
- Application specific informationpublic void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
private void initiateTimer()
private void terminateTimer()
private void reportEvents()
private boolean inSetInt(int[] set, int value)
set
- The set of values to search in, null means anyvalue
- The value to search in 'set'.private boolean inSetGAI(GAI[] set, GAI value)
set
- The set of values to search in, null means anyvalue
- The value to search in 'set'.private boolean inSetString(java.lang.String[] set, java.lang.String value)
set
- The set of values to search in, null means anyvalue
- The value to search in 'set'.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |