title = "Host description";
question = "Are you sure that you want to remove the service description \""
+ h.getType().getHostName() + "\"?";
break;
case SERVICE:
ServiceDescription d = (ServiceDescription) getSelected();
title = "Service description";
question = "Are you sure that you want to remove the applications associated with \""
+ d.getType().getName() + "\"?";
break;
case APPLICATION:
ApplicationDeploymentDescription a = (ApplicationDeploymentDescription) getSelected();
title = "Service description";
question = "Are you sure that you want to remove the service description \""
+ a.getType().getApplicationName().getStringValue() + "\"?";
break;
}
if (askQuestion(title, question)) {
switch (descriptorType){
case HOST:
HostDescription h = (HostDescription) getSelected();
getRegistry().removeHostDescriptor(h.getType().getHostName());
break;
case SERVICE:
ServiceDescription d = (ServiceDescription) getSelected();
getRegistry().removeServiceDescriptor(d.getType().getName());
break;
case APPLICATION:
ApplicationDeploymentDescription a = (ApplicationDeploymentDescription) getSelected();
String[] s = dlist.get(a).split("\\$");
getRegistry().removeApplicationDescriptor(s[0], s[1], a.getType().getApplicationName().getStringValue());