public boolean isOverlay() { return delegate.isOverlay(); }
public boolean isOverlay() { return delegate.isOverlay(); }
public ProfileResource(ResourceSupport parent, Profile profile) { super(parent, (profile.isOverlay() ? "/overlay" : "profile/" + profile.getId())); this.profile = profile; }
public ProfileResource(ResourceSupport parent, Profile profile) { super(parent, (profile.isOverlay() ? "/overlay" : "profile/" + profile.getId())); this.profile = profile; }
/** * 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; }
Map<String, Object> doGetProfile(Version version, String profileId, List<String> fields, boolean mandatory) { Profile profile; if (mandatory) { profile = version.getRequiredProfile(profileId); } else { profile = version.getProfile(profileId); } if (profile == null) { return null; } Map<String, Object> answer = BeanUtils.convertProfileToMap(fabricService, profile, fields); String iconURLField = "iconURL"; if (fields.contains(iconURLField) && !profile.isOverlay()) { // TODO this could move to Profile.getIconURL() but that would require // introducing profileService into ProfileImpl and the ProfileBuilder stuff String restApi = restApiUrl(); if (restApi != null && restApi.length() > 0) { // turn REST into relative URI so it works with docker containers etc (avoids local ports etc) try { URL url = new URL(restApi); restApi = url.getPath(); } catch (MalformedURLException e) { // Ignore } String icon = getIconURL(version, version.getId(), profile, profileId, restApi); answer.put(iconURLField, icon); } } return answer; }
@GET public ProfileDTO details() { String overlay = profile.isOverlay() ? null : getLink("overlay"); return new ProfileDTO(profile, getLink("containers"), overlay, getLink("requirements"), getLink("fileNames")); }
@GET public ProfileDTO details() { String overlay = profile.isOverlay() ? null : getLink("overlay"); return new ProfileDTO(profile, getLink("containers"), overlay, getLink("requirements"), getLink("fileNames")); }
Profile overlayProfile; synchronized (this) { if (profile.isOverlay()) { LOGGER.debug("getOverlayProfile, given profile is already an overlay: " + profile); overlayProfile = profile;
public ProfileDTO(Profile profile) { this.id = profile.getId(); this.version = profile.getVersion(); this.profileHash = profile.getProfileHash(); this.parents = profile.getParentIds(); this.overlay = profile.isOverlay(); this.abstractProfile = profile.isAbstract(); this.locked = profile.isLocked(); this.hidden = profile.isHidden(); this.attributes = profile.getAttributes(); this.bundles = profile.getBundles(); this.features = profile.getFeatures(); this.repositories = profile.getRepositories(); this.fabs = profile.getFabs(); this.overrides = profile.getOverrides(); String versionId = profile.getVersion(); String profileId = profile.getId(); this.configurations = profile.getConfigurationFileNames(); }
public ProfileDTO(Profile profile) { this.id = profile.getId(); this.version = profile.getVersion(); this.profileHash = profile.getProfileHash(); this.parents = profile.getParentIds(); this.overlay = profile.isOverlay(); this.abstractProfile = profile.isAbstract(); this.locked = profile.isLocked(); this.hidden = profile.isHidden(); this.attributes = profile.getAttributes(); this.bundles = profile.getBundles(); this.features = profile.getFeatures(); this.repositories = profile.getRepositories(); this.fabs = profile.getFabs(); this.overrides = profile.getOverrides(); String versionId = profile.getVersion(); String profileId = profile.getId(); this.configurations = profile.getConfigurationFileNames(); }