public static boolean agentConfigurationEquals(FabricService fabricService, Profile thisProfile, Profile otherProfile) { ProfileService profileService = fabricService.adapt(ProfileService.class); Profile thisOverlay = profileService.getOverlayProfile(thisProfile); Profile otherOverlay = profileService.getOverlayProfile(otherProfile); return thisOverlay.getConfiguration(Constants.AGENT_PID).equals(otherOverlay.getConfiguration(Constants.AGENT_PID)); }
public static boolean agentConfigurationEquals(FabricService fabricService, Profile thisProfile, Profile otherProfile) { ProfileService profileService = fabricService.adapt(ProfileService.class); Profile thisOverlay = profileService.getOverlayProfile(thisProfile); Profile otherOverlay = profileService.getOverlayProfile(otherProfile); return thisOverlay.getConfiguration(Constants.AGENT_PID).equals(otherOverlay.getConfiguration(Constants.AGENT_PID)); }
public Profile getOverlayProfile() { ProfileService profileService = fabricService.adapt(ProfileService.class); return profileService.getOverlayProfile(getContainerProfile()); }
if (profiles != null) { for (Profile profile : profiles) { Profile overlay = profileService.getOverlayProfile(profile); Map<String, Map<String, String>> configurations = overlay.getConfigurations(); Set<Entry<String, Map<String, String>>> entries = configurations.entrySet();
public static Map<String, File> getJavaContainerArtifactsFiles(FabricService fabricService, List<Profile> profileList, DownloadManager downloadManager) throws Exception { Map<String, File> answer = new HashMap<String, File>(); ProfileService profileService = fabricService.adapt(ProfileService.class); for (Profile profile : profileList) { Profile overlay = profileService.getOverlayProfile(profile); Map<String, Parser> profileArtifacts = AgentUtils.getProfileArtifacts(fabricService, downloadManager, overlay); appendMavenDependencies(profileArtifacts, profile); Set<String> rawUrls = profileArtifacts.keySet(); downloadArtifactUrls(downloadManager, rawUrls, answer); } return answer; }
/** * Returns the overlay (effective) profile */ @Path("overlay") public ProfileResource overlay() { if (!profile.isOverlay()) { ProfileService profileService = getProfileService(); if (profileService != null) { Profile overlay = profileService.getOverlayProfile(profile); return new ProfileResource(this, overlay); } } return null; }
/** * Returns the overlay (effective) profile */ @Path("overlay") public ProfileResource overlay() { if (!profile.isOverlay()) { ProfileService profileService = getProfileService(); if (profileService != null) { Profile overlay = profileService.getOverlayProfile(profile); return new ProfileResource(this, overlay); } } return null; }
for (String profileId : profileIds) { Profile profile = version.getRequiredProfile(profileId); Profile overlay = profileService.getOverlayProfile(profile); Set<String> configurationFileNames = overlay.getConfigurationFileNames(); for (String fileName : configurationFileNames) {
@Override public Map<String, String> getOverlayProfileProperties(String versionId, String profileId, String pid) { Map<String, String> answer = null; Version version = profileService.getVersion(versionId); if (version != null) { Profile profile = version.getRequiredProfile(profileId); if (profile != null) { Profile overlayProfile = profileService.getOverlayProfile(profile); answer = overlayProfile.getConfiguration(pid); } } return answer; }
for (String profileId : profileIds) { Profile profile = version.getRequiredProfile(profileId); Profile overlay = profileService.getOverlayProfile(profile); Map<String, Map<String, String>> configurations = overlay.getConfigurations(); Set<Entry<String, Map<String, String>>> entries = configurations.entrySet();
private List<Profile> getActiveOrRequiredBrokerProfileMap(Version version, FabricRequirements requirements) { IllegalArgumentAssertion.assertNotNull(fabricService, "fabricService"); List<Profile> answer = new ArrayList<Profile>(); if (version != null) { ProfileService profileService = fabricService.adapt(ProfileService.class); List<Profile> profiles = version.getProfiles(); for (Profile profile : profiles) { String versionId = profile.getVersion(); String profileId = profile.getId(); if (!IGNORED_PROFILES.contains(profileId)) { Profile overlay = profileService.getOverlayProfile(profile); Map<String, Map<String, String>> configurations = overlay.getConfigurations(); Set<Map.Entry<String, Map<String, String>>> entries = configurations.entrySet(); for (Map.Entry<String, Map<String, String>> entry : entries) { String key = entry.getKey(); if (isBrokerConfigPid(key)) { answer.add(overlay); } } } } } return answer; }
@Override public Profile getOverlayProfile(Profile profile) { Permit<ProfileService> permit = permitManager.get().aquirePermit(ProfileService.PERMIT, false); try { ProfileService service = permit.getInstance(); return service.getOverlayProfile(profile); } finally { permit.release(); } }
public static Map<String, String> getOverlayConfiguration(FabricService fabricService, Iterable<String> profileIds, String versionId, String pid, String environment) { Map<String, String> overlayConfig = new HashMap<String, String>(); ProfileService profileService = fabricService.adapt(ProfileService.class); // this should only be null in test cases if (profileService != null) { Version version = null; if (versionId == null) { version = fabricService.getRequiredDefaultVersion(); } else { version = profileService.getRequiredVersion(versionId); } if (profileIds != null) { for (String profileId : profileIds) { Profile profile = version.getRequiredProfile(profileId); Profile overlay = profileService.getOverlayProfile(profile); Map<String, String> profileConfig = overlay.getConfiguration(pid); if (profileConfig != null) { overlayConfig.putAll(profileConfig); } } } } return overlayConfig; }
Profile profile = profileService.getOverlayProfile(immediateProfile);
public static Map<String, String> getOverlayConfiguration(FabricService fabricService, Iterable<String> profileIds, String versionId, String pid, String environment) { Map<String, String> overlayConfig = new HashMap<String, String>(); ProfileService profileService = fabricService.adapt(ProfileService.class); // this should only be null in test cases if (profileService != null) { Version version = null; if (versionId == null) { version = fabricService.getRequiredDefaultVersion(); } else { version = profileService.getRequiredVersion(versionId); } if (profileIds != null) { for (String profileId : profileIds) { Profile profile = version.getRequiredProfile(profileId); Profile overlay = profileService.getOverlayProfile(profile); Map<String, String> profileConfig = overlay.getConfiguration(pid); if (profileConfig != null) { overlayConfig.putAll(profileConfig); } } } } return overlayConfig; }
/** * Get the effective profile, which is the overlay profile with substituted configurations. */ public static Profile getEffectiveProfile(FabricService fabricService, Profile profile) { ProfileService profileService = fabricService.adapt(ProfileService.class); Profile overlayProfile = profileService.getOverlayProfile(profile); Map<String, Map<String, String>> configurations = overlayProfile.getConfigurations(); ProfileBuilder builder = ProfileBuilder.Factory.createFrom(overlayProfile); builder.setConfigurations(fabricService.substituteConfigurations(configurations)); return builder.getProfile(); }
/** * Get the effective profile, which is the overlay profile with substituted configurations. */ public static Profile getEffectiveProfile(FabricService fabricService, Profile profile) { ProfileService profileService = fabricService.adapt(ProfileService.class); Profile overlayProfile = profileService.getOverlayProfile(profile); Map<String, Map<String, String>> configurations = overlayProfile.getConfigurations(); ProfileBuilder builder = ProfileBuilder.Factory.createFrom(overlayProfile); builder.setConfigurations(fabricService.substituteConfigurations(configurations, overlayProfile.getId())); return builder.getProfile(); }
Profile overlay = profileService.getOverlayProfile(profile); ProfileVersionKey key = new ProfileVersionKey(profile);
/** * Creates an aggregation of all available {@link Profile}s. */ private Profile getAllProfilesOverlay() { Container container = fabricService.get().getCurrentContainer(); ProfileService profileService = fabricService.get().adapt(ProfileService.class); Version version = container.getVersion(); Profile versionProfile = getVersionProfile(version); return Profiles.getEffectiveProfile(fabricService.get(), profileService.getOverlayProfile(versionProfile)); }
/** * Creates an aggregation of all available {@link Profile}s. */ private Profile getAllProfilesOverlay() { Container container = fabricService.get().getCurrentContainer(); ProfileService profileService = fabricService.get().adapt(ProfileService.class); Version version = container.getVersion(); Profile versionProfile = getVersionProfile(version); return Profiles.getEffectiveProfile(fabricService.get(), profileService.getOverlayProfile(versionProfile)); }