Package com.sequenceiq.cloudbreak.service.stack.resource

Examples of com.sequenceiq.cloudbreak.service.stack.resource.DeleteContextObject


                }
                if (cloudPlatform.isWithTemplate()) {
                    cloudPlatformConnectors.get(cloudPlatform).removeInstances(stack, instanceIds);
                } else {
                    ResourceBuilderInit resourceBuilderInit = resourceBuilderInits.get(cloudPlatform);
                    final DeleteContextObject dCO = resourceBuilderInit.deleteInit(stack);

                    for (int j = instanceResourceBuilders.get(cloudPlatform).size() - 1; j >= 0; j--) {
                        List<Future<Boolean>> futures = new ArrayList<>();
                        final int index = j;
                        for (final String instanceId : instanceIds) {
View Full Code Here


        try {
            if (cloudPlatform.isWithTemplate()) {
                cloudPlatformConnectors.get(cloudPlatform).rollback(stackRepository.findOneWithLists(stackId), stack.getResources());
            } else {
                ResourceBuilderInit resourceBuilderInit = resourceBuilderInits.get(cloudPlatform);
                final DeleteContextObject dCO = resourceBuilderInit.deleteInit(stack);
                for (int i = instanceResourceBuilders.get(cloudPlatform).size() - 1; i >= 0; i--) {
                    List<Future<Boolean>> futures = new ArrayList<>();
                    final int index = i;
                    List<Resource> resourceByType =
                            stack.getResourcesByType(instanceResourceBuilders.get(cloudPlatform).get(i).resourceType());
View Full Code Here

        MDCBuilder.buildMdcContext(stack);
        LOGGER.info("Accepted {} event.", ReactorConfig.DELETE_REQUEST_EVENT);
        try {
            if (!data.getCloudPlatform().isWithTemplate()) {
                ResourceBuilderInit resourceBuilderInit = resourceBuilderInits.get(data.getCloudPlatform());
                final DeleteContextObject dCO = resourceBuilderInit.deleteInit(stack);

                for (int i = instanceResourceBuilders.get(data.getCloudPlatform()).size() - 1; i >= 0; i--) {
                    List<Future<Boolean>> futures = new ArrayList<>();
                    final int index = i;
                    List<Resource> resourceByType = stack.getResourcesByType(instanceResourceBuilders.get(data.getCloudPlatform()).get(i).resourceType());
                    for (final Resource resource : resourceByType) {
                        Future<Boolean> submit = resourceBuilderExecutor.submit(new Callable<Boolean>() {
                            @Override
                            public Boolean call() throws Exception {
                                return instanceResourceBuilders.get(data.getCloudPlatform()).get(index).delete(resource, dCO);
                            }
                        });
                        futures.add(submit);
                    }
                    for (Future<Boolean> future : futures) {
                        future.get();
                    }
                }
                for (int i = instanceResourceBuilders.get(data.getCloudPlatform()).size() - 1; i >= 0; i--) {
                    for (Resource resource : stack.getResourcesByType(networkResourceBuilders.get(data.getCloudPlatform()).get(i).resourceType())) {
                        networkResourceBuilders.get(data.getCloudPlatform()).get(i).delete(resource, dCO);
                    }
                }
                reactor.notify(ReactorConfig.DELETE_COMPLETE_EVENT, Event.wrap(new StackDeleteComplete(dCO.getStackId())));
            } else {
                cloudPlatformConnectors.get(data.getCloudPlatform()).deleteStack(stack, stack.getCredential());
            }
        } catch (Exception ex) {
            LOGGER.error(String.format("Stack delete failed on {} stack: ", stack.getId()), ex);
View Full Code Here

TOP

Related Classes of com.sequenceiq.cloudbreak.service.stack.resource.DeleteContextObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.