Examples of ProfileRegistry


Examples of io.fabric8.api.ProfileRegistry

    }

    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

Examples of io.fabric8.api.ProfileRegistry

        }
    }

    @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

Examples of io.fabric8.api.ProfileRegistry

        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

Examples of io.fabric8.api.ProfileRegistry

        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

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

Examples of io.fabric8.api.ProfileRegistry

            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

Examples of io.fabric8.api.ProfileRegistry

        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

Examples of io.fabric8.api.ProfileRegistry

        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

Examples of io.fabric8.api.ProfileRegistry

        }
    }

    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
TOP
Copyright © 2018 www.massapi.com. 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.