Exemplo n.º 1
0
 public void launchUnassignContentDialog(Content content) {
   if (content.getAssignments().isEmpty()) {
     Console.warning(content.getName() + " is not assigned to a server group.");
   } else {
     Set<String> assignedServerGroupNames =
         Sets.newHashSet(Lists.transform(content.getAssignments(), Assignment::getServerGroup));
     unassignContentDialog.open(
         content, Ordering.natural().immutableSortedCopy(assignedServerGroupNames));
   }
 }
Exemplo n.º 2
0
 public void launchAssignContentDialog(Content content) {
   Set<String> assignedServerGroupNames =
       Sets.newHashSet(Lists.transform(content.getAssignments(), Assignment::getServerGroup));
   Set<String> serverGroupNames =
       Sets.newHashSet(
           Lists.transform(serverGroupStore.getServerGroups(), ServerGroupRecord::getName));
   serverGroupNames.removeAll(assignedServerGroupNames);
   if (serverGroupNames.isEmpty()) {
     Console.warning(content.getName() + " is already assigned to all server groups.");
   } else {
     assignContentDialog.open(content, Ordering.natural().immutableSortedCopy(serverGroupNames));
   }
 }