use of com.iplanet.dpro.session.SessionException in project OpenAM by OpenRock.
the class SSOProviderImpl method logout.
@Override
public void logout(final SSOToken token) throws SSOException {
try {
Session session = sessionCache.getSession(new SessionID(token.getTokenID().toString()));
session.logout();
} catch (SessionException e) {
if (debug.messageEnabled()) {
debug.message("Logout: ", e);
}
throw new SSOException(e);
}
}
use of com.iplanet.dpro.session.SessionException in project OpenAM by OpenRock.
the class AuthD method initAuthSession.
private Session initAuthSession() throws SSOException, SessionException {
final Session authSession = getSessionService().getAuthenticationSession(defaultOrg, null);
if (authSession == null) {
debug.error("AuthD failed to get auth session");
throw new SessionException(BUNDLE_NAME, "gettingSessionFailed", null);
}
String clientID = authSession.getClientID();
authSession.setProperty("Principal", clientID);
authSession.setProperty("Organization", defaultOrg);
authSession.setProperty("Host", authSession.getID().getSessionServer());
if (LDAPUtils.isDN(clientID)) {
String id = "id=" + rdnValueFromDn(clientID) + ",ou=user," + ServiceManager.getBaseDN();
authSession.setProperty(Constants.UNIVERSAL_IDENTIFIER, id);
}
return authSession;
}
use of com.iplanet.dpro.session.SessionException 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.SessionException 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);
}
}
use of com.iplanet.dpro.session.SessionException in project OpenAM by OpenRock.
the class CTSOperations method destroy.
/**
* Perform a remote destroy operation on the SessionID, because we know this is a remote session.
*
* @param requester {@inheritDoc}
* @param session {@inheritDoc}
* @throws SessionException if we somehow passed a local session into this function
*/
@Override
public void destroy(Session requester, Session session) throws SessionException {
// Comments as for logout. The check for a local session should be removed if it proves to be a performance
// bottleneck.
//
SessionID sessionID = session.getID();
if (sessionService.checkSessionLocal(sessionID)) {
throw new SessionException("CTSOperations received a local session (only remote sessions expected)");
}
remote.destroy(requester, session);
}
Aggregations