}
private TransactionBlockList deleteSubscription(final Subscription subscription,
final Jedis redis)
{
final TransactionBlockList blocks = new TransactionBlockList();
blocks.add(subscriptionDao.delete(subscription, redis).get());
final VirtualMachineIdentifier vmId = new VirtualMachineIdentifier(subscription.getName());
final VirtualMachineDefinition definition = findVirtualMachineDefinition(vmId);
if (definition != null)
{
blocks.add(virtualMachineDefinitionDao.delete(definition, redis).get());
}
blocks.add(subscriptionDao.setMonitoringFlag(subscription, false));
return blocks;
}