Package com.sequenceiq.cloudbreak.domain

Examples of com.sequenceiq.cloudbreak.domain.DetailedStackDescription


        final CloudPlatform cloudPlatform = credential.cloudPlatform();
        if (cloudPlatform.isWithTemplate()) {
            return cloudPlatformConnectors.get(cloudPlatform).describeStackWithResources(stack, stack.getCredential());
        } else {
            try {
                DetailedStackDescription dSD = new DetailedStackDescription();
                ResourceBuilderInit resourceBuilderInit = resourceBuilderInits.get(cloudPlatform);
                final DescribeContextObject describeContextObject = resourceBuilderInit.describeInit(stack);
                for (ResourceBuilder resourceBuilder : networkResourceBuilders.get(cloudPlatform)) {
                    for (Resource resource : stack.getResourcesByType(resourceBuilder.resourceType())) {
                        Optional<String> describe = resourceBuilder.describe(resource, describeContextObject);
                        if (describe.isPresent()) {
                            dSD.getResources().add(describe.get());
                        }
                    }
                }
                for (final ResourceBuilder resourceBuilder : instanceResourceBuilders.get(cloudPlatform)) {
                    List<Future<Optional<String>>> futures = new ArrayList<>();
                    for (final Resource resource : stack.getResourcesByType(resourceBuilder.resourceType())) {
                        Future<Optional<String>> submit = resourceBuilderExecutor.submit(new Callable<Optional<String>>() {
                            @Override
                            public Optional<String> call() throws Exception {
                                return resourceBuilder.describe(resource, describeContextObject);
                            }
                        });
                        futures.add(submit);
                    }
                    for (Future<Optional<String>> future : futures) {
                        if (future.get().isPresent()) {
                            dSD.getResources().add(future.get().get());
                        }
                    }
                }
                return dSD;
            } catch (Exception ex) {
View Full Code Here

TOP

Related Classes of com.sequenceiq.cloudbreak.domain.DetailedStackDescription

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.