public void onRemoveContent(final DeploymentRecord deployment)
{
assert contentRepository != null : "Contentrepository must not be null!";
List<String> assignedGroups = contentRepository.getServerGroups(deployment);
final PopupPanel loading = Feedback.loading(
Console.CONSTANTS.common_label_plaseWait(),
Console.CONSTANTS.common_label_requestProcessed(),
new Feedback.LoadingCallback()
{
@Override
public void onCancel()
{
}
});
ModelNode operation = new ModelNode();
operation.get(OP).set(COMPOSITE);
operation.get(ADDRESS).setEmptyList();
List<ModelNode> steps = new LinkedList<ModelNode>();
for (String group : assignedGroups)
{
ModelNode groupOp = new ModelNode();
groupOp.get(OP).set(REMOVE);
groupOp.get(ADDRESS).add("server-group", group);
groupOp.get(ADDRESS).add("deployment", deployment.getName());
steps.add(groupOp);
}
ModelNode removeContentOp = new ModelNode();
removeContentOp.get(OP).set(REMOVE);
removeContentOp.get(ADDRESS).add("deployment", deployment.getName());
steps.add(removeContentOp);
operation.get(STEPS).set(steps);
dispatcher.execute(new DMRAction(operation), new SimpleCallback<DMRResponse>()
{
@Override
public void onSuccess(DMRResponse dmrResponse)
{
loading.hide();
ModelNode result = dmrResponse.get();
if (result.isFailure())
{