8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Copyright (c) 2005 Sun Microsystems Inc. All Rights Reserved
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 * You can obtain a copy of the License at
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * https://opensso.dev.java.net/public/CDDLv1.0.html or
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * See the License for the specific language governing
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * permission and limitations under the License.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * When distributing Covered Code, include this CDDL
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Header Notice in each file and include the License file
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 * $Id: AMDynamicGroupImpl.java,v 1.5 2009/01/28 05:34:47 ww203982 Exp $
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunnington * Portions Copyrighted 2011-2015 ForgeRock AS.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * The <code>AMDynamicGroupImpl</code> implements interface
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * <code>AMDynamicGroup</code> dynamic group.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @deprecated As of Sun Java System Access Manager 7.1.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterclass AMDynamicGroupImpl extends AMGroupImpl implements AMDynamicGroup {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public AMDynamicGroupImpl(SSOToken ssoToken, String dn) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Returns the filter for the dynamic group.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return the filter for the dynamic group.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @throws AMException if an error is encountered when trying to
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * access/retrieve data from the data store.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @throws SSOException if the single sign on token is no longer valid.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public String getFilter() throws AMException, SSOException {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String[] array = dsServices.getGroupFilterAndScope(token, entryDN,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Sets the the filter for the dynamic group.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param filter the dynamic group filter.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @throws AMException if an error is encountered when trying to
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * access/retrieve data from the data store.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @throws SSOException if the single sign on token is no longer valid.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public void setFilter(String filter) throws AMException, SSOException {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster dsServices.setGroupFilter(token, entryDN, filter);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Sets the aci and the role aci value for the dynamic group.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String roleDN = AMNamingAttrManager.getNamingAttr(AMObject.ROLE)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster + "=" + thisDN.toString().replace(',', '_') + "," + orgDN;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster AMStoreConnection amsc = new AMStoreConnection(token);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster aciValue = gRole.getAttribute("iplanet-am-role-aci-list");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster int indx = aci.indexOf("iplanet-am-static-group-dn=");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String restACI = aci.substring(aci.indexOf("(|(nsroledn"));
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster "iplanet-am-static-group-dn=*").append(entryDN)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster .append(")").append(this.getFilter()).append("))")
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster avPairs.put("iplanet-am-role-aci-list", newACIValue);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster debug.warning("error setting attribute ", ame);