class ConnectCommand extends OfflineGfshCommand {

  static boolean shouldConnect(String ourSerializationVersion, String remoteVersion,
      String remoteSerializationVersion) {
    // pre 1.5
    if (remoteVersion == null) {
      return false;
    }

    // at least 1.12 (but only promise forward compatibility within same major)
    if (remoteSerializationVersion != null) {
      int ourMajor = versionComponent(ourSerializationVersion, VERSION_MAJOR);
      int remoteMajor = versionComponent(remoteSerializationVersion, VERSION_MAJOR);
      // assume Geode 2.x will support backward compatibility to 1.x
      return remoteMajor >= 1 && remoteMajor <= ourMajor;
    }

    // after 1.5 but before 1.12, use remoteVersion to determine if 1.10 or after
    int remoteMajorVersion = versionComponent(remoteVersion, VERSION_MAJOR);
    int remoteMinorVersion = versionComponent(remoteVersion, VERSION_MINOR);
    return remoteMajorVersion == 9 && remoteMinorVersion == 9 ||
        remoteMajorVersion == 1 && remoteMinorVersion == 10 ||
        remoteMajorVersion == 1 && remoteMinorVersion == 11;
  }

}