8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster/**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Copyright (c) 2005 Sun Microsystems Inc. All Rights Reserved
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * The contents of this file are subject to the terms
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * of the Common Development and Distribution License
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * (the License). You may not use this file except in
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * compliance with the License.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * You can obtain a copy of the License at
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * https://opensso.dev.java.net/public/CDDLv1.0.html or
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * opensso/legal/CDDLv1.0.txt
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * See the License for the specific language governing
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * permission and limitations under the License.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * When distributing Covered Code, include this CDDL
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Header Notice in each file and include the License file
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * at opensso/legal/CDDLv1.0.txt.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * If applicable, add the following below the CDDL Header,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * with the fields enclosed by brackets [] replaced by
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * your own identifying information:
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * "Portions Copyrighted [year] [name of copyright owner]"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * $Id: Organization.java,v 1.3 2008/06/25 05:41:45 qcheng Exp $
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterpackage com.iplanet.ums;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport java.security.Principal;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport java.util.ArrayList;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport java.util.Collection;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport com.iplanet.services.ldap.AttrSet;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport com.iplanet.services.util.I18n;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster/**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Represents an organization object. An organization can have child
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * organizations and groups, or other child objects.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * <pre>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * o=vortex.com (site)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * o=hp (organization)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * uid=jdoe
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * o=sun (organization)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * ou=buyerclub
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * uid=joe
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * </pre>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @supported.api
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterpublic class Organization extends PersistentObject {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster private static I18n i18n = I18n.getInstance(IUMSConstants.UMS_PKG);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * No args constructor, used to contruct the right object as entries are
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * read from persistent storage
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster protected Organization() throws UMSException {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Constructs Organization from supplied session and guid identifying the
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * organization to be constructed.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param session
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * authenticated session object maintained by Session Manager
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param guid
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * globally unique identifier for the organization
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Organization(Principal principal, Guid guid) throws UMSException {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster super(principal, guid);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster verifyClass();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Constructs Organization object without a session. Unlike the constructor
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * with a session parameter , this one simply creates a Group object in
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * memory, using the default template. Call the save() method to save the
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * object to the persistent store.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param attrSet
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * attribute/value set
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Organization(AttrSet attrSet) throws UMSException {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster this(TemplateManager.getTemplateManager().getCreationTemplate(_class,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster null), attrSet);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Constructs Organization object without session. Unlike the constructor
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * with session, this one simply creates Organization object in memory. Call
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * the save() method to save the object to persistent storage.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param template
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * template for the organization
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param attrSet
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * attribute/value set
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @supported.api
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public Organization(CreationTemplate template, AttrSet attrSet)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster throws UMSException {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster super(template, attrSet);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Adds a new object to the organization.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param object
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * object to be added to the organization
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @exception AccessRightsException
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * if an access rights exception occurs
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @exception EntryAlreadyExistsException
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * if the entry already exists
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @exception UMSException
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Fail to add the object
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @supported.api
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public void addChild(PersistentObject object) throws AccessRightsException,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster EntryAlreadyExistsException, UMSException {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Principal principal = getPrincipal();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (principal == null) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String msg = i18n.getString(IUMSConstants.BAD_PRINCIPAL_HDL);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster throw new IllegalArgumentException(msg);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster } else if (object == null) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String msg = i18n.getString(IUMSConstants.BAD_OBJ_TO_ADD);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster throw new IllegalArgumentException(msg);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (object instanceof User) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String pcId = getPeopleContainer((User) object);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (pcId != null) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster PeopleContainer pc = new PeopleContainer(getPrincipal(),
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster new Guid(pcId));
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster pc.addUser((User) object);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster } else {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // no match and no default value found
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // For now, the user will be addedd to the organization.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // May want to add to the default people
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // container(ou=People) instead.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster super.addChild(object);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster } else {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster super.addChild(object);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Removes an object from the organization.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param object
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * object to be removed to the organization
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @exception AccessRightsException
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * if an access rights exception occurs
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @exception EntryNotFoundException
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * if the entry is not found
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @exception UMSException
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Fail to remove the object
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @supported.api
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public void removeChild(PersistentObject object)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster throws AccessRightsException, EntryNotFoundException, UMSException {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (object != null && getPrincipal() != null) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster super.removeChild(object);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Returns the name of the organization.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return name of the organization
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @supported.api
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public String getName() throws UMSException {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return getAttribute(getNamingAttribute()).getValue();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Get roles associated with the organization
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * <P>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * TODO: Not yet implemented
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return guid identifying roles object under the organization
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * public String[] getRolesArray(){ //getRoles() {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * return null; }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Get groups of which the organization is a member.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * <P>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * TODO: Not yet implemented
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return guids identifying groups that the organization is a member of
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * public String[] getGroups() { return null; }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Gets all People Containers under the organization.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return guids identifying People Containers under the organization
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @exception UMSException
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Failure
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @supported.api
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public Collection getPeopleContainerGuids() throws UMSException {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Collection pcs = new ArrayList();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster SearchTemplate template = TemplateManager.getTemplateManager()
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster .getSearchTemplate("BasicPeopleContainerSearch", getGuid());
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster SearchResults results = search(template, null);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster while (results.hasMoreElements()) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster pcs.add(results.next().getGuid());
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return pcs;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Gets People Container associated with the user.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param user
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * user object to lookup
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return guid identifying People Container associated with the user, null
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * if no match found
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @exception UMSException
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Failure
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster private String getPeopleContainer(User user) throws UMSException {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster PCMappingTable mt = PCMappingTable.getPCMappingTable(this);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return mt.getPeopleContainer(user);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Adds rule for determining which People Container the user is supposed to
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * be in.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param filter
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * filter representation of the rule. Accepts filter string with
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * the following format:
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * <P>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * <PRE>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * &ltfilter&gt ::= &ltand&gt | &ltitem&gt &ltand&gt ::= '(' '&'
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * &ltitemlist&gt ')' &ltitemlist&gt ::= &ltitem&gt | &ltitem&gt
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * &ltitemlist&gt &ltitem&gt ::= '(' &ltattr&gt '=' &ltvalue&gt
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * ')'
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * </PRE>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param guid
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * guid of the People Container to which the rule is applied.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @exception UMSException
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Failure
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @supported.api
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public void addPeopleContainerRule(Guid guid, String filter)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster throws UMSException {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster PCMappingTable mt = PCMappingTable.getPCMappingTable(this);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster mt.addRule(guid, filter);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Removes the rule applying to the given People Container guid with the
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * given filter string.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param filter
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * filter string of the rule to be removed
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param guid
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * guid of which the rule applies to
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @exception UMSException
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Failure
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @supported.api
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public void removePeopleContainerRule(Guid guid, String filter)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster throws UMSException {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster PCMappingTable mt = PCMappingTable.getPCMappingTable(this);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster mt.removeRule(guid, filter);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Sets the default People Container for user entries under the
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * organization.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param guid
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * guid of the default People Container
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @exception UMSException
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Failure
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @supported.api
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public void setDefaultPeopleContainer(Guid guid) throws UMSException {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster PCMappingTable mt = PCMappingTable.getPCMappingTable(this);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster mt.setDefault(guid);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster private static final Class _class = com.iplanet.ums.Organization.class;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster}