Github user imesh commented on a diff in the pull request: https://github.com/apache/stratos/pull/277#discussion_r27019543 --- Diff: components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/context/CloudControllerContext.java --- @@ -729,4 +741,96 @@ private void copyList(List sourceList, List destinationList) { destinationList.add(item); } } + + public Map<String, Map<String, IaasProvider>> getPartitionToIaasProviderByCartridge() { + return partitionToIaasProviderByCartridge; + } + + public void setPartitionToIaasProvider(Map<String, Map<String, IaasProvider>> partitionToIaasProviderByCartridge) { + this.partitionToIaasProviderByCartridge = partitionToIaasProviderByCartridge; + } + + public void addIaasProvider(String cartridgeId, String partitionId, IaasProvider iaasProvider) { + Map<String, IaasProvider> partitionToIaasProvider = new ConcurrentHashMap<String, IaasProvider>(); + partitionToIaasProvider.put(partitionId, iaasProvider); + this.partitionToIaasProviderByCartridge.put(cartridgeId, partitionToIaasProvider); + } + + public void addIaasProviders(String cartridgeId, Map<String, IaasProvider> map) { + Map<String, IaasProvider> partitionToIaasProvider = new ConcurrentHashMap<String, IaasProvider>(); + for (Iterator<String> iterator = map.keySet().iterator(); iterator.hasNext(); ) { + String key = iterator.next(); + IaasProvider value = map.get(key); + + partitionToIaasProvider.put(key, value); + if (log.isDebugEnabled()) { + log.debug("Partition map updated for the Cartridge: " + this.hashCode() + ". " --- End diff -- Is there any reason for printing hash code? May be we can use cartridge type. Thanks
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---