Search in sources :

Example 1 with IDFFCOTUtils

use of com.sun.identity.federation.meta.IDFFCOTUtils in project OpenAM by OpenRock.

the class CircleOfTrustManager method updateIDFFEntityConfig.

/**
     * Updates the IDFF 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 updateIDFFEntityConfig(String realm, String cotName, Set trustedProviders) throws COTException {
    String classMethod = "COTManager:updateIDFFEntityConfig";
    IDFFCOTUtils idffCotUtils = new IDFFCOTUtils(callerSession);
    String entityId = null;
    if (trustedProviders != null && !trustedProviders.isEmpty()) {
        for (Iterator iter = trustedProviders.iterator(); iter.hasNext(); ) {
            entityId = (String) iter.next();
            try {
                idffCotUtils.updateEntityConfig(realm, cotName, entityId);
            } catch (IDFFMetaException idfe) {
                throw new COTException(idfe);
            } catch (JAXBException jbe) {
                debug.error(classMethod, jbe);
                String[] data = { jbe.getMessage(), cotName, entityId, realm };
                LogUtil.error(Level.INFO, LogUtil.CONFIG_ERROR_CREATE_COT_DESCRIPTOR, data);
                throw new COTException(jbe);
            }
        }
    }
}
Also used : IDFFMetaException(com.sun.identity.federation.meta.IDFFMetaException) JAXBException(javax.xml.bind.JAXBException) Iterator(java.util.Iterator) IDFFCOTUtils(com.sun.identity.federation.meta.IDFFCOTUtils)

Aggregations

IDFFCOTUtils (com.sun.identity.federation.meta.IDFFCOTUtils)1 IDFFMetaException (com.sun.identity.federation.meta.IDFFMetaException)1 Iterator (java.util.Iterator)1 JAXBException (javax.xml.bind.JAXBException)1