Package org.platformlayer.xaas.repository

Examples of org.platformlayer.xaas.repository.ManagedItemRepository


          public Object call() throws Exception {
            log.info("Starting job");
            activeJob.setState(JobState.RUNNING);

            ItemBase item;
            ManagedItemRepository repository = opsSystem.getManagedItemRepository();
            try {
              boolean fetchTags = true;
              item = repository.getManagedItem(targetItemKey, fetchTags, SecretProvider.from(project));
            } catch (RepositoryException e) {
              throw new OpsException("Error reading item from repository", e);
            }

            if (item == null) {
              throw new WebApplicationException(404);
            }

            List<Object> scopeItems = Lists.newArrayList();

            addActionScopeItems(action, item, scopeItems);

            Object controller = serviceProvider.getController(item);

            scopeItems.add(item);
            scopeItems.add(action);

            BindingScope scope = BindingScope.push(scopeItems);
            opsContext.recurseOperation(scope, controller);

            // TODO: Should we run a verify operation before -> ACTIVE??
            // (we need to fix the states as well)

            ManagedItemState newState = finishAction(action, scope);
            if (newState != null) {
              repository.changeState(targetItemKey, newState);
              item.state = newState;
            }

            log.info("Job finished with SUCCESS");
            activeJob.setState(JobState.SUCCESS);
View Full Code Here

TOP

Related Classes of org.platformlayer.xaas.repository.ManagedItemRepository

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.