/**
* 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: FSDiscoveryBootStrap.java,v 1.4 2008/12/05 00:18:00 exu Exp $
*
*/
/**
* The class <code>FSDiscoBootStrap</code> helps in generating the discovery
* boot strap statement i.e. Discovery Resource Offering as part of the SAML
* assertion that is generated during the Single Sign-On. This class checks
* if there are any credentials that need to be generated for accesing
* discovery service and do the needful.
*/
public class FSDiscoveryBootStrap {
private boolean _hasCredentials = false;
/**
* Constructor.
* @param ssoToken session of the user.
* TODO: Currently we use the session of the user, but ideally this
* be of the WSC that require credentials.
* @param authnContext Authentication context that the user is signed-on.
* @param sub Federated Subject.
* @param userID User's ID for which the discovery resource offering is
* being obtained.
* @param wscID the wsc's entity ID
* @param realm the realm in which the provider resides
* @exception FSException if there is any failure.
*/
public FSDiscoveryBootStrap(
throws FSException
{
}
try {
"while creating discovery bootstrap statement", ex);
throw new FSException(ex);
}
}
/**
* Gets the discovery bootstrap resource offering for the user.
* @return Document Discovery Resource Offering in an attribute statement
* @exception FSException if there's any failure.
*/
throws FSException
{
if (discoEntry == null) {
}
try {
if (!DiscoServiceManager.useImpliedResource()) {
}
providerID, userID);
"Offering: ResourceID Value:" + resourceIDValue);
}
} else {
}
sessionSubject = new SessionSubject(
} else {
sessionSubject = new SessionSubject(
}
"FSDiscoBootStrap.getResourceOffering:no ResourceOffering");
}
_hasCredentials = true;
}
.append("AttributeValue>");
"FSDiscoveryBootStap.getResourceOffering:Resource Offering:"
}
"Exception while creating resource offering.", ex);
throw new FSException(ex);
}
}
/**
* Checks if the credentials are generated.
* @return <code>true</code> if the credentials are generated;
* <code>false</code> otherwise.
*/
public boolean hasCredentials() {
return _hasCredentials;
}
/**
* Returns the credentials for discovery boot strap resource offering.
* @return <code>Advice</code> object that contains credentials
*/
}
return null;
}
/**
* Returns the bootstrap attribute statement.
* @return AttributeStatement ResourceOffering AttributeStatement.
*/
return _bootStrapStatement;
}
}