use of com.sun.identity.policy.NoPermissionException in project OpenAM by OpenRock.
the class PolicyModelImpl method getServiceTypeNames.
/**
* Returns all registered service type names. Map of service name to its
* localized name.
*
* @return all registered service type names.
*/
public Map getServiceTypeNames() {
Map map = null;
try {
Set types = getServiceTypeManager().getServiceTypeNames();
if ((types != null) && !types.isEmpty()) {
map = new HashMap(types.size() * 2);
for (Iterator iter = types.iterator(); iter.hasNext(); ) {
String name = (String) iter.next();
String lname = getLocalizedServiceName(name, null);
if (lname != null) {
map.put(name, lname);
}
}
}
} catch (SSOException e) {
debug.warning("PolicyModelImpl.getServiceTypeNames", e);
} catch (NoPermissionException e) {
debug.warning("PolicyModelImpl.getServiceTypeNames", e);
} catch (AMConsoleException e) {
debug.warning("PolicyModelImpl.getServiceTypeNames", e);
}
return (map == null) ? Collections.EMPTY_MAP : map;
}
use of com.sun.identity.policy.NoPermissionException in project OpenAM by OpenRock.
the class PolicyModelImpl method cachePolicy.
/**
* Caches an existing policy. Returns the cache ID of the policy object.
*
* @param realmName Name of realm.
* @param policyName Name of policy.
* @return cache ID of the policy object.
* @throws AMConsoleException if policy cannot be cached.
*/
public String cachePolicy(String realmName, String policyName) throws AMConsoleException {
try {
PolicyManager policyManager = getPolicyManager(realmName);
Policy policy = policyManager.getPolicy(policyName);
PolicyCache cache = PolicyCache.getInstance();
return cache.cachePolicy(getUserSSOToken(), new CachedPolicy(policy));
} catch (InvalidFormatException e) {
throw new AMConsoleException(getErrorString(e));
} catch (InvalidNameException e) {
throw new AMConsoleException(getErrorString(e));
} catch (NoPermissionException e) {
throw new AMConsoleException(getErrorString(e));
} catch (NameNotFoundException e) {
throw new AMConsoleException(getErrorString(e));
} catch (PolicyException e) {
throw new AMConsoleException(getErrorString(e));
} catch (SSOException e) {
throw new AMConsoleException(getErrorString(e));
}
}
Aggregations