use of com.iplanet.dpro.session.share.SessionResponse in project OpenAM by OpenRock.
the class SessionCount method getSessionsFromPeerServers.
/*
* Get user sessions from session repository
*/
private static Map getSessionsFromPeerServers(String uuid) {
Map sessions = getSessionsFromLocalServer(uuid);
String localServerID = serverConfig.getLocalServerID();
Set serverIDs = null;
try {
serverIDs = WebtopNaming.getSiteNodes(localServerID);
} catch (Exception e) {
debug.error("Failed to get the serverIDs from " + "WebtopNaming.", e);
return sessions;
}
for (Iterator m = serverIDs.iterator(); m.hasNext(); ) {
String serverID = (String) m.next();
if (serverID.equals(localServerID)) {
continue;
}
try {
URL svcurl = SESSION_SERVICE_URL_SERVICE.getSessionServiceURL(serverID);
SessionRequest sreq = new SessionRequest(SessionRequest.GetSessionCount, getAdminToken().getTokenID().toString(), false);
sreq.setUUID(uuid);
SessionResponse sres = getSessionResponse(svcurl, sreq);
sessions.putAll(sres.getSessionsForGivenUUID());
} catch (SessionException se) {
if (debug.messageEnabled()) {
debug.message("SessionConstraint: " + "peer AM server is down...");
}
}
}
return sessions;
}
use of com.iplanet.dpro.session.share.SessionResponse in project OpenAM by OpenRock.
the class SessionRequestHandler method forward.
private SessionResponse forward(URL svcurl, SessionRequest sreq) throws SessionException {
try {
Object context = RestrictedTokenContext.getCurrent();
if (context != null) {
sreq.setRequester(RestrictedTokenContext.marshal(context));
}
SessionResponse sres = sessionPLLSender.sendPLLRequest(svcurl, sreq);
if (sres.getException() != null) {
throw new SessionException(sres.getException());
}
return sres;
} catch (SessionException se) {
throw se;
} catch (Exception ex) {
throw new SessionException(ex);
}
}
Aggregations