use of com.sun.identity.wsfederation.meta.WSFederationMetaManager in project OpenAM by OpenRock.
the class FSAuthDomainsModelImpl method getAllProviderNames.
/**
* Returns a <code>Set</code> of provider names that exist in the
* specified realm.
*
* @param realm name of the realm to search.
* @return a set of provider names.
* @throws AMConsoleException if provider names cannot be obtained.
*/
public Set getAllProviderNames(String realm) throws AMConsoleException {
String[] params = { realm };
logEvent("ATTEMPT_GET_ALL_PROVIDER_NAMES", params);
Set availableEntities = new HashSet();
try {
SAML2MetaManager saml2Mgr = new SAML2MetaManager();
Set saml2Entities = saml2Mgr.getAllEntities(realm);
Iterator it = saml2Entities.iterator();
while (it.hasNext()) {
String entityId = (String) it.next();
availableEntities.add(entityId + "|saml2");
}
} catch (SAML2MetaException e) {
String strError = getErrorString(e);
throw new AMConsoleException(strError);
}
try {
Set wsfedEntities = (new WSFederationMetaManager()).getAllEntities(realm);
for (Iterator i = wsfedEntities.iterator(); i.hasNext(); ) {
String tmp = (String) i.next();
availableEntities.add(tmp + "|wsfed");
}
} catch (WSFederationMetaException e) {
debug.warning("EntityModel.getWSFedEntities", e);
throw new AMConsoleException(e.getMessage());
}
try {
IDFFMetaManager idffManager = new IDFFMetaManager(null);
Set entities = idffManager.getAllEntities(realm);
for (Iterator i = entities.iterator(); i.hasNext(); ) {
String tmp = (String) i.next();
availableEntities.add(tmp + "|idff");
}
} catch (IDFFMetaException e) {
debug.warning("FSAuthDomainModel.getAllProviderNames", e);
throw new AMConsoleException(e.getMessage());
}
logEvent("SUCCEED_GET_ALL_PROVIDER_NAMES", params);
return (availableEntities != null) ? availableEntities : Collections.EMPTY_SET;
}
Aggregations