public boolean removeProfileRequirements(String profile) { ProfileRequirements requirements = findProfileRequirements(profile); if (requirements != null) { profileRequirements.remove(requirements); return true; } return false; }
public boolean removeProfileRequirements(String profile) { ProfileRequirements requirements = findProfileRequirements(profile); if (requirements != null) { profileRequirements.remove(requirements); return true; } return false; }
/** * Returns or creates a new {@link ProfileRequirements} for the given profile id */ public ProfileRequirements getOrCreateProfileRequirement(String profile) { ProfileRequirements requirements = findProfileRequirements(profile); if (requirements == null) { requirements = new ProfileRequirements(profile); profileRequirements.add(requirements); } return requirements; }
/** * Returns true if there are any requirements for the given profile ID and it has at least 1 minimum instances defined */ public boolean hasMinimumInstances(String profileId) { ProfileRequirements profileRequirement = findProfileRequirements(profileId); if (profileRequirement != null) { return profileRequirement.hasMinimumInstances(); } return false; }
/** * Returns or creates a new {@link ProfileRequirements} for the given profile id */ public ProfileRequirements getOrCreateProfileRequirement(String profile) { ProfileRequirements requirements = findProfileRequirements(profile); if (requirements == null) { requirements = new ProfileRequirements(profile); profileRequirements.add(requirements); } return requirements; }
/** * Returns true if there are any requirements for the given profile ID and it has at least 1 minimum instances defined */ public boolean hasMinimumInstances(String profileId) { ProfileRequirements profileRequirement = findProfileRequirements(profileId); if (profileRequirement != null) { return profileRequirement.hasMinimumInstances(); } return false; }
@Override public List<MQBrokerStatusDTO> loadBrokerStatus(String versionId) throws Exception { FabricRequirements requirements = fabricService.getRequirements(); List<MQBrokerStatusDTO> answer = new ArrayList<MQBrokerStatusDTO>(); Version version = versionId == null ? fabricService.getDefaultVersion() : profileService.getVersion(versionId); Container[] containers = fabricService.getContainers(); List<Profile> values = getActiveOrRequiredBrokerProfileMap(version, requirements); for (Profile profile : values) { List<MQBrokerConfigDTO> list = createConfigDTOs(mqService, profile); for (MQBrokerConfigDTO configDTO : list) { ProfileRequirements profileRequirements = requirements.findProfileRequirements(profile.getId()); int count = 0; for (Container container : containers) { if (Containers.containerHasProfile(container, profile)) { MQBrokerStatusDTO status = createStatusDTO(profile, configDTO, profileRequirements, container); count++; answer.add(status); } } // if there are no containers yet, lets create a record anyway if (count == 0) { MQBrokerStatusDTO status = createStatusDTO(profile, configDTO, profileRequirements, null); answer.add(status); } } } addMasterSlaveStatus(answer); return answer; }