[ 
https://issues.apache.org/jira/browse/GEODE-3793?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16252537#comment-16252537
 ] 

ASF GitHub Bot commented on GEODE-3793:
---------------------------------------

WireBaron commented on a change in pull request #1058: GEODE-3793: Refactor 
version validation into testable class.
URL: https://github.com/apache/geode/pull/1058#discussion_r150979862
 
 

 ##########
 File path: 
geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/v1/operations/VersionValidator.java
 ##########
 @@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
+ */
+package org.apache.geode.internal.protocol.protobuf.v1.operations;
+
+import org.apache.geode.internal.protocol.protobuf.v1.ConnectionAPI;
+
+public class VersionValidator {
+  private int majorVersion;
+  private int minorVersion;
+
+  public VersionValidator() {
+    this(ConnectionAPI.MajorVersions.CURRENT_MAJOR_VERSION_VALUE,
+        ConnectionAPI.MinorVersions.CURRENT_MINOR_VERSION_VALUE);
+  }
+
+  VersionValidator(int majorVersion, int minorVersion) {
+    this.majorVersion = majorVersion;
+    this.minorVersion = minorVersion;
+  }
+
+  public boolean isValid(int majorVersion, int minorVersion) {
+    // Require an exact match with our version of the protobuf code for this 
implementation
 
 Review comment:
   This comment no longer seems accurate, as we're no longer requiring an exact 
match on the minor version.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Test/prove out new protocol's versioning/message additions
> ----------------------------------------------------------
>
>                 Key: GEODE-3793
>                 URL: https://issues.apache.org/jira/browse/GEODE-3793
>             Project: Geode
>          Issue Type: Task
>          Components: client/server
>            Reporter: Geode Integration
>
> Test and prove out the new protocol's versioning/addition of messages.
> Expected: 
> Clients on a different major version will receive a helpful error message 
> (and are not supported)
> Clients on the same major version (but possibly different minor version) will 
> be supported.
> So, devs should be able to add new messages to the protocol, bumping the 
> minor version, and clients without knowledge of that message should still be 
> supported (as long as they're on the same major version).



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to