Search in sources :

Example 1 with AxisModule

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 + ".");
        }
    }
}
Also used : AxisConfiguration(org.apache.axis2.engine.AxisConfiguration) AxisOperation(org.apache.axis2.description.AxisOperation) QName(javax.xml.namespace.QName) AxisService(org.apache.axis2.description.AxisService) AxisModule(org.apache.axis2.description.AxisModule)

Aggregations

QName (javax.xml.namespace.QName)1 AxisModule (org.apache.axis2.description.AxisModule)1 AxisOperation (org.apache.axis2.description.AxisOperation)1 AxisService (org.apache.axis2.description.AxisService)1 AxisConfiguration (org.apache.axis2.engine.AxisConfiguration)1