/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2006 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: FSSession.java,v 1.3 2008/06/25 05:46:56 qcheng Exp $
*
*/
/**
* Class that encasulates federation session.
*/
public class FSSession{
private boolean oneTimeFederation = false;
/**
* Constructs a new <code>FSSession</code>.
* @param sessionID authentication session ID
* @param sessionPartners list of session partners
*/
public FSSession(
)
{
this.extraSessionAttributes = new HashMap();
if (sessionPartners != null){
this.sessionPartners = sessionPartners;
} else {
this.sessionPartners = new ArrayList();
}
}
/**
* Constructs a new <code>FSSession</code> object.
* @param sessionID authentication session ID
*/
}
/**
* Returns authentication context.
* @return authentication context
* @see #setAuthnContext(String)
*/
return authnContext;
}
/**
* Sets authentication context.
* @param authnContext authentication context to be set
* @see #getAuthnContext()
*/
this.authnContext = authnContext;
}
/**
* Returns session index.
* @return session index.
* @see #setSessionIndex(String)
*/
return sessionIndex;
}
/**
* Sets session index.
* @param sessionIndex session index to be set
* @see #getSessionIndex()
*/
this.sessionIndex = sessionIndex;
}
/**
* Returns list of session partners.
* @return list of session partners
*/
return sessionPartners;
}
/**
* Adds a session partner.
* @param sessionPartner session partner to be added
*/
while (i.hasNext()) {
return;
}
}
}
/**
* Returns the first session partner of the list of session partners.
* @return the first session partner of the list
*/
if (i.hasNext()) {
return (FSSessionPartner)i.next();
}
return null;
}
/**
* Removes a session partner.
* @param sessionPartner session partner to be removed
*/
while (i.hasNext()) {
"FSSession.removeSessionPartner : Removing "
+ sessionPartner);
}
i.remove();
}
}
}
/**
* Returns session ID.
* @return authentication session ID
*/
return sessionID;
}
/**
* Adds attribute to the session.
* @param key name of the attribute
* @param value value of the attribute
*/
}
/**
* Returns value of an attribute from the session.
* @param key name of the attribute
* @return value of the attribute
*/
}
}
}
/**
* Returns a hash code for this session. The value is the hash code of
* the session ID.
* @return a hash code value for this object
*/
public int hashCode() {
}
/**
* Sets the boot strap attribute statement.
* @param statement Boot strap attribute statement
* @see #getBootStrapAttributeStatement()
*/
try {
"Can not parse the attribute statement:" , ex);
}
}
/**
* Gets the boot strap attribute statement.
* @return Boot strap attribute statement
* @see #setBootStrapAttributeStatement(AttributeStatement)
*/
return statement;
}
/**
* Gets Discovery Service Boot strap resource offerings.
* @return Bootstrap resoource offerings
*/
return resourceOfferings;
}
/**
* Sets the bootstrap security credential assertion.
* @param assertions List of bootstrap security assertions.
* @see #getBootStrapCredential()
*/
}
/**
* Gets the boot strap security credential assertion.
* @return List of Boot strap security assertion
* @see #setBootStrapCredential(List)
*/
return securityAssertions;
}
/**
* Sets AutoFederate Statement.
* @param autoFedStmt Auto Federate Statement.
* @see #getAutoFedStatement()
*/
}
/**
* Gets Auto Federate Statement.
* @return Auto Federate Statement.
* @see #setAutoFedStatement(AttributeStatement)
*/
return _autoFedStatement;
}
/**
* Sets Attribute Statements.
* @param attrStatements List of Attribute Statements.
* @see #getAttributeStatements()
*/
this.attrStatements = attrStatements;
}
/**
* Gets Attribute Statements.
* @return List of Attribute Statements.
* @see #setAttributeStatements(List)
*/
return attrStatements;
}
/**
* Sets the flag for one time federation.
* @param oneTimeFlag flag for one time federation
* @see #getOneTime()
*/
}
/**
* Returns the flag for one time federation.
* @return <code>true</code> if the session is for one time federation;
* <code>false</code> otherwise.
*/
public boolean getOneTime() {
return oneTimeFederation;
}
/**
* Sets account federation info.
* @param fedInfo account federation info to be set
* @see #getAccountFedInfo()
*/
}
/**
* Returns account federation info.
* @return <code>FSAccountFedInfo</code> object
* @see #setAccountFedInfo(FSAccountFedInfo)
*/
return fedInfo;
}
/**
* Sets user ID.
* @param userID user ID to be set
* @see #getUserID()
*/
}
}
/**
* Returns user ID.
* @return user ID
* @see #setUserID(String)
*/
return userID;
}
}