Package io.fabric8.api

Examples of io.fabric8.api.ProfileRegistry


        }
        ContainersNode containersNode = fabric.getContainersNode();
        if (containersNode != null) {
          List<Container> selectedContainers = getSelectedContainers();
          if (!selectedContainers.isEmpty()) {
            Container container = selectedContainers.get(0);
            ContainerNode containerNode = containersNode
                .getContainerNode(container.getId());
            if (containerNode != null) {
              Selections.setSingleSelection(
                  fabric.getRefreshableUI(), containerNode);
            }
          }
View Full Code Here


    IStructuredSelection selection = getSelection();
    if (selection != null) {
      boolean changed = false;
      Iterator iterator = selection.iterator();
      while (iterator.hasNext()) {
        Container container = ContainerNode
            .toContainer(iterator.next());
        if (container != null) {
          containers.add(container);
        }
      }
View Full Code Here

          public boolean apply(Container container) {
            return container != null && container.isRoot();
          }
        }));
    if (rootContainers.size() == 1 && fabric != null) {
      Container rootContainer = rootContainers.get(0);
      ContainersNode containersNode = fabric.getContainersNode();
      if (containersNode != null) {
        return containersNode.getContainerNode(rootContainer.getId());
      }
    }
    return null;
  }
View Full Code Here

    }
    return null;
  }

  public boolean matches(ProfileNode profile) {
    Container ag = getContainer();
    Profile[] profiles = ag.getProfiles();
    for (Profile prof : profiles) {
      if (Objects.equal(prof.getId(), profile.getId())) {
        if (Objects.equal(ag.getVersionId(), profile.getVersion())) {
          return true;
        }
      }
    }
    return false;
View Full Code Here

          CreateJCloudsContainerOptions opts = args.withUser(args.getUser(), args.getPassword(), "admin").build();

          FabricPlugin.getLogger().debug("Compute Service: " + opts.getComputeService());

          // finally create the image
          final CreateJCloudsContainerMetadata metadata = provider.create(opts, new CreationStateListener() {
            @Override
            public void onStateChange(String message) {
              monitor.subTask(message);
            }
          });
View Full Code Here

          }
        }
      });
      return (T) answerHolder[0];
    } catch (Exception e) {
      throw new FabricException(e);
    }

  }
View Full Code Here

    }

    private Collection<String> listFiles(final String versionId, final Iterable<String> profileIds, final String path) {
        assertValid();
        Git git = gitService.getGit();
        ProfileRegistry profileRegistry = getFabricService().adapt(ProfileRegistry.class);
        SortedSet<String> answer = new TreeSet<String>();
        for (String profileId : profileIds) {
            profileRegistry.getRequiredProfile(versionId, profileId);
            File profileDirectory = GitHelpers.getProfileDirectory(git, profileId);
            File file = Strings.isNotBlank(path) ? new File(profileDirectory, path) : profileDirectory;
            if (file.exists()) {
                String[] values = file.list();
                if (values != null) {
View Full Code Here

        }
    }

    @Override
    public void run() {
       ProfileRegistry profileRegistry = fabricService.adapt(ProfileRegistry.class);
       String versionId = dataStore.getContainerVersion(name);
       Profile profile = profileRegistry.getProfile(versionId, versionId);
       if (profile != null && !profile.getProfileHash().equals(lastModified)) {
           notifyListeners();
           lastModified = profile.getProfileHash();
       }
    }
View Full Code Here

        return null;
    }

    public Map<String, String> getDataStoreProperties() {
        ProfileRegistry profileRegistry = fabricService.adapt(ProfileRegistry.class);
        Map<String, String> options = new HashMap<String, String>(profileRegistry.getDataStoreProperties());
        if (dataStoreOption != null) {
            for (String opt : dataStoreOption) {
                String[] parts = opt.trim().split(" +");
                options.put(parts[0], parts[1]);
            }
View Full Code Here

        ObjectMapper mapper = DtoHelper.getMapper();
        byte[] json = mapper.writeValueAsBytes(requirements);
        String fileName = DtoHelper.getRequirementsConfigFileName(requirements);

        // lets read the previous requirements if there are any
        ProfileRegistry profileRegistry = fabricService.get().adapt(ProfileRegistry.class);
        byte[] oldData = profile.getFileConfiguration(fileName);

        LOG.info("Writing file " + fileName + " to profile " + profile);
        builder.addFileConfiguration(fileName, json);
View Full Code Here

TOP

Related Classes of io.fabric8.api.ProfileRegistry

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.