Skip to content

Commit

Permalink
Try to insulate against bad client versions.
Browse files Browse the repository at this point in the history
  • Loading branch information
chenson42 committed Sep 4, 2010
1 parent 73b289b commit 3dd9006
Showing 1 changed file with 11 additions and 6 deletions.
Expand Up @@ -154,18 +154,23 @@ private String getNewestVersionOfRootConfigChannelTableNames() {
TreeSet<String> ordered = new TreeSet<String>(rootConfigChannelTableNames.keySet());
return ordered.last();
}

public List<TriggerRouter> getTriggerRoutersForRegistration(String version,
String sourceGroupId, String targetGroupId) {
int initialLoadOrder = 1;

private String getMajorVersion(String version) {
String majorVersion = Integer.toString(Version.parseVersion(version)[0]);
List<String> tables = rootConfigChannelTableNames.get(majorVersion);
if (tables == null) {
String newestVersion = getNewestVersionOfRootConfigChannelTableNames();
log.warn("TriggersDefaultVersionWarning", newestVersion, majorVersion);
majorVersion = newestVersion;
tables = rootConfigChannelTableNames.get(majorVersion);
}
return majorVersion;
}

public List<TriggerRouter> getTriggerRoutersForRegistration(String version,
String sourceGroupId, String targetGroupId) {
int initialLoadOrder = 1;
String majorVersion = getMajorVersion(version);
List<String> tables = rootConfigChannelTableNames.get(majorVersion);
List<TriggerRouter> triggers = new ArrayList<TriggerRouter>(tables.size());
for (int j = 0; j < tables.size(); j++) {
String tableName = tables.get(j);
Expand All @@ -188,7 +193,7 @@ public List<TriggerRouter> getTriggerRoutersForRegistration(String version,

protected TriggerRouter buildRegistrationTriggerRouter(String version, String tableName,
boolean syncChanges, String sourceGroupId, String targetGroupId) {
String majorVersion = Integer.toString(Version.parseVersion(version)[0]);
String majorVersion = getMajorVersion(version);
boolean autoSyncConfig = parameterService.is(ParameterConstants.AUTO_SYNC_CONFIGURATION);

TriggerRouter triggerRouter = new TriggerRouter();
Expand Down

0 comments on commit 3dd9006

Please sign in to comment.