Skip to content

Commit

Permalink
address reviewed changes
Browse files Browse the repository at this point in the history
  • Loading branch information
chathuranga-jayanath-99 committed Dec 7, 2024
1 parent 74ad88a commit eb46402
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ public class SynapseConfigUtils {

private static final Log log = LogFactory.getLog(SynapseConfigUtils.class);

public static final String RESOURCES_IDENTIFIER = "resources:";
public static final String CONVERTED_RESOURCES_IDENTIFIER = "gov:mi-resources/";

private static ConcurrentHashMap<String, SynapseConfiguration> lastRegisteredSynapseConfigurationMap =
new ConcurrentHashMap<String, SynapseConfiguration>();
Expand Down Expand Up @@ -903,5 +905,13 @@ public static SynapseConfiguration getSynapseConfiguration(String tenantDomain){
public static void addSynapseConfiguration(String tenantDomain , SynapseConfiguration synapseConfiguration){
lastRegisteredSynapseConfigurationMap.put(tenantDomain,synapseConfiguration);
}

public static String transformFileKey(String fileKey) {

if (fileKey.startsWith(RESOURCES_IDENTIFIER)) {
return CONVERTED_RESOURCES_IDENTIFIER + fileKey.substring(RESOURCES_IDENTIFIER.length());
}
return fileKey;
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,7 @@ public Object getEntry(String key) {
* @return its value
*/
public Entry getEntryDefinition(String key) {
String transformedKey = Utils.transformFileKey(key);
String transformedKey = SynapseConfigUtils.transformFileKey(key);
Object o = localRegistry.get(key);
if (o == null || o instanceof Entry) {
if (o == null) {
Expand Down
33 changes: 0 additions & 33 deletions modules/core/src/main/java/org/apache/synapse/config/Utils.java

This file was deleted.

0 comments on commit eb46402

Please sign in to comment.