Search in sources :

Example 21 with Attr

use of com.iplanet.services.ldap.Attr in project OpenAM by OpenRock.

the class PersistentObject method deleteACI.

/**
     * Deletes an ACI of this object
     * 
     * @param aci ACI to be deleted.
     * @throws AccessRightsException if an access rights exception occurs.
     * @throws UMSException if any error.
     *
     * @supported.api
     */
public void deleteACI(ACI aci) throws AccessRightsException, UMSException {
    Attr attr = new Attr(ACI.ACI, aci.getACIText());
    modify(attr, ModificationType.DELETE);
    save();
}
Also used : Attr(com.iplanet.services.ldap.Attr)

Example 22 with Attr

use of com.iplanet.services.ldap.Attr in project OpenAM by OpenRock.

the class PersistentObject method getRoles.

/**
     * Gets the list of GUIDS roles assosciated with this object
     * 
     * @return list that lets iterating over role GUIDs
     * @throws UMSException
     *             propagates any exception from the datalayer
     *
     * @supported.api
     */
public Collection getRoles() throws UMSException {
    ArrayList roleList = new ArrayList();
    Attr roleAttr = getAttribute(COMPUTED_MEMBER_ATTR_NAME);
    if (roleAttr != null && roleAttr.getStringValues() != null) {
        roleList.addAll(Arrays.asList(roleAttr.getStringValues()));
    }
    return roleList;
}
Also used : ArrayList(java.util.ArrayList) Attr(com.iplanet.services.ldap.Attr)

Example 23 with Attr

use of com.iplanet.services.ldap.Attr in project OpenAM by OpenRock.

the class PersistentObject method addACI.

/**
     * Adds an ACI to this object.
     * 
     * @param aci ACI added to be added to this object.
     * @throws AccessRightsException if an access rights exception occurs.
     * @throws UMSException if any error
     *
     * @supported.api
     */
public void addACI(ACI aci) throws AccessRightsException, UMSException {
    Attr attr = new Attr(ACI.ACI, aci.toString());
    modify(attr, ModificationType.ADD);
    save();
}
Also used : Attr(com.iplanet.services.ldap.Attr)

Example 24 with Attr

use of com.iplanet.services.ldap.Attr in project OpenAM by OpenRock.

the class PersistentObject method setAttribute.

/**
     * Sets an attribute value with a given locale for the entity.
     * <P>
     * IMPORTANT: To make the changes persistent, you need to call the save
     * method to save the changes.
     * <P>
     * 
     * @param attr
     *            Attribute and value
     * @param locale
     *            Intended locale of the attribute to be set
     *
     * @supported.api
     */
public void setAttribute(Attr attr, Locale locale) {
    if (locale == null) {
        setAttribute(attr);
        return;
    }
    // TODO: ??? should check if adding Attr.setName method makes more
    // sense than recopying the data values of the passed in attribute
    //
    Attr attrWithLocale = new Attr(Attr.getName(attr.getBaseName(), locale));
    attrWithLocale.addValues(attr.getStringValues());
    setAttribute(attrWithLocale);
}
Also used : Attr(com.iplanet.services.ldap.Attr)

Example 25 with Attr

use of com.iplanet.services.ldap.Attr in project OpenAM by OpenRock.

the class StaticGroup method getMemberIDAt.

/**
     * Gets a member given an index (zero-based).
     * 
     * @param index
     *            Zero-based index into the group container
     * @return The unique identifier for a member
     * @exception Not
     *                thrown by this class
     * @supported.api
     */
public Guid getMemberIDAt(int index) throws UMSException {
    Attr attr = getAttribute(MEMBER_ATTR_NAME);
    String value = attr.getStringValues()[index];
    return (value != null) ? new Guid(value) : null;
}
Also used : ByteString(org.forgerock.opendj.ldap.ByteString) Attr(com.iplanet.services.ldap.Attr)

Aggregations

Attr (com.iplanet.services.ldap.Attr)89 AttrSet (com.iplanet.services.ldap.AttrSet)34 Guid (com.iplanet.ums.Guid)16 Iterator (java.util.Iterator)15 UMSException (com.iplanet.ums.UMSException)14 PersistentObject (com.iplanet.ums.PersistentObject)12 HashSet (java.util.HashSet)12 Set (java.util.Set)12 HashMap (java.util.HashMap)10 ArrayList (java.util.ArrayList)9 Map (java.util.Map)9 ByteString (org.forgerock.opendj.ldap.ByteString)9 AMException (com.iplanet.am.sdk.AMException)7 SSOException (com.iplanet.sso.SSOException)5 AMHashMap (com.iplanet.am.sdk.AMHashMap)4 Enumeration (java.util.Enumeration)4 AMEntryExistsException (com.iplanet.am.sdk.AMEntryExistsException)3 AssignableDynamicGroup (com.iplanet.ums.AssignableDynamicGroup)3 CreationTemplate (com.iplanet.ums.CreationTemplate)3 EntryNotFoundException (com.iplanet.ums.EntryNotFoundException)3