|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--prometheus.PrometheusCallback
Prometheus token callback.
Changes:alexis.grandemange@pagebox.net
Copyright (c) 2003-2004 Alexis Grandemange
This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; version 2.1 of the License. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. A copy of the GNU Lesser General Public License lesser.txt should be included in the distribution.
| Field Summary | |
(package private) ServletContext |
ctx
Servlet context unique in the Web application |
java.util.HashMap |
foreignUsers
User map. Key: instance URL Value: HashMap whose key is a user name and value a UserInfo object |
(package private) PageBoxAPI |
inst
PageBox API instance |
(package private) boolean |
isRegistered
True when inserted on the ring |
(package private) PageBoxLib.LogIF |
log
Logging object |
java.util.HashMap |
messages
Map of messages sent outside. Key: destination or all when all destinations Value: Message object |
(package private) java.util.HashMap |
received
Map of received messages. Key: user name Value: TreeMap whose key is the origin PageBox and value is a TreeMap whose key is a timestamp and value is a message string |
private java.text.SimpleDateFormat |
sdf
SimpleDateFormat used to build log entries |
(package private) TokenSendIF |
sender
Token sender |
(package private) java.lang.String |
subUrl
URL of the DeployIF web service of the controlling PageBox |
java.util.HashMap |
users
User map. Key: user name Value: UserInfo object |
(package private) java.lang.String |
workDir
Prometheus directory |
| Constructor Summary | |
(package private) |
PrometheusCallback(ServletContext ctx,
java.lang.String workDir)
Constructor. |
| Method Summary | |
private void |
addLocalMessage(java.lang.String u,
java.lang.String date,
java.lang.String from,
java.lang.String message)
Add a message to a local user. |
(package private) boolean |
addUser(LoginBean lb)
Add a user to the user map. |
java.io.Serializable |
call(java.lang.String from,
java.lang.String type,
int corrid,
java.io.Serializable data)
Method called when a message that targets this (target instance, archive) is received. |
(package private) void |
end()
Remove the application from the ring. |
(package private) java.util.TreeMap |
getUserMessages(java.lang.String user)
Get messages for the specified user. |
private boolean |
matchingFilter(java.lang.String filter,
java.lang.String user)
Parses the filter string and compare to the user definition. |
void |
poll()
Method called when a frame is received by the PageBox. |
(package private) void |
removeUser(java.lang.String user)
Remove a user from the user map. |
void |
response(java.lang.String type,
int corrid,
java.util.Map codes)
Method called when a message comes back to its sender. |
(package private) void |
send(java.lang.String from,
java.lang.String message)
Send a message to all users. |
(package private) void |
send(java.lang.String user,
java.lang.String from,
java.lang.String message)
Send a message to the specified user. |
(package private) void |
send(java.lang.String pagebox,
java.lang.String filter,
java.lang.String from,
java.lang.String message)
Send a message to users matching pagebox URL and filter. |
(package private) void |
sendFiltered(java.lang.String filter,
java.lang.String from,
java.lang.String message)
Send a message to all users matching the filter. |
(package private) void |
sendTo(java.lang.String pagebox,
java.lang.String from,
java.lang.String message)
Send a message to all users on the specified PageBox. |
void |
setSender(TokenSendIF tsi)
Method called when a callback is registered |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
java.lang.String workDir
ServletContext ctx
PageBoxAPI inst
PageBoxLib.LogIF log
TokenSendIF sender
public java.util.HashMap users
public java.util.HashMap foreignUsers
public java.util.HashMap messages
java.util.HashMap received
private final java.text.SimpleDateFormat sdf
java.lang.String subUrl
boolean isRegistered
| Constructor Detail |
PrometheusCallback(ServletContext ctx,
java.lang.String workDir)
ctx - servlet context unique in the Web applicationworkDir - Prometheus directory| Method Detail |
final boolean addUser(LoginBean lb)
lb - user infofinal void removeUser(java.lang.String user)
user - user namefinal void end()
java.util.TreeMap getUserMessages(java.lang.String user)
user - user name
private boolean matchingFilter(java.lang.String filter,
java.lang.String user)
filter - filter stringuser - name
void send(java.lang.String from,
java.lang.String message)
message - message to sendfrom - user who issued the message
private void addLocalMessage(java.lang.String u,
java.lang.String date,
java.lang.String from,
java.lang.String message)
u - userdate - time when the message was issuedfrom - user who issued the messagemessage - message to send
void send(java.lang.String user,
java.lang.String from,
java.lang.String message)
user - qualified user namefrom - user who issued the messagemessage - message to send
void send(java.lang.String pagebox,
java.lang.String filter,
java.lang.String from,
java.lang.String message)
pagebox - PageBox URLfilter - filter to applyfrom - user who issued the messagemessage - message to send
void sendTo(java.lang.String pagebox,
java.lang.String from,
java.lang.String message)
pagebox - PageBox URLfrom - user who issued the messagemessage - message to send
void sendFiltered(java.lang.String filter,
java.lang.String from,
java.lang.String message)
filter - filter to applyfrom - user who issued the messagemessage - message to sendpublic void setSender(TokenSendIF tsi)
tsi - object to use to send messagesPageBoxLib.TokenCallbackIF#setSender(TokenSendIF)
public java.io.Serializable call(java.lang.String from,
java.lang.String type,
int corrid,
java.io.Serializable data)
from - issuer URLtype - request typecorrid - correlation IDdata - TokenMsg data
PageBoxLib.TokenCallbackIF#call(String, int, Serializable)public void poll()
public void response(java.lang.String type,
int corrid,
java.util.Map codes)
type - request typecorrid - correlation IDcodes - map whose key is the issuer URL and value is a Serializable object
(response returned by the call method of the issuer TokenCallbackIF)PageBoxLib.TokenCallbackIF#response(String, int, Map)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||