Search in sources :

Example 16 with InvalidNameException

use of com.sun.identity.policy.InvalidNameException in project OpenAM by OpenRock.

the class LDAPRoles method setValues.

/**
     * Sets the names for the instance of the <code>LDAPRoles</code>
     * object. The names are obtained from the policy object,
     * usually configured when a policy is created. 
     *
     * @param names names selected for the instance of
     * the user collection object.
     *
     * @exception InvalidNameException if the given names are not valid
     */
public void setValues(Set names) throws InvalidNameException {
    if (names == null) {
        debug.error("LDAPRoles.setValues() Invalid names");
        throw (new InvalidNameException(ResBundleUtils.rbName, "ldaproles_subject_invalid_group_names", null, null, PolicyException.USER_COLLECTION));
    }
    selectedRoleDNs = new HashSet<>();
    selectedRoleDNs.addAll(names);
    if (debug.messageEnabled()) {
        debug.message("LDAPRoles.setValues(): selected role names=" + selectedRoleDNs);
    }
    selectedRFCRoleDNs = new HashSet<>();
    // add to the RFC Set now
    Iterator it = names.iterator();
    while (it.hasNext()) {
        selectedRFCRoleDNs.add(DN.valueOf((String) it.next()).toString().toLowerCase());
    }
}
Also used : InvalidNameException(com.sun.identity.policy.InvalidNameException) Iterator(java.util.Iterator) ByteString(org.forgerock.opendj.ldap.ByteString)

Example 17 with InvalidNameException

use of com.sun.identity.policy.InvalidNameException in project OpenAM by OpenRock.

the class LDAPGroups method setValues.

/**
     * Sets the names for the instance of the <code>LDAPGroups</code>
     * object. The names are obtained from the policy object,
     * usually configured when a policy is created. 
     *
     * @param names names selected for the instance of
     * the user collection object.
     *
     * @exception InvalidNameException if the given names are not valid
     */
public void setValues(Set names) throws InvalidNameException {
    if (names == null) {
        debug.error("LDAPGroups.setValues(): Invalid names");
        throw (new InvalidNameException(ResBundleUtils.rbName, "ldapgroups_subject_invalid_group_names", null, null, PolicyException.USER_COLLECTION));
    }
    selectedGroupDNs = new HashSet();
    selectedGroupDNs.addAll(names);
    if (debug.messageEnabled()) {
        debug.message("LDAPGroups.setValues(): selected group names=" + selectedGroupDNs);
    }
    // add to the RFC Set now
    selectedRFCGroupDNs = new HashSet();
    Iterator it = names.iterator();
    while (it.hasNext()) {
        selectedRFCGroupDNs.add(DN.valueOf((String) it.next()).toString().toLowerCase());
    }
}
Also used : InvalidNameException(com.sun.identity.policy.InvalidNameException) Iterator(java.util.Iterator) ByteString(org.forgerock.opendj.ldap.ByteString) HashSet(java.util.HashSet)

Example 18 with InvalidNameException

use of com.sun.identity.policy.InvalidNameException in project OpenAM by OpenRock.

the class LDAPUsers method setValues.

/**
     * Sets the names for the instance of the <code>LDAPUsers</code>
     * object. The names are obtained from the policy object,
     * usually configured when a policy is created. 
     *
     * @param names names selected for the instance of
     * the user collection object.
     *
     * @exception InvalidNameException if the given names are not valid
     */
public void setValues(Set names) throws InvalidNameException {
    if (names == null) {
        debug.error("LDAPUsers.setValues(): Invalid names");
        throw (new InvalidNameException(ResBundleUtils.rbName, "ldapusers_subject_invalid_user_names", null, "null", PolicyException.USER_COLLECTION));
    }
    selectedUserDNs = new HashSet<>();
    selectedUserDNs.addAll(names);
    if (debug.messageEnabled()) {
        debug.message("LDAPUsers.setValues(): selected user names=" + selectedUserDNs);
    }
    selectedRFCUserDNs = new HashSet<>();
    // add to the RFC Set now
    for (Object name : names) {
        selectedRFCUserDNs.add(DN.valueOf((String) name).toString().toLowerCase());
    }
}
Also used : InvalidNameException(com.sun.identity.policy.InvalidNameException) ByteString(org.forgerock.opendj.ldap.ByteString)

Example 19 with InvalidNameException

use of com.sun.identity.policy.InvalidNameException in project OpenAM by OpenRock.

the class Organization method setValues.

/**
     * Sets the names for the instance of the <code>Organization</code>
     * object. The names are obtained from the policy object,
     * usually configured when a policy is created. 
     *
     * @param names names selected for the instance of
     * the user collection object.
     *
     * @exception InvalidNameException if the given names are not valid
     */
public void setValues(Set names) throws InvalidNameException {
    if (names == null) {
        debug.error("Organization.setValues() Invalid names");
        throw (new InvalidNameException(ResBundleUtils.rbName, "org_subject_invalid_user_names", null, "null", PolicyException.USER_COLLECTION));
    }
    selectedOrgDNs = new HashSet<>();
    selectedOrgDNs.addAll(names);
    if (debug.messageEnabled()) {
        debug.message("Organization.setValues(): selected org names=" + selectedOrgDNs);
    }
    selectedRFCOrgDNs = new HashSet<>();
    // add to the RFC Set now
    for (Object name : names) {
        selectedRFCOrgDNs.add(DN.valueOf((String) name).toString().toLowerCase());
    }
}
Also used : InvalidNameException(com.sun.identity.policy.InvalidNameException)

Aggregations

InvalidNameException (com.sun.identity.policy.InvalidNameException)19 Policy (com.sun.identity.policy.Policy)11 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)10 CachedPolicy (com.sun.identity.console.policy.model.CachedPolicy)9 NameAlreadyExistsException (com.sun.identity.policy.NameAlreadyExistsException)8 NameNotFoundException (com.sun.identity.policy.NameNotFoundException)6 HashSet (java.util.HashSet)5 Iterator (java.util.Iterator)3 ByteString (org.forgerock.opendj.ldap.ByteString)3 ActionSchema (com.sun.identity.policy.ActionSchema)2 Rule (com.sun.identity.policy.Rule)2 ServiceType (com.sun.identity.policy.ServiceType)2 Condition (com.sun.identity.policy.interfaces.Condition)2 Referral (com.sun.identity.policy.interfaces.Referral)2 Subject (com.sun.identity.policy.interfaces.Subject)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 Set (java.util.Set)2 SSOException (com.iplanet.sso.SSOException)1 InvalidFormatException (com.sun.identity.policy.InvalidFormatException)1