Search in sources :

Example 1 with Privacy_ServletDeployedEvent

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)));
}
Also used : Privacy_ServletDeployedEvent(org.iobserve.common.record.Privacy_ServletDeployedEvent) ServletContext(javax.servlet.ServletContext)

Example 2 with Privacy_ServletDeployedEvent

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);
    }
}
Also used : Privacy_ServletDeployedEvent(org.iobserve.common.record.Privacy_ServletDeployedEvent) PCMDeployedEvent(org.iobserve.analysis.deployment.data.PCMDeployedEvent) Correspondent(org.iobserve.model.correspondence.Correspondent)

Aggregations

Privacy_ServletDeployedEvent (org.iobserve.common.record.Privacy_ServletDeployedEvent)2 ServletContext (javax.servlet.ServletContext)1 PCMDeployedEvent (org.iobserve.analysis.deployment.data.PCMDeployedEvent)1 Correspondent (org.iobserve.model.correspondence.Correspondent)1