use of com.sun.identity.policy.ServiceTypeManager in project OpenAM by OpenRock.
the class PolicyModelImpl method getSvcTypeNameToActionsMap.
private Map getSvcTypeNameToActionsMap(Policy policy, String realmName) {
if (mapSvcTypeNameToActions == null) {
try {
Set serviceTypeNames = getServiceTypeNames().keySet();
int sz = serviceTypeNames.size();
mapSvcTypeNameToActions = new HashMap(sz * 2);
mapSvcTypeNameToResBundle = new HashMap(sz * 2);
ServiceTypeManager mgr = getServiceTypeManager();
for (Iterator i = serviceTypeNames.iterator(); i.hasNext(); ) {
String serviceTypeName = (String) i.next();
ServiceType serviceType = mgr.getServiceType(serviceTypeName);
if (serviceType != null) {
ResourceBundle rb = getResourceBundle(serviceType, getUserLocale());
if (rb != null) {
mapSvcTypeNameToResBundle.put(serviceTypeName, rb);
Set as = getActionSchemas(serviceType);
filterActionSchemaWithI18nKey(as);
if ((as != null) && !as.isEmpty()) {
mapSvcTypeNameToActions.put(serviceTypeName, as);
if (requiresResourceName(policy, realmName, serviceTypeName, as, true)) {
requiredResourceNameService.add(serviceTypeName);
}
if (requiresResourceName(policy, realmName, serviceTypeName, as, false)) {
notRequiredResourceNameService.add(serviceTypeName);
}
}
}
}
}
} catch (AMConsoleException e) {
debug.warning("PolicyModelImppl.getSvcTypeNameToActionsMap", e);
} catch (SSOException e) {
debug.warning("PolicyModelImppl.getSvcTypeNameToActionsMap", e);
} catch (NameNotFoundException e) {
debug.warning("PolicyModelImppl.getSvcTypeNameToActionsMap", e);
}
}
return mapSvcTypeNameToActions;
}
Aggregations