use of org.iobserve.service.privacy.violation.exceptions.ControlEventCreationFailedException in project iobserve-analysis by research-iobserve.
the class ProbeMapper method createMethodsToActivate.
private void createMethodsToActivate(final ProbeManagementData element) throws ControlEventCreationFailedException, InvocationException, DBException {
final Map<AllocationContext, Set<OperationSignature>> methodsToActivate = element.getMethodsToActivate();
if (methodsToActivate != null) {
this.logger.debug("methods to activate");
for (final AllocationContext allocation : methodsToActivate.keySet()) {
this.logger.debug("AllocationContext to activate {}", allocation.getEntityName());
for (final OperationSignature operationSignature : methodsToActivate.get(allocation)) {
this.logger.debug("AllocationContext activate operation {}", operationSignature.getEntityName());
try {
final String pattern = this.computeAllocationComponentIdentifierPattern(allocation, operationSignature);
this.logger.debug("AllocationContext activate operation {} -- {}", operationSignature.getEntityName(), pattern);
final TcpActivationControlEvent currentEvent = this.createActivationEvent(pattern, element.getTriggerTime(), element.getWhitelist());
this.fillTcpControlEvent(currentEvent, allocation);
this.outputPort.send(currentEvent);
} catch (final ControlEventCreationFailedException e) {
this.logger.error("Could not construct activation event for: " + operationSignature.toString(), e);
}
}
}
}
}
use of org.iobserve.service.privacy.violation.exceptions.ControlEventCreationFailedException in project iobserve-analysis by research-iobserve.
the class ProbeMapper method createMethodsToUpdate.
private void createMethodsToUpdate(final ProbeManagementData element) throws ControlEventCreationFailedException, InvocationException, DBException {
final Map<AllocationContext, Set<OperationSignature>> methodsToUpdate = element.getMethodsToUpdate();
if (methodsToUpdate != null && element.getWhitelist() != null) {
for (final AllocationContext allocation : methodsToUpdate.keySet()) {
this.logger.debug("AllocationContext to update {}", allocation.getEntityName());
for (final OperationSignature operationSignature : methodsToUpdate.get(allocation)) {
try {
final String pattern = this.computeAllocationComponentIdentifierPattern(allocation, operationSignature);
this.logger.debug("AllocationContext update operation {} -- {}", operationSignature.getEntityName(), pattern);
final Map<String, List<String>> parameters = new HashMap<>();
parameters.put("whitelist", element.getWhitelist());
final TcpUpdateParameterEvent currentEvent = new TcpUpdateParameterEvent(pattern, element.getTriggerTime(), parameters);
this.fillTcpControlEvent(currentEvent, allocation);
this.outputPort.send(currentEvent);
} catch (final ControlEventCreationFailedException e) {
this.logger.error("Could not construct activation event for: {} {}", operationSignature.toString(), e.getLocalizedMessage());
}
}
}
}
}
use of org.iobserve.service.privacy.violation.exceptions.ControlEventCreationFailedException 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);
}
}
}
}
}
Aggregations