Search in sources :

Example 1 with DeployedEndpointData

use of org.glassfish.webservices.deployment.DeployedEndpointData in project Payara by payara.

the class ListWebServicesCommand method execute.

@Override
public void execute(AdminCommandContext context) {
    ActionReport report = context.getActionReport();
    report.setActionExitCode(ActionReport.ExitCode.SUCCESS);
    WebServicesContainer container = containerProvider.get();
    if (container == null) {
        return;
    }
    WebServicesDeploymentMBean bean = container.getDeploymentBean();
    if (appName != null && moduleName != null && endpointName != null) {
        Map<String, Map<String, Map<String, DeployedEndpointData>>> endpoints = bean.getEndpoint(appName, moduleName, endpointName);
        fillEndpoints(report, endpoints);
    } else if (appName != null && moduleName != null) {
        Map<String, Map<String, Map<String, DeployedEndpointData>>> endpoints = bean.getEndpoints(appName, moduleName);
        fillEndpoints(report, endpoints);
    } else if (appName != null) {
        Map<String, Map<String, Map<String, DeployedEndpointData>>> endpoints = bean.getEndpoints(appName);
        fillEndpoints(report, endpoints);
    } else {
        Map<String, Map<String, Map<String, DeployedEndpointData>>> endpoints = bean.getEndpoints();
        fillEndpoints(report, endpoints);
    }
}
Also used : DeployedEndpointData(org.glassfish.webservices.deployment.DeployedEndpointData) WebServicesContainer(org.glassfish.webservices.WebServicesContainer) ActionReport(org.glassfish.api.ActionReport) WebServicesDeploymentMBean(org.glassfish.webservices.deployment.WebServicesDeploymentMBean) Map(java.util.Map)

Example 2 with DeployedEndpointData

use of org.glassfish.webservices.deployment.DeployedEndpointData in project Payara by payara.

the class ListWebServicesCommand method fillEndpoints.

private void fillEndpoints(ActionReport report, Map<String, Map<String, Map<String, DeployedEndpointData>>> endpoints) {
    if (!endpoints.isEmpty()) {
        Properties extra = new Properties();
        extra.putAll(endpoints);
        report.setExtraProperties(extra);
        ActionReport.MessagePart top = report.getTopMessagePart();
        for (Map.Entry<String, Map<String, Map<String, DeployedEndpointData>>> app : endpoints.entrySet()) {
            ActionReport.MessagePart child = top.addChild();
            child.setMessage("application:" + app.getKey());
            for (Map.Entry<String, Map<String, DeployedEndpointData>> module : app.getValue().entrySet()) {
                child = child.addChild();
                child.setMessage("  module:" + module.getKey());
                for (Map.Entry<String, DeployedEndpointData> endpoint : module.getValue().entrySet()) {
                    child = child.addChild();
                    child.setMessage("    endpoint:" + endpoint.getKey());
                    for (Map.Entry<String, String> endpointData : endpoint.getValue().getStaticAsMap().entrySet()) {
                        child = child.addChild();
                        child.setMessage("      " + endpointData.getKey() + ":" + endpointData.getValue());
                    }
                }
            }
        }
    }
}
Also used : DeployedEndpointData(org.glassfish.webservices.deployment.DeployedEndpointData) Properties(java.util.Properties) ActionReport(org.glassfish.api.ActionReport) Map(java.util.Map)

Example 3 with DeployedEndpointData

use of org.glassfish.webservices.deployment.DeployedEndpointData in project Payara by payara.

the class WebServiceStatsProvider method riUndeploy.

// sun-jaxws.xml undeployment
@ProbeListener("glassfish:webservices:deployment-ri:undeploy")
public synchronized void riUndeploy(@ProbeParam("adapter") ServletAdapter adapter) {
    ServletContext ctxt = adapter.getServletContext();
    String name = ctxt.getContextPath() + adapter.getValidPath();
    DeployedEndpointData data = endpoints.remove(name);
    String contextPath = adapter.getServletContext().getContextPath();
    List<DeployedEndpointData> ri = riEndpoints.get(contextPath);
    if (ri != null) {
        ri.remove(data);
        if (ri.isEmpty()) {
            riEndpoints.remove(contextPath);
        }
    }
}
Also used : DeployedEndpointData(org.glassfish.webservices.deployment.DeployedEndpointData) ServletContext(javax.servlet.ServletContext) ProbeListener(org.glassfish.external.probe.provider.annotations.ProbeListener)

Example 4 with DeployedEndpointData

use of org.glassfish.webservices.deployment.DeployedEndpointData in project Payara by payara.

the class WebServiceStatsProvider method getRiEndpoint.

// Returns all the RI endpoints for context root
@ManagedOperation
public synchronized List<Map<String, String>> getRiEndpoint(String contextPath) {
    List<Map<String, String>> list = new ArrayList<Map<String, String>>();
    List<DeployedEndpointData> ri = riEndpoints.get(contextPath);
    if (ri != null) {
        for (DeployedEndpointData de : ri) {
            list.add(de.getStaticAsMap());
        }
    }
    return list;
}
Also used : DeployedEndpointData(org.glassfish.webservices.deployment.DeployedEndpointData)

Example 5 with DeployedEndpointData

use of org.glassfish.webservices.deployment.DeployedEndpointData in project Payara by payara.

the class WebServiceStatsProvider method riDeploy.

// sun-jaxws.xml deployment
@ProbeListener("glassfish:webservices:deployment-ri:deploy")
public synchronized void riDeploy(@ProbeParam("adapter") ServletAdapter adapter) {
    String contextPath = adapter.getServletContext().getContextPath();
    String path = contextPath + adapter.getValidPath();
    DeployedEndpointData data = endpoints.get(path);
    if (data == null) {
        data = new DeployedEndpointData(path, adapter);
        endpoints.put(path, data);
    }
    List<DeployedEndpointData> ri = riEndpoints.get(contextPath);
    if (ri == null) {
        ri = new ArrayList<DeployedEndpointData>();
        riEndpoints.put(contextPath, ri);
    }
    ri.add(data);
}
Also used : DeployedEndpointData(org.glassfish.webservices.deployment.DeployedEndpointData) ProbeListener(org.glassfish.external.probe.provider.annotations.ProbeListener)

Aggregations

DeployedEndpointData (org.glassfish.webservices.deployment.DeployedEndpointData)5 Map (java.util.Map)2 ActionReport (org.glassfish.api.ActionReport)2 ProbeListener (org.glassfish.external.probe.provider.annotations.ProbeListener)2 Properties (java.util.Properties)1 ServletContext (javax.servlet.ServletContext)1 WebServicesContainer (org.glassfish.webservices.WebServicesContainer)1 WebServicesDeploymentMBean (org.glassfish.webservices.deployment.WebServicesDeploymentMBean)1