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);
}
}
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());
}
}
}
}
}
}
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);
}
}
}
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;
}
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);
}
Aggregations