Package io.fabric8.api

Examples of io.fabric8.api.ProfileRegistry


    }

    public static Boolean profileAvailable(String profile, String version, Long timeout) throws Exception {
        ModuleContext moduleContext = RuntimeLocator.getRequiredRuntime().getModuleContext();
        FabricService fabricService = ServiceLocator.awaitService(moduleContext, FabricService.class);
        ProfileRegistry profileRegistry = fabricService.adapt(ProfileRegistry.class);
        for (long t = 0; (!profileRegistry.hasProfile(version, profile&& t < timeout); t += 2000L) {
            Thread.sleep(2000L);
        }
        return profileRegistry.hasProfile(version, profile);
    }
View Full Code Here


            throw rethrow;
        }
    }

    protected 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

        Dictionary<String, Object> properties = config.getProperties();
        properties.put(Constants.GIT_REMOTE_URL, remoteUrl.toExternalForm());
        config.update(properties);
       
        // Wait for the configuredUrl to show up the {@link ProfileRegistry}
        ProfileRegistry profileRegistry = ServiceLocator.awaitService(ProfileRegistry.class);
        Map<String, String> dsprops = profileRegistry.getDataStoreProperties();
        while (!dsprops.containsKey(Constants.GIT_REMOTE_URL)) {
            Thread.sleep(200);
            profileRegistry = ServiceLocator.awaitService(ProfileRegistry.class);
            dsprops = profileRegistry.getDataStoreProperties();
        }
    }
View Full Code Here

        Dictionary<String, Object> properties = config.getProperties();
        properties.remove(Constants.GIT_REMOTE_URL);
        config.update(properties);
       
        // Wait for the configuredUrl to be removed from the {@link ProfileRegistry}
        ProfileRegistry profileRegistry = ServiceLocator.awaitService(ProfileRegistry.class);
        Map<String, String> dsprops = profileRegistry.getDataStoreProperties();
        while (dsprops.containsKey(Constants.GIT_REMOTE_URL)) {
            Thread.sleep(200);
            profileRegistry = ServiceLocator.awaitService(ProfileRegistry.class);
            dsprops = profileRegistry.getDataStoreProperties();
        }
    }
View Full Code Here

        }
    }

    public static Boolean profileAvailable(BundleContext bundleContext, String profile, String version, Long timeout) throws Exception {
        FabricService fabricService = ServiceLocator.awaitService(bundleContext, FabricService.class);
        ProfileRegistry profileRegistry = fabricService.adapt(ProfileRegistry.class);
        for (long t = 0; (!profileRegistry.hasProfile(version, profile&& t < timeout); t += 2000L) {
            Thread.sleep(2000L);
        }
        return profileRegistry.hasProfile(version, profile);
    }
View Full Code Here

    int bounds = 100;
    int column = 0;
    Function1 function = new Function1() {
      @Override
      public Object apply(Object element) {
        ProfileStatus status = asProfileStatus(element);
        if (status != null) {
          return status.getProfile();
        }
        return null;
      }
    };
    column = addColumnFunction(250, column, function, "Profile");
    function = new FunctionInteger() {
      @Override
      public Integer apply(Object element) {
        ProfileStatus status = asProfileStatus(element);
        if (status != null) {
          return status.getCount();
        }
        return null;
      }
    };
    column = addColumnFunction(bounds, column, function, "Count");
    function = new FunctionInteger() {
      @Override
      public Integer apply(Object element) {
        ProfileStatus status = asProfileStatus(element);
        if (status != null) {
          return status.getMinimumInstances();
        }
        return null;
      }
    };
    column = addColumnFunction(bounds, column, function, "Minumum");
    function = new FunctionInteger() {
      @Override
      public Integer apply(Object element) {
        ProfileStatus status = asProfileStatus(element);
        if (status != null) {
          return status.getMaximumInstances();
        }
        return null;
      }
    };
    column = addColumnFunction(bounds, column, function, "Maximum");
    function = new Function1() {
      @Override
      public Object apply(Object element) {
        ProfileStatus status = asProfileStatus(element);
        if (status != null) {
          return toHealth(status);
        }
        return null;
      }
    };
    column = addColumnFunction(bounds, column, function, "Status",
        new HealthLabelProvider(function));
    function = new Function1() {
      @Override
      public Double apply(Object element) {
        ProfileStatus status = asProfileStatus(element);
        if (status != null) {
          return status.getHealth(status.getCount());
        }
        return null;
      }
    };
    column = addColumnFunction(bounds, column, function, "Health",
        new PercentFunctionLabelProvider(function));
    function = new Function1() {
      @Override
      public Object apply(Object element) {
        ProfileStatus status = asProfileStatus(element);
        if (status != null) {
          return status.getDependentProfiles();
        }
        return null;
      }
    };
    column = addColumnFunction(250, column, function, "Dependencies");
View Full Code Here

    int bounds = 100;
    int column = 0;
    Function1 function = new Function1() {
      @Override
      public Object apply(Object element) {
        ProfileStatus status = asProfileStatus(element);
        if (status != null) {
          return status.getProfile();
        }
        return null;
      }
    };
    column = addColumnFunction(250, column, function, "Profile");
    function = new FunctionInteger() {
      @Override
      public Integer apply(Object element) {
        ProfileStatus status = asProfileStatus(element);
        if (status != null) {
          return status.getCount();
        }
        return null;
      }
    };
    column = addColumnFunction(bounds, column, function, "Count");
    function = new FunctionInteger() {
      @Override
      public Integer apply(Object element) {
        ProfileStatus status = asProfileStatus(element);
        if (status != null) {
          return status.getMinimumInstances();
        }
        return null;
      }
    };
    column = addColumnFunction(bounds, column, function, "Minumum");
    function = new FunctionInteger() {
      @Override
      public Integer apply(Object element) {
        ProfileStatus status = asProfileStatus(element);
        if (status != null) {
          return status.getMaximumInstances();
        }
        return null;
      }
    };
    column = addColumnFunction(bounds, column, function, "Maximum");
    function = new Function1() {
      @Override
      public Object apply(Object element) {
        ProfileStatus status = asProfileStatus(element);
        if (status != null) {
          return toHealth(status);
        }
        return null;
      }
    };
    column = addColumnFunction(bounds, column, function, "Status",
        new HealthLabelProvider(function));
    function = new Function1() {
      @Override
      public Double apply(Object element) {
        ProfileStatus status = asProfileStatus(element);
        if (status != null) {
          return status.getHealth(status.getCount());
        }
        return null;
      }
    };
    column = addColumnFunction(bounds, column, function, "Health",
        new PercentFunctionLabelProvider(function));
    function = new Function1() {
      @Override
      public Object apply(Object element) {
        ProfileStatus status = asProfileStatus(element);
        if (status != null) {
          return status.getDependentProfiles();
        }
        return null;
      }
    };
    column = addColumnFunction(250, column, function, "Dependencies");
View Full Code Here

  protected Set<String> getSelectedVersionNames() {
    Set<String> answer = new HashSet<String>();
    List<Container> containers = getSelectedContainers();
    for (Container container : containers) {
      Version version = container.getVersion();
      if (version != null) {
        String name = version.getId();
        if (name != null) {
          answer.add(name);
        }
      }
    }
View Full Code Here

  protected Set<String> getSelectedVersionNames() {
    Set<String> answer = new HashSet<String>();
    List<Container> containers = getSelectedContainers();
    for (Container container : containers) {
      Version version = container.getVersion();
      if (version != null) {
        String name = version.getId();
        if (name != null) {
          answer.add(name);
        }
      }
    }
View Full Code Here

  /* (non-Javadoc)
   * @see java.lang.Comparable#compareTo(java.lang.Object)
   */
  @Override
  public int compareTo(Version o) {
    return new VersionSequence(getId()).compareTo(new VersionSequence(o.getId()));
  }
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.