Search in sources :

Example 1 with TcpDeactivationControlEvent

use of org.iobserve.utility.tcp.events.TcpDeactivationControlEvent in project iobserve-analysis by research-iobserve.

the class ProbeMapper method createMethodsToDeactivate.

private void createMethodsToDeactivate(final ProbeManagementData element) throws ControlEventCreationFailedException, InvocationException, DBException {
    final Map<AllocationContext, Set<OperationSignature>> methodsToDeactivate = element.getMethodsToDeactivate();
    if (methodsToDeactivate != null) {
        this.logger.debug("methods to deactivate");
        for (final AllocationContext allocation : methodsToDeactivate.keySet()) {
            this.logger.debug("AllocationContext to deactivate {}", allocation.getEntityName());
            for (final OperationSignature operationSignature : methodsToDeactivate.get(allocation)) {
                try {
                    final String pattern = this.computeAllocationComponentIdentifierPattern(allocation, operationSignature);
                    this.logger.debug("AllocationContext deactivate operation {} -- {}", operationSignature.getEntityName(), pattern);
                    // deactivation -> no parameters needed
                    final TcpDeactivationControlEvent currentEvent = new TcpDeactivationControlEvent(pattern, element.getTriggerTime());
                    this.fillTcpControlEvent(currentEvent, allocation);
                    this.outputPort.send(currentEvent);
                } catch (final ControlEventCreationFailedException e) {
                    this.logger.error("Could not construct deactivation event for: " + operationSignature.toString(), e);
                }
            }
        }
    }
}
Also used : AllocationContext(org.palladiosimulator.pcm.allocation.AllocationContext) Set(java.util.Set) TcpDeactivationControlEvent(org.iobserve.utility.tcp.events.TcpDeactivationControlEvent) OperationSignature(org.palladiosimulator.pcm.repository.OperationSignature) ControlEventCreationFailedException(org.iobserve.service.privacy.violation.exceptions.ControlEventCreationFailedException)

Aggregations

Set (java.util.Set)1 ControlEventCreationFailedException (org.iobserve.service.privacy.violation.exceptions.ControlEventCreationFailedException)1 TcpDeactivationControlEvent (org.iobserve.utility.tcp.events.TcpDeactivationControlEvent)1 AllocationContext (org.palladiosimulator.pcm.allocation.AllocationContext)1 OperationSignature (org.palladiosimulator.pcm.repository.OperationSignature)1