use of j.util.ConcurrentList in project JFramework by gugumall.
the class Online method removeMessageOutFirst.
public void removeMessageOutFirst(String sellerId) {
ConcurrentList temp = (ConcurrentList) messagesWithSellerOut.get(sellerId);
if (temp == null)
temp = new ConcurrentList();
if (!temp.isEmpty()) {
temp.remove(0);
}
messagesWithSellerOut.put(sellerId, temp);
}
use of j.util.ConcurrentList in project JFramework by gugumall.
the class Online method addMessageOut.
public void addMessageOut(Serializable msg, String sellerId) {
ConcurrentList temp = (ConcurrentList) messagesWithSellerOut.get(sellerId);
if (temp == null)
temp = new ConcurrentList();
temp.add(msg);
messagesWithSellerOut.put(sellerId, temp);
}
use of j.util.ConcurrentList in project JFramework by gugumall.
the class OnlinesCluster method getActiveUsers.
/**
* @param rpp
* @param pn
* @return
*/
public static List getActiveUsers(int rpp, int pn) {
JCacheParams params = new JCacheParams();
params.recordsPerPage = rpp;
params.pageNum = pn;
try {
return onlines.values(params);
} catch (Exception e) {
log.log(e, Logger.LEVEL_ERROR);
return new ConcurrentList();
}
}
use of j.util.ConcurrentList in project JFramework by gugumall.
the class SSOServer method login.
/**
* @param client
* @param loginStatus
* @param notifyAll
*/
private static void login(Client client, LoginStatus loginStatus) {
// 当前操作的SSO Client直接发送登录信息
SSONotifier.getNotifier(client).login(client, loginStatus.getGlobalSessionId(), loginStatus.getUserId(), loginStatus.getUserIp());
// 其它SSO Client通过通知线程发送登录信息
ConcurrentList ssoClients = SSOConfig.getSsoClients();
for (int i = 0; i < ssoClients.size(); i++) {
Client c = (Client) ssoClients.get(i);
// 当前操作的SSO Client直接发送登录信息
if (c.getId().equals(client.getId()))
continue;
SSONotifier.addTask(c, loginStatus.getGlobalSessionId(), loginStatus.getUserId(), loginStatus.getUserIp(), SSONotifier.type_login);
}
}
use of j.util.ConcurrentList in project JFramework by gugumall.
the class SSOServer method logout.
/**
* 注销sso server端信息并通知sso client端注销
* @param client
* @param loginStatus
* @throws Exception
*/
private static void logout(Client client, LoginStatus loginStatus) throws Exception {
HttpSession session = SSOContext.getSession(loginStatus.getSessionId());
if (session != null) {
// 移除session中保存的全局会话ID
try {
session.removeAttribute(Constants.SSO_GLOBAL_SESSION_ID);
} catch (Exception e) {
log.log(e.getMessage(), Logger.LEVEL_INFO);
}
}
// 从缓存中清除
users.remove(new JCacheParams(loginStatus.getUserId()));
users.remove(new JCacheParams(loginStatus.getGlobalSessionId()));
// 当前操作的SSO Client直接发送注销命令
// SSONotifier.getNotifier(client).logout(client,
// loginStatus.getGlobalSessionId(),
// loginStatus.getUserId(),
// loginStatus.getUserIp());
// 其它SSO Client通过通知线程发送注销命令
ConcurrentList ssoClients = SSOConfig.getSsoClients();
for (int i = 0; i < ssoClients.size(); i++) {
Client c = (Client) ssoClients.get(i);
// if(c.getId().equals(client.getId())) continue;//当前操作的SSO Client直接发送注销命令
SSONotifier.addTask(c, loginStatus.getGlobalSessionId(), loginStatus.getUserId(), loginStatus.getUserIp(), SSONotifier.type_logout);
}
// set to null
loginStatus = null;
}
Aggregations