SMProfileModelImpl.java revision 26304a2a091af368cfc16c977bcce6d17195360a
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2007 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: SMProfileModelImpl.java,v 1.5 2008/06/25 05:43:21 qcheng Exp $
*
* Portions Copyrighted 2011-2016 ForgeRock AS.
*/
/* - LOG COMPLETE - */
/**
* Class that provides methods to manage Session Management.
*/
public class SMProfileModelImpl extends AMModelBase
implements SMProfileModel
{
private SMSessionCache smSessionCache;
private SessionCache sessionCache;
private boolean validSession = true;
/**
* Constructs a session management profile model implementation object.
*
* @param request HTTP Servlet request.
* @param map of user information.
*/
}
/**
* Sets server name.
*
* @param value sever name.
*/
serverName = value;
}
/**
* Initializes sessions list.
*
* @param pattern user id pattern to search for.
* @throws AMConsoleException if unable to initialized the session list.
*/
throws AMConsoleException
{
try {
} catch (SessionException se) {
throw new AMConsoleException(strError);
}
}
private Session getCurrentSession()
throws AMConsoleException
{
try {
} catch (SessionException se) {
}
return session;
}
private Map<String, Session> getValidSessions(Session session, String pattern) throws AMConsoleException {
try {
for (Session s : validSessions) {
if (s != null) {
}
}
}
} catch (SessionException se) {
}
return sessions;
}
public List<String> invalidateSessions(List<String> list, String pattern) throws AMConsoleException {
try {
} catch (SessionException se) {
}
boolean isCurrentSession = false;
try {
} catch (SessionException se) {
logEvent("SESSION_EXCEPTION_INVALIDATE_SESSIONS",
params);
}
if (isCurrentSession) {
validSession = false;
} else {
try {
} catch (SessionException se) {
try {
} catch (SessionException e) {
}
}
}
}
if (!validSession) {
try {
} catch (SessionException se) {
getErrorString(se)};
logEvent("SESSION_EXCEPTION_INVALIDATE_SESSIONS",
paramsEx);
}
}
}
}
return failList;
}
/**
* Returns true if current user session state is valid.
*
* @return true is the session is valid.
*/
public boolean isSessionValid() {
return validSession;
}
/**
* Returns session cache.
*
* @param pattern Pattern for search.
* @return session cache.
* @throws AMConsoleException if unable to get the session cache.
*/
throws AMConsoleException
{
if (smSessionCache == null) {
}
return smSessionCache;
}
/**
* Sets session cache.
*
* @param cache Session cache.
*/
}
/**
* Returns set of server names.
*
* @return set of server names.
*/
public Map getServerNames() {
try {
getUserSSOToken());
} catch (SSOException e) {
} catch (SMSException e) {
}
}
return serverNamesMap;
}
if (index != -1) {
} else {
if (debug.warningEnabled()) {
"This server entry is not proper, ignoring:"
+ serverEntry);
}
}
}
return serverList;
}
/**
* Returns the map of server names(host:port) and url.
*
* @param set names of server instance.
* returns the map of server names(host:port) and url.
*/
try {
if (port == -1) {
} else {
}
} catch (MalformedURLException e) {
}
}
}
return map;
}
}