use of org.iobserve.common.record.Privacy_ServletDeployedEvent in project iobserve-analysis by research-iobserve.
the class DeploymentGeolocationContextListener method triggerDeployedEvent.
@Override
protected void triggerDeployedEvent(final ServletContextEvent event) {
final ServletContext servletContext = event.getServletContext();
final String service = servletContext.getVirtualServerName();
final String context = servletContext.getServletContextName();
final String deploymentId = servletContext.getInitParameter(AbstractDeploymentContextListener.DEPLOYMENT_ID);
final String countryCode = servletContext.getInitParameter(DeploymentGeolocationContextListener.COUNTRY_CODE);
this.monitoringCtrl.newMonitoringRecord(new Privacy_ServletDeployedEvent(this.timeSource.getTime(), service, context, deploymentId, Short.valueOf(countryCode)));
}
use of org.iobserve.common.record.Privacy_ServletDeployedEvent in project iobserve-analysis by research-iobserve.
the class DeployPCMMapper method servletMapper.
private void servletMapper(final ServletDeployedEvent event) {
final String service = event.getService();
final String context = event.getContext();
// build the containerAllocationEvent
final String urlContext = context.replaceAll("\\.", "/");
final String url = "http://" + service + '/' + urlContext;
final Correspondent correspondent = this.correspondence.getCorrespondent(context).get();
if (correspondent != null) {
if (event instanceof Privacy_ServletDeployedEvent) {
this.outputPort.send(new PCMDeployedEvent(service, correspondent, url, ((Privacy_ServletDeployedEvent) event).getCountryCode()));
} else {
this.outputPort.send(new PCMDeployedEvent(service, correspondent, url, (short) 0));
}
} else {
DeployPCMMapper.LOGGER.info("No correspondent found for {}.", service);
}
}
Aggregations