use of com.sun.identity.cot.COTException in project OpenAM by OpenRock.
the class FSAuthDomainsModelImpl method getCircleOfTrustDescriptors.
public Set getCircleOfTrustDescriptors() {
Set descSet = new HashSet();
String realm = COTConstants.ROOT_REALM;
try {
CircleOfTrustManager manager = getCircleOfTrustManager();
Set realmSet = getRealmNames("/", "*");
for (Iterator i = realmSet.iterator(); i.hasNext(); ) {
realm = (String) i.next();
Set cotSet = manager.getAllCirclesOfTrust(realm);
for (Iterator j = cotSet.iterator(); j.hasNext(); ) {
String cotName = (String) j.next();
CircleOfTrustDescriptor descriptor = manager.getCircleOfTrust(realm, cotName);
descSet.add(descriptor);
}
}
} catch (COTException e) {
String[] paramsEx = { realm, getErrorString(e) };
logEvent("FEDERATION_EXCEPTION_GET_AUTH_DOMAINS", paramsEx);
debug.warning("FSAuthDomainsModelImpl.getAuthenticationDomains", e);
} catch (AMConsoleException e) {
debug.warning("FSAuthDomainsModelImpl.getAuthenticationDomains", e);
}
return descSet;
}
use of com.sun.identity.cot.COTException in project OpenAM by OpenRock.
the class FSAuthDomainsModelImpl method createAuthenticationDomain.
/**
* Creates authentication domain.
*
* @param attrValues Map of attribute name to set of attribute values.
* @throws AMConsoleException if authentication domain created.
*/
public void createAuthenticationDomain(Map attrValues, Set providers) throws AMConsoleException {
String realm = (String) AMAdminUtils.getValue((Set) attrValues.get(SINGLE_CHOICE_REALM));
String status = (String) AMAdminUtils.getValue((Set) attrValues.get(SINGLE_CHOICE_STATUS));
String name = (String) AMAdminUtils.getValue((Set) attrValues.get(TF_NAME));
if (name.trim().length() == 0) {
throw new AMConsoleException("authdomain.authentication.domain.name.missing.message");
}
String[] param = { name };
logEvent("ATTEMPT_CREATE_AUTH_DOMAIN", param);
try {
CircleOfTrustDescriptor descriptor = new CircleOfTrustDescriptor(name, realm, status);
descriptor.setTrustedProviders(providers);
descriptor.setCircleOfTrustDescription((String) AMAdminUtils.getValue((Set) attrValues.get(TF_DESCRIPTION)));
descriptor.setIDFFReaderServiceURL((String) AMAdminUtils.getValue((Set) attrValues.get(TF_IDFF_READER_SERVICE_URL)));
descriptor.setIDFFWriterServiceURL((String) AMAdminUtils.getValue((Set) attrValues.get(TF_IDFF_WRITER_SERVICE_URL)));
descriptor.setSAML2ReaderServiceURL((String) AMAdminUtils.getValue((Set) attrValues.get(TF_SAML2_READER_SERVICE_URL)));
descriptor.setSAML2WriterServiceURL((String) AMAdminUtils.getValue((Set) attrValues.get(TF_SAML2_WRITER_SERVICE_URL)));
CircleOfTrustManager manager = getCircleOfTrustManager();
manager.createCircleOfTrust(realm, descriptor);
logEvent("SUCCEED_CREATE_AUTH_DOMAIN", param);
} catch (COTException e) {
String strError = getErrorString(e);
String[] paramsEx = { name, strError };
logEvent("FEDERATION_EXCEPTION_CREATE_AUTH_DOMAIN", paramsEx);
throw new AMConsoleException(strError);
}
}
Aggregations