| | |
| | | public class AddToGroupTask extends Task |
| | | { |
| | | private Set<String> backendSet; |
| | | private LinkedHashSet<DN> dns = new LinkedHashSet<DN>(); |
| | | private LinkedHashSet<DN> groupDns = new LinkedHashSet<DN>(); |
| | | private LinkedHashSet<DN> dns = new LinkedHashSet<>(); |
| | | private LinkedHashSet<DN> groupDns = new LinkedHashSet<>(); |
| | | |
| | | /** |
| | | * Constructor of the task. |
| | |
| | | Set<DN> dns, Set<DN> groupDns) |
| | | { |
| | | super(info, dlg); |
| | | backendSet = new HashSet<String>(); |
| | | backendSet = new HashSet<>(); |
| | | this.dns.addAll(dns); |
| | | this.groupDns.addAll(groupDns); |
| | | for (DN groupDn : groupDns) |
| | |
| | | /** {@inheritDoc} */ |
| | | protected ArrayList<String> getCommandLineArguments() |
| | | { |
| | | return new ArrayList<String>(); |
| | | return new ArrayList<>(); |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | |
| | | // 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. |
| | | Set<String> backends = new TreeSet<String>(taskToBeLaunched.getBackends()); |
| | | Set<String> backends = new TreeSet<>(taskToBeLaunched.getBackends()); |
| | | backends.retainAll(getBackends()); |
| | | if (!backends.isEmpty()) |
| | | { |
| | |
| | | private Collection<ModificationItem> getModifications(DN groupDn, |
| | | Set<DN> dns) throws NamingException |
| | | { |
| | | ArrayList<ModificationItem> modifications = |
| | | new ArrayList<ModificationItem>(); |
| | | // Search for the group entry |
| | | ArrayList<ModificationItem> modifications = new ArrayList<>(); |
| | | |
| | | // Search for the group entry |
| | | SearchControls ctls = new SearchControls(); |
| | | ctls.setSearchScope(SearchControls.OBJECT_SCOPE); |
| | | ctls.setReturningAttributes( |
| | |
| | | { |
| | | memberAttr = ServerConstants.ATTR_UNIQUE_MEMBER; |
| | | } |
| | | Set<String> values = |
| | | ConnectionUtils.getValues(sr, memberAttr); |
| | | Set<String> dnsToAdd = new LinkedHashSet<String>(); |
| | | Set<String> values = ConnectionUtils.getValues(sr, memberAttr); |
| | | Set<String> dnsToAdd = new LinkedHashSet<>(); |
| | | if (values != null) |
| | | { |
| | | for (DN newDn : dns) |