Search in sources :

Example 56 with TransactionExecutionException

use of com.sequenceiq.cloudbreak.common.service.TransactionService.TransactionExecutionException in project cloudbreak by hortonworks.

the class TerminationService method finalizeTermination.

public void finalizeTermination(Long stackId, List<String> instanceIds) {
    try {
        transactionService.required(() -> {
            Stack stack = stackService.getByIdWithListsInTransaction(stackId);
            terminateMetaDataInstances(stack, instanceIds);
        });
    } catch (TransactionExecutionException ex) {
        LOGGER.info("Failed to terminate cluster infrastructure.");
        throw new TerminationFailedException(ex);
    }
}
Also used : TransactionExecutionException(com.sequenceiq.cloudbreak.common.service.TransactionService.TransactionExecutionException) TerminationFailedException(com.sequenceiq.freeipa.flow.stack.termination.TerminationFailedException) Stack(com.sequenceiq.freeipa.entity.Stack)

Aggregations

TransactionExecutionException (com.sequenceiq.cloudbreak.common.service.TransactionService.TransactionExecutionException)56 TransactionRuntimeExecutionException (com.sequenceiq.cloudbreak.common.service.TransactionService.TransactionRuntimeExecutionException)34 Stack (com.sequenceiq.cloudbreak.domain.stack.Stack)26 InstanceMetaData (com.sequenceiq.cloudbreak.domain.stack.instance.InstanceMetaData)17 BadRequestException (com.sequenceiq.cloudbreak.common.exception.BadRequestException)12 TransactionService (com.sequenceiq.cloudbreak.common.service.TransactionService)10 List (java.util.List)10 Set (java.util.Set)10 Inject (javax.inject.Inject)10 Logger (org.slf4j.Logger)10 LoggerFactory (org.slf4j.LoggerFactory)10 FlowIdentifier (com.sequenceiq.flow.api.model.FlowIdentifier)9 Optional (java.util.Optional)9 StackService (com.sequenceiq.cloudbreak.service.stack.StackService)8 Collection (java.util.Collection)8 Map (java.util.Map)8 Collectors (java.util.stream.Collectors)8 Service (org.springframework.stereotype.Service)8 InstanceStatus (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.InstanceStatus)7 CloudbreakServiceException (com.sequenceiq.cloudbreak.common.exception.CloudbreakServiceException)7