Search in sources :

Example 1 with AxisService

use of org.apache.axis2.description.AxisService in project MassBank-web by MassBank.

the class AdminActions method listSingleService.

@Action(name = "listSingleService")
public View listSingleService(HttpServletRequest req) throws AxisFault {
    // Clearing out any old values.
    req.getSession().setAttribute(Constants.IS_FAULTY, "");
    String serviceName = req.getParameter("serviceName");
    if (serviceName != null) {
        AxisService service = configContext.getAxisConfiguration().getService(serviceName);
        req.getSession().setAttribute(Constants.SINGLE_SERVICE, service);
    }
    return new View("listSingleService.jsp");
}
Also used : AxisService(org.apache.axis2.description.AxisService)

Example 2 with AxisService

use of org.apache.axis2.description.AxisService in project MassBank-web by MassBank.

the class AdminActions method updateServiceParameters.

@Action(name = "updateServiceParameters", post = true)
public Redirect updateServiceParameters(HttpServletRequest request) throws AxisFault {
    String serviceName = request.getParameter("axisService");
    AxisService service = configContext.getAxisConfiguration().getService(serviceName);
    if (service != null) {
        for (Parameter parameter : service.getParameters()) {
            String para = request.getParameter(serviceName + "_" + parameter.getName());
            service.addParameter(new Parameter(parameter.getName(), para));
        }
        for (Iterator<AxisOperation> iterator = service.getOperations(); iterator.hasNext(); ) {
            AxisOperation axisOperation = iterator.next();
            String op_name = axisOperation.getName().getLocalPart();
            for (Parameter parameter : axisOperation.getParameters()) {
                String para = request.getParameter(op_name + "_" + parameter.getName());
                axisOperation.addParameter(new Parameter(parameter.getName(), para));
            }
        }
    }
    return new Redirect(EDIT_SERVICE_PARAMETERS).withStatus(true, "Parameters Changed Successfully.").withParameter("axisService", serviceName);
}
Also used : AxisOperation(org.apache.axis2.description.AxisOperation) AxisService(org.apache.axis2.description.AxisService) Parameter(org.apache.axis2.description.Parameter)

Example 3 with AxisService

use of org.apache.axis2.description.AxisService in project MassBank-web by MassBank.

the class AdminActions method editServiceParameters.

@Action(name = EDIT_SERVICE_PARAMETERS)
public View editServiceParameters(HttpServletRequest req) throws AxisFault {
    String serviceName = req.getParameter("axisService");
    AxisService service = configContext.getAxisConfiguration().getServiceForActivation(serviceName);
    if (service.isActive()) {
        if (serviceName != null) {
            req.getSession().setAttribute(Constants.SERVICE, configContext.getAxisConfiguration().getService(serviceName));
        }
        req.setAttribute("serviceName", serviceName);
        req.setAttribute("parameters", getParameters(service));
        Map<String, Map<String, String>> operations = new TreeMap<String, Map<String, String>>();
        for (Iterator<AxisOperation> it = service.getOperations(); it.hasNext(); ) {
            AxisOperation operation = it.next();
            operations.put(operation.getName().getLocalPart(), getParameters(operation));
        }
        req.setAttribute("operations", operations);
    } else {
        req.setAttribute("status", "Service " + serviceName + " is not an active service" + ". \n Only parameters of active services can be edited.");
    }
    return new View("editServiceParameters.jsp");
}
Also used : AxisOperation(org.apache.axis2.description.AxisOperation) AxisService(org.apache.axis2.description.AxisService) TreeMap(java.util.TreeMap) HashMap(java.util.HashMap) Map(java.util.Map) TreeMap(java.util.TreeMap)

Example 4 with AxisService

use of org.apache.axis2.description.AxisService in project MassBank-web by MassBank.

the class AdminActions method viewServiceContext.

@Action(name = "viewServiceContext")
public View viewServiceContext(HttpServletRequest req) throws AxisFault {
    String type = req.getParameter("TYPE");
    String sgID = req.getParameter("PID");
    String ID = req.getParameter("ID");
    ServiceGroupContext sgContext = configContext.getServiceGroupContext(sgID);
    if (sgContext != null) {
        AxisService service = sgContext.getDescription().getService(ID);
        ServiceContext serviceContext = sgContext.getServiceContext(service);
        req.setAttribute("ServiceContext", serviceContext);
        req.setAttribute("TYPE", type);
    } else {
        req.setAttribute("ServiceContext", null);
        req.setAttribute("TYPE", type);
    }
    return new View("viewServiceContext.jsp");
}
Also used : ServiceGroupContext(org.apache.axis2.context.ServiceGroupContext) ServiceContext(org.apache.axis2.context.ServiceContext) AxisService(org.apache.axis2.description.AxisService)

Example 5 with AxisService

use of org.apache.axis2.description.AxisService in project wso2-axis2-transports by wso2.

the class RabbitMQEndpoint method loadConfiguration.

@Override
public boolean loadConfiguration(ParameterInclude params) throws AxisFault {
    // We only support endpoints configured at service level
    if (!(params instanceof AxisService)) {
        return false;
    }
    AxisService service = (AxisService) params;
    rabbitMQConnectionFactory = rabbitMQListener.getConnectionFactory(service);
    if (rabbitMQConnectionFactory == null) {
        return false;
    }
    serviceTaskManager = ServiceTaskManagerFactory.createTaskManagerForService(rabbitMQConnectionFactory, service, workerPool);
    serviceTaskManager.setRabbitMQMessageReceiver(new RabbitMQMessageReceiver(rabbitMQListener, rabbitMQConnectionFactory, this));
    return true;
}
Also used : AxisService(org.apache.axis2.description.AxisService)

Aggregations

AxisService (org.apache.axis2.description.AxisService)19 AxisFault (org.apache.axis2.AxisFault)11 AxisOperation (org.apache.axis2.description.AxisOperation)7 Parameter (org.apache.axis2.description.Parameter)6 EndpointReference (org.apache.axis2.addressing.EndpointReference)5 QName (javax.xml.namespace.QName)4 Map (java.util.Map)3 OMElement (org.apache.axiom.om.OMElement)3 MessageContext (org.apache.axis2.context.MessageContext)3 AxisConfiguration (org.apache.axis2.engine.AxisConfiguration)3 SocketException (java.net.SocketException)2 HashMap (java.util.HashMap)2 SOAPEnvelope (org.apache.axiom.soap.SOAPEnvelope)2 Options (org.apache.axis2.client.Options)2 ServiceClient (org.apache.axis2.client.ServiceClient)2 MultipleEntryHashMap (org.apache.axis2.util.MultipleEntryHashMap)2 InputStream (java.io.InputStream)1 PrintWriter (java.io.PrintWriter)1 URI (java.net.URI)1 URISyntaxException (java.net.URISyntaxException)1