Search in sources :

Example 1 with WSFederationCOTUtils

use of com.sun.identity.wsfederation.meta.WSFederationCOTUtils in project OpenAM by OpenRock.

the class CircleOfTrustManager method updateWSFedEntityConfig.

/**
     * Updates the WSFederation Entity Configuration.
     *
     * @param realm the realm name.
     * @param cotName the circle of trust name.
     * @param trustedProviders set of trusted provider names.
     * @throws COTException if there is an error updating the configuration.
     */
void updateWSFedEntityConfig(String realm, String cotName, Set trustedProviders) throws COTException {
    String classMethod = "COTManager:updateWSFedEntityConfig";
    String entityId = null;
    WSFederationCOTUtils wsfedCotUtils = new WSFederationCOTUtils(callerSession);
    if (trustedProviders != null && !trustedProviders.isEmpty()) {
        for (Iterator iter = trustedProviders.iterator(); iter.hasNext(); ) {
            entityId = (String) iter.next();
            try {
                wsfedCotUtils.updateEntityConfig(realm, cotName, entityId);
            } catch (WSFederationMetaException sme) {
                throw new COTException(sme);
            } catch (JAXBException e) {
                debug.error(classMethod, e);
                String[] data = { e.getMessage(), cotName, entityId, realm };
                LogUtil.error(Level.INFO, LogUtil.CONFIG_ERROR_CREATE_COT_DESCRIPTOR, data);
                throw new COTException(e);
            }
        }
    }
}
Also used : WSFederationCOTUtils(com.sun.identity.wsfederation.meta.WSFederationCOTUtils) JAXBException(javax.xml.bind.JAXBException) Iterator(java.util.Iterator) WSFederationMetaException(com.sun.identity.wsfederation.meta.WSFederationMetaException)

Aggregations

WSFederationCOTUtils (com.sun.identity.wsfederation.meta.WSFederationCOTUtils)1 WSFederationMetaException (com.sun.identity.wsfederation.meta.WSFederationMetaException)1 Iterator (java.util.Iterator)1 JAXBException (javax.xml.bind.JAXBException)1