/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at legal-notices/CDDLv1_0.txt.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Copyright 2008-2010 Sun Microsystems, Inc.
* Portions Copyright 2013 ForgeRock AS.
*/
/**
* The class that is in charge of adding a set of entries to a set of static
* groups.
*/
{
/**
* Constructor of the task.
* @param info the control panel information.
* @param dlg the progress dialog where the task progress will be displayed.
* @param dns the DNs of the entries we want to add to the groups.
* @param groupDns the groups that we want to modify.
*/
{
{
for (BackendDescriptor backend :
{
{
{
}
}
}
}
}
/**
* {@inheritDoc}
*/
{
return Type.MODIFY_ENTRY;
}
/**
* {@inheritDoc}
*/
{
return backendSet;
}
/**
* {@inheritDoc}
*/
{
return
}
/**
* {@inheritDoc}
*/
{
return null;
}
/**
* {@inheritDoc}
*/
{
}
/**
* {@inheritDoc}
*/
{
boolean canLaunch = true;
if (!isServerRunning())
{
{
// All the operations are incompatible if they apply to this
// backend for safety. This is a short operation so the limitation
// has not a lot of impact.
{
canLaunch = false;
}
}
}
return canLaunch;
}
/**
* {@inheritDoc}
*/
public boolean regenerateDescriptor()
{
return false;
}
/**
* {@inheritDoc}
*/
public void runTask()
{
try
{
{
{
ModificationItem[] mods =
{
public void run()
{
}
});
{
public void run()
{
}
});
}
}
}
catch (Throwable t)
{
lastException = t;
}
}
/**
* Returns the modifications that must be made to the provided group.
* @param groupDn the DN of the static group that must be updated.
* @param dns the list of entry DNs that must be added to the group.
* @return the list of modifications (in form of ModificationItem) that
* must be made to the provided group.
* @throws NamingException if an error occurs.
*/
{
new ArrayList<ModificationItem>();
// Search for the group entry
new String[] {
});
try
{
{
{
}
{
{
boolean found = false;
{
{
found = true;
break;
}
}
if (!found)
{
}
}
}
else
{
{
}
}
{
new BasicAttribute(memberAttr);
{
}
attribute));
}
}
}
finally
{
}
return modifications;
}
}