use of org.apache.axis2.description.AxisModule in project MassBank-web by MassBank.
the class AdminActions method processdisengageModule.
@Action(name = "disengageModule", post = true)
public Redirect processdisengageModule(HttpServletRequest req) throws AxisFault {
String type = req.getParameter("type");
String serviceName = req.getParameter("serviceName");
String moduleName = req.getParameter("module");
AxisConfiguration axisConfiguration = configContext.getAxisConfiguration();
AxisService service = axisConfiguration.getService(serviceName);
AxisModule module = axisConfiguration.getModule(moduleName);
if (type.equals("operation")) {
if (service.isEngaged(module.getName()) || axisConfiguration.isEngaged(module.getName())) {
return new Redirect(LIST_SERVICES).withStatus(false, "Can not disengage module " + moduleName + ". This module is engaged at a higher level.");
} else {
String opName = req.getParameter("operation");
AxisOperation op = service.getOperation(new QName(opName));
op.disengageModule(module);
return new Redirect(LIST_SERVICES).withStatus(true, "Module " + moduleName + " was disengaged from " + "operation " + opName + " in service " + serviceName + ".");
}
} else {
if (axisConfiguration.isEngaged(module.getName())) {
return new Redirect(LIST_SERVICES).withStatus(false, "Can not disengage module " + moduleName + ". " + "This module is engaged at a higher level.");
} else {
service.disengageModule(axisConfiguration.getModule(moduleName));
return new Redirect(LIST_SERVICES).withStatus(true, "Module " + moduleName + " was disengaged from" + " service " + serviceName + ".");
}
}
}
Aggregations