Skip to content

Commit

Permalink
add support for substituting engineName in sync.url
Browse files Browse the repository at this point in the history
  • Loading branch information
chenson42 committed Apr 10, 2012
1 parent b3f4e43 commit 1f2ad24
Showing 1 changed file with 6 additions and 3 deletions.
Expand Up @@ -256,11 +256,11 @@ public void setParameterFilter(IParameterFilter parameterFilter) {
}

public String getExternalId() {
return getWithHostName(ParameterConstants.EXTERNAL_ID);
return substituteVariables(ParameterConstants.EXTERNAL_ID);
}

public String getSyncUrl() {
return getWithHostName(ParameterConstants.SYNC_URL);
return substituteVariables(ParameterConstants.SYNC_URL);
}

public List<DatabaseParameter> getDatabaseParametersFor(String paramKey) {
Expand All @@ -272,7 +272,7 @@ public TypedProperties getDatabaseParametersByNodeGroupId(String nodeGroupId) {
return rereadDatabaseParameters(ParameterConstants.ALL, nodeGroupId);
}

protected String getWithHostName(String paramKey) {
protected String substituteVariables(String paramKey) {
String value = getString(paramKey);
if (!StringUtils.isBlank(value)) {
if (value.contains("hostName")) {
Expand All @@ -281,6 +281,9 @@ protected String getWithHostName(String paramKey) {
if (value.contains("ipAddress")) {
value = FormatUtils.replace("ipAddress", AppUtils.getIpAddress(), value);
}
if (value.contains("engineName")) {
value = FormatUtils.replace("engineName", getEngineName(), value);
}
}
return value;
}
Expand Down

0 comments on commit 1f2ad24

Please sign in to comment.