1
/** BEGIN COPYRIGHT BLOCK
2
* Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
3
* Copyright (C) 2005 Red Hat, Inc.
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation version 2 of the License.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
* END COPYRIGHT BLOCK **/
19
package com.netscape.admin.dirserv.account;
21
import java.util.Vector;
22
import netscape.ldap.LDAPConnection;
23
import netscape.ldap.LDAPException;
24
import com.netscape.management.client.util.Debug;
25
import com.netscape.management.client.ug.ResourceEditor;
26
import com.netscape.management.client.ug.ResourcePageObservable;
27
import com.netscape.admin.dirserv.DSUtil;
31
* The specialized version of BuiltinActivationModel for
34
public class RoleActivationModel extends BuiltinActivationModel {
38
* Save the activation/inactivation state for a role
40
public boolean afterSave(ResourcePageObservable o, ResourceEditor ed)
44
LDAPConnection ldc = ed.getConsoleInfo().getLDAPConnection();
46
if (! _activator.isLockingInfrastructureCreated(ldc)) {
47
Debug.println(0, "RoleActivationModel.afterSave: creating the locking infrastructure");
48
_activator.createLockingInfrastructure(ldc);
51
_activator.modifyRolesToActivateRole(ldc);
53
_activator.modifyRolesToInactivateRole(ldc);
54
Debug.println("RoleActivationModel.afterSave: committed activation = " + _activated);
56
catch(LDAPException x) {
57
Debug.println(0, "RoleActivationModel.afterSave: " + x);
60
DSUtil.showLDAPErrorDialog(ed.getFrame(), x, "updating-directory-title");
65
Debug.println("RoleActivationModel.afterSave: no change, nothing to do");