/**
* 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: IDFFCOTUtils.java,v 1.6 2009/10/28 23:58:57 exu Exp $
*
*/
/**
* This class utility methods to update circle of trust
* attribute in the service and identity provider
* configuration.
*/
public class IDFFCOTUtils {
/** Creates a new instance of IDFFCOTUtils */
}
/**
* Updates the entity config to add the circle of turst name to the
* <code>cotlist</code> attribute. The Service Provider and Identity
* Provider Configurations are updated.
*
* @param realm realm the entity resides in.
* @param cotName the circle of trust name.
* @param entityID the name of the Entity identifier.
* @throws IDFFMetaException if there is a configuration error when
* updating the configuration.
* @throws JAXBException is there is an error updating the entity
* configuration.
*/
throws IDFFMetaException , JAXBException {
// Check whether the entity id existed in the DS
if (entityDesc == null) {
}
if (entityConfig == null) {
// create entity config and add the cot attribute
// add to entityConfig
entityConfig.setHosted(false);
// Decide which role EntityDescriptorElement includes
// It could have one sp and one idp.
}
}
}
} else {
// update the sp and idp entity config
if (affiConfig != null) {
}
}
}
/**
* Removes the circle trust name passed from the <code>cotlist</code>
* list attribute in the Entity Config. The Service Provider and Identity
* Provider Entity Configuration are updated.
*
* @param realm realm the entity resides in.
* @param cotName the circle of trust name to be removed.
* @param entityID the entity identifier of the provider.
* @throws IDFFMetaException if there is an error updating the entity
* config.
* @throws JAXBException if there is an error updating the entity config.
*/
public void removeFromEntityConfig(
throws IDFFMetaException, JAXBException {
// Check whether the entity id existed in the DS
if (entityDesc == null) {
}
if (entityConfig != null) {
if (affiConfig != null) {
}
}
}
/**
* Checks if the name is contained in a list of values.
*/
return true;
}
}
return false;
}
/**
* Updates the entity config to update the values of the
* <code>cotlist</code> attribute.
*
* @param realm realm the entity resides in.
* @param configList the list containing config elements.
* @param cotName the circle of trust name.
* @param entityConfig the <code>EntityConfigElement</code> object
* @param objFactory the object factory object
* @param idffMetaMgr the <code>IDFFMetaManager</code> object.
* @throws <code>IDFFMetaException</code> if there is an error retrieving
* and updating the entityConfig.
* @throws <code>JAXBException</code> if there is an error setting the
* config.
*/
throws IDFFMetaException,JAXBException {
boolean foundCOT = false;
foundCOT = true;
break;
}
}
}
// no cot_list in the original entity config
if (!foundCOT) {
}
}
}
/**
* Iterates through a list of entity config elements and
* removes the circle trust name from the entity config.
*/
private void removeCOTNameFromConfig(
throws IDFFMetaException {
break;
}
}
}
}
}
}