geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From u..@apache.org
Subject [geode] 01/01: GEODE-3903: Splitting of client protocol code from protobuf implementation
Date Wed, 25 Oct 2017 19:40:27 GMT
This is an automated email from the ASF dual-hosted git repository.

udo pushed a commit to branch feature/GEODE-3903
in repository https://gitbox.apache.org/repos/asf/geode.git

commit 0b9426671e6fe4f29fe35ede704b20428c0972b8
Author: kohlmu-pivotal <ukohlmeyer@pivotal.io>
AuthorDate: Tue Oct 24 14:56:59 2017 -0700

    GEODE-3903: Splitting of client protocol code from protobuf implementation
---
 .../build.gradle                                   | 44 +---------------------
 .../protocol/ClientProtocolMessageHandler.java     |  0
 .../apache/geode/internal/protocol/Failure.java    | 19 +++++-----
 .../internal/protocol/MessageExecutionContext.java |  0
 .../geode/internal/protocol/OperationContext.java  | 30 +++++++--------
 .../geode/internal/protocol/ProtocolErrorCode.java |  0
 .../org/apache/geode/internal/protocol/Result.java |  8 ++--
 .../apache/geode/internal/protocol/Success.java    | 13 +++----
 .../exception/InvalidProtocolMessageException.java |  0
 .../protocol/operations/OperationHandler.java      |  6 +--
 .../internal/protocol/security/Authenticator.java  |  0
 .../internal/protocol/security/Authorizer.java     |  0
 .../security/InvalidConfigAuthenticator.java       | 13 +------
 .../protocol/security/NoOpAuthenticator.java       |  5 ---
 .../internal/protocol/security/NoOpAuthorizer.java |  0
 .../protocol/security/SecurityProcessor.java       |  0
 ...ompatibleAuthenticationMechanismsException.java |  2 +-
 .../processors/AuthorizationSecurityProcessor.java |  0
 .../NoAuthenticationSecurityProcessor.java         |  0
 .../protocol/serializer/ProtocolSerializer.java    |  0
 .../protocol/statistics/NoOpStatistics.java        |  0
 .../statistics/ProtocolClientStatistics.java       |  0
 .../serialization/SerializationService.java        |  0
 .../internal/serialization/SerializationType.java  |  0
 .../geode/internal/serialization/TypeCodec.java    |  0
 .../internal/serialization/codec/JSONCodec.java    |  0
 .../UnsupportedEncodingTypeException.java          |  0
 .../registry/SerializationCodecRegistry.java       |  0
 .../CodecAlreadyRegisteredForTypeException.java    |  0
 .../CodecNotRegisteredForTypeException.java        |  0
 geode-protobuf/build.gradle                        |  1 +
 .../{ => protobuf}/EncodingTypeTranslator.java     |  9 +++--
 .../protobuf/ProtobufOperationContext.java         | 39 +++++++++++++++++++
 .../protocol/protobuf/ProtobufProtocolService.java | 12 +++---
 .../protobuf/ProtobufSerializationService.java     |  1 -
 .../operations/GetAllRequestOperationHandler.java  | 11 +++---
 .../GetAvailableServersOperationHandler.java       |  5 ++-
 .../GetRegionNamesRequestOperationHandler.java     | 11 +++---
 .../GetRegionRequestOperationHandler.java          | 11 +++---
 .../operations/GetRequestOperationHandler.java     | 11 +++---
 .../operations/PutAllRequestOperationHandler.java  | 11 +++---
 .../operations/PutRequestOperationHandler.java     | 11 +++---
 .../operations/RemoveRequestOperationHandler.java  | 11 +++---
 .../AuthenticationRequestOperationHandler.java     |  6 +--
 .../registry/ProtobufOperationContextRegistry.java | 25 ++++++------
 .../security/ProtobufSecurityLookupService.java}   | 15 +++++---
 .../protobuf/security/ProtobufShiroAuthorizer.java |  1 -
 .../protobuf/utilities/ProtobufUtilities.java      |  2 +-
 .../acceptance/CacheConnectionJUnitTest.java       |  1 -
 .../CacheConnectionTimeoutJUnitTest.java           |  1 -
 .../acceptance/CacheMaxConnectionJUnitTest.java    |  2 -
 .../acceptance/CacheOperationsJUnitTest.java       |  1 -
 ...TypeToSerializationTypeTranslatorJUnitTest.java |  1 -
 .../protobuf/ProtobufProtocolServiceJUnitTest.java |  1 -
 .../GetAllRequestOperationHandlerJUnitTest.java    | 23 +++++------
 ...tAvailableServersOperationHandlerJUnitTest.java |  2 -
 ...egionNamesRequestOperationHandlerJUnitTest.java | 19 +++++-----
 .../GetRegionRequestOperationHandlerJUnitTest.java | 10 +++--
 .../GetRequestOperationHandlerJUnitTest.java       | 34 ++++++++++-------
 .../PutAllRequestOperationHandlerJUnitTest.java    |  8 ++--
 .../PutRequestOperationHandlerJUnitTest.java       | 32 +++++++++-------
 .../RemoveRequestOperationHandlerJUnitTest.java    | 24 +++++++-----
 .../registry/CodecRegistryJUnitTest.java           |  1 -
 settings.gradle                                    |  1 +
 64 files changed, 246 insertions(+), 248 deletions(-)

diff --git a/geode-protobuf/build.gradle b/geode-client-protocol/build.gradle
similarity index 55%
copy from geode-protobuf/build.gradle
copy to geode-client-protocol/build.gradle
index 7b605be..6d65de2 100644
--- a/geode-protobuf/build.gradle
+++ b/geode-client-protocol/build.gradle
@@ -15,17 +15,9 @@
  * limitations under the License.
  */
 
-apply plugin: 'com.google.protobuf'
-apply plugin: 'idea'
 
-buildscript {
-    repositories {
-        mavenCentral()
-    }
-    dependencies {
-        classpath 'com.google.protobuf:protobuf-gradle-plugin:' + project.'protobuf-gradle-plugin.version'
-    }
-}
+apply plugin: 'java'
+apply plugin: 'idea'
 
 dependencies {
     provided project(':geode-core')
@@ -35,36 +27,4 @@ dependencies {
     testCompile 'org.powermock:powermock-core:' + project.'powermock.version'
     testCompile 'org.powermock:powermock-module-junit4:' + project.'powermock.version'
     testCompile 'org.powermock:powermock-api-mockito:' + project.'powermock.version'
-
-    compile 'com.google.protobuf:protobuf-java:' + project.'protobuf-java.version'
-}
-
-protobuf {
-    protoc {
-        // The artifact spec for the Protobuf Compiler
-        artifact = 'com.google.protobuf:protoc:' + project.'protoc.version'
-    }
-    generatedFilesBaseDir = "$buildDir/generated-src/proto"
 }
-
-sourceSets {
-    main {
-        java {
-            srcDir "$buildDir/generated-src/proto/main/java"
-        }
-    }
-}
-// let IntelliJ know where the generated sources are.
-idea {
-    module {
-        sourceDirs += file("${protobuf.generatedFilesBaseDir}/main/java")
-    }
-}
-
-task zip(type: Zip) {
-    from 'src/main/proto'
-    baseName = "${project.name}-definitions"
-    destinationDir = file("$buildDir/libs")
-}
-
-assemble.dependsOn 'zip'
\ No newline at end of file
diff --git a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/ClientProtocolMessageHandler.java b/geode-client-protocol/src/main/java/org/apache/geode/internal/protocol/ClientProtocolMessageHandler.java
similarity index 100%
rename from geode-protobuf/src/main/java/org/apache/geode/internal/protocol/ClientProtocolMessageHandler.java
rename to geode-client-protocol/src/main/java/org/apache/geode/internal/protocol/ClientProtocolMessageHandler.java
diff --git a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/Failure.java b/geode-client-protocol/src/main/java/org/apache/geode/internal/protocol/Failure.java
similarity index 67%
rename from geode-protobuf/src/main/java/org/apache/geode/internal/protocol/Failure.java
rename to geode-client-protocol/src/main/java/org/apache/geode/internal/protocol/Failure.java
index f390247..e33d4dc 100644
--- a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/Failure.java
+++ b/geode-client-protocol/src/main/java/org/apache/geode/internal/protocol/Failure.java
@@ -17,24 +17,23 @@ package org.apache.geode.internal.protocol;
 import java.util.function.Function;
 
 import org.apache.geode.annotations.Experimental;
-import org.apache.geode.internal.protocol.protobuf.ClientProtocol;
 
 @Experimental
-public class Failure<SuccessType> implements Result<SuccessType> {
-  private final ClientProtocol.ErrorResponse errorResponse;
+public class Failure<SuccessType, FailureType> implements Result<SuccessType, FailureType> {
+  private final FailureType failureType;
 
-  public Failure(ClientProtocol.ErrorResponse errorResponse) {
-    this.errorResponse = errorResponse;
+  private Failure(FailureType failureType) {
+    this.failureType = failureType;
   }
 
-  public static <T> Failure<T> of(ClientProtocol.ErrorResponse errorResponse) {
+  public static <T, V> Failure<T, V> of(V errorResponse) {
     return new Failure<>(errorResponse);
   }
 
   @Override
   public <T> T map(Function<SuccessType, T> successFunction,
-      Function<ClientProtocol.ErrorResponse, T> errorFunction) {
-    return errorFunction.apply(errorResponse);
+      Function<FailureType, T> errorFunction) {
+    return errorFunction.apply(failureType);
   }
 
   @Override
@@ -43,7 +42,7 @@ public class Failure<SuccessType> implements Result<SuccessType> {
   }
 
   @Override
-  public ClientProtocol.ErrorResponse getErrorMessage() {
-    return errorResponse;
+  public FailureType getErrorMessage() {
+    return failureType;
   }
 }
diff --git a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/MessageExecutionContext.java b/geode-client-protocol/src/main/java/org/apache/geode/internal/protocol/MessageExecutionContext.java
similarity index 100%
rename from geode-protobuf/src/main/java/org/apache/geode/internal/protocol/MessageExecutionContext.java
rename to geode-client-protocol/src/main/java/org/apache/geode/internal/protocol/MessageExecutionContext.java
diff --git a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/OperationContext.java b/geode-client-protocol/src/main/java/org/apache/geode/internal/protocol/OperationContext.java
similarity index 57%
rename from geode-protobuf/src/main/java/org/apache/geode/internal/protocol/OperationContext.java
rename to geode-client-protocol/src/main/java/org/apache/geode/internal/protocol/OperationContext.java
index 6e2d636..370d501 100644
--- a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/OperationContext.java
+++ b/geode-client-protocol/src/main/java/org/apache/geode/internal/protocol/OperationContext.java
@@ -19,20 +19,19 @@ import java.util.function.Function;
 
 import org.apache.geode.annotations.Experimental;
 import org.apache.geode.internal.protocol.operations.OperationHandler;
-import org.apache.geode.internal.protocol.protobuf.ClientProtocol;
 import org.apache.geode.security.ResourcePermission;
 
 @Experimental
-public class OperationContext<OperationRequest, OperationResponse> {
-  private final OperationHandler<OperationRequest, OperationResponse> operationHandler;
-  private final Function<ClientProtocol.Request, OperationRequest> fromRequest;
-  private final Function<OperationResponse, ClientProtocol.Response.Builder> toResponse;
-  private final Function<ClientProtocol.ErrorResponse, ClientProtocol.Response.Builder> toErrorResponse;
+public abstract class OperationContext<OperationRequest, OperationResponse, ErrorResponse, ProtocolRequest, ProtocolResponse> {
+  private final OperationHandler<OperationRequest, OperationResponse, ErrorResponse> operationHandler;
+  private final Function<ProtocolRequest, OperationRequest> fromRequest;
+  private final Function<OperationResponse, ProtocolResponse> toResponse;
+  private final Function<ErrorResponse, ProtocolResponse> toErrorResponse;
   private final ResourcePermission accessPermissionRequired;
 
-  public OperationContext(Function<ClientProtocol.Request, OperationRequest> fromRequest,
-      OperationHandler<OperationRequest, OperationResponse> operationHandler,
-      Function<OperationResponse, ClientProtocol.Response.Builder> toResponse,
+  public OperationContext(Function<ProtocolRequest, OperationRequest> fromRequest,
+      OperationHandler<OperationRequest, OperationResponse, ErrorResponse> operationHandler,
+      Function<OperationResponse, ProtocolResponse> toResponse,
       ResourcePermission permissionRequired) {
     this.operationHandler = operationHandler;
     this.fromRequest = fromRequest;
@@ -41,24 +40,21 @@ public class OperationContext<OperationRequest, OperationResponse> {
     accessPermissionRequired = permissionRequired;
   }
 
-  private ClientProtocol.Response.Builder makeErrorBuilder(
-      ClientProtocol.ErrorResponse errorResponse) {
-    return ClientProtocol.Response.newBuilder().setErrorResponse(errorResponse);
-  }
+  protected abstract ProtocolResponse makeErrorBuilder(ErrorResponse errorResponse);
 
-  public OperationHandler<OperationRequest, OperationResponse> getOperationHandler() {
+  public OperationHandler<OperationRequest, OperationResponse, ErrorResponse> getOperationHandler() {
     return operationHandler;
   }
 
-  public Function<ClientProtocol.Request, OperationRequest> getFromRequest() {
+  public Function<ProtocolRequest, OperationRequest> getFromRequest() {
     return fromRequest;
   }
 
-  public Function<OperationResponse, ClientProtocol.Response.Builder> getToResponse() {
+  public Function<OperationResponse, ProtocolResponse> getToResponse() {
     return toResponse;
   }
 
-  public Function<ClientProtocol.ErrorResponse, ClientProtocol.Response.Builder> getToErrorResponse() {
+  public Function<ErrorResponse, ProtocolResponse> getToErrorResponse() {
     return toErrorResponse;
   }
 
diff --git a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/ProtocolErrorCode.java b/geode-client-protocol/src/main/java/org/apache/geode/internal/protocol/ProtocolErrorCode.java
similarity index 100%
rename from geode-protobuf/src/main/java/org/apache/geode/internal/protocol/ProtocolErrorCode.java
rename to geode-client-protocol/src/main/java/org/apache/geode/internal/protocol/ProtocolErrorCode.java
diff --git a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/Result.java b/geode-client-protocol/src/main/java/org/apache/geode/internal/protocol/Result.java
similarity index 77%
rename from geode-protobuf/src/main/java/org/apache/geode/internal/protocol/Result.java
rename to geode-client-protocol/src/main/java/org/apache/geode/internal/protocol/Result.java
index 6a1a3a4..3c0ec90 100644
--- a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/Result.java
+++ b/geode-client-protocol/src/main/java/org/apache/geode/internal/protocol/Result.java
@@ -17,14 +17,12 @@ package org.apache.geode.internal.protocol;
 import java.util.function.Function;
 
 import org.apache.geode.annotations.Experimental;
-import org.apache.geode.internal.protocol.protobuf.ClientProtocol;
 
 @Experimental
-public interface Result<SuccessType> {
-  <T> T map(Function<SuccessType, T> successFunction,
-      Function<ClientProtocol.ErrorResponse, T> errorFunction);
+public interface Result<SuccessType, FailureType> {
+  <T> T map(Function<SuccessType, T> successFunction, Function<FailureType, T> errorFunction);
 
   SuccessType getMessage();
 
-  ClientProtocol.ErrorResponse getErrorMessage();
+  FailureType getErrorMessage();
 }
diff --git a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/Success.java b/geode-client-protocol/src/main/java/org/apache/geode/internal/protocol/Success.java
similarity index 77%
rename from geode-protobuf/src/main/java/org/apache/geode/internal/protocol/Success.java
rename to geode-client-protocol/src/main/java/org/apache/geode/internal/protocol/Success.java
index 1c1e6f9..6b0dda2 100644
--- a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/Success.java
+++ b/geode-client-protocol/src/main/java/org/apache/geode/internal/protocol/Success.java
@@ -17,23 +17,22 @@ package org.apache.geode.internal.protocol;
 import java.util.function.Function;
 
 import org.apache.geode.annotations.Experimental;
-import org.apache.geode.internal.protocol.protobuf.ClientProtocol;
 
 @Experimental
-public class Success<SuccessType> implements Result<SuccessType> {
+public class Success<SuccessType, FailureType> implements Result<SuccessType, FailureType> {
   private final SuccessType successResponse;
 
-  public Success(SuccessType successResponse) {
+  private Success(SuccessType successResponse) {
     this.successResponse = successResponse;
   }
 
-  public static <T> Success<T> of(T result) {
-    return new Success<>(result);
+  public static <T, V> Success<T, V> of(T successResponse) {
+    return new Success<>(successResponse);
   }
 
   @Override
   public <T> T map(Function<SuccessType, T> successFunction,
-      Function<ClientProtocol.ErrorResponse, T> errorFunction) {
+      Function<FailureType, T> errorFunction) {
     return successFunction.apply(successResponse);
   }
 
@@ -43,7 +42,7 @@ public class Success<SuccessType> implements Result<SuccessType> {
   }
 
   @Override
-  public ClientProtocol.ErrorResponse getErrorMessage() {
+  public FailureType getErrorMessage() {
     throw new RuntimeException("This is a not Failure result");
   }
 }
diff --git a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/exception/InvalidProtocolMessageException.java b/geode-client-protocol/src/main/java/org/apache/geode/internal/protocol/exception/InvalidProtocolMessageException.java
similarity index 100%
rename from geode-protobuf/src/main/java/org/apache/geode/internal/protocol/exception/InvalidProtocolMessageException.java
rename to geode-client-protocol/src/main/java/org/apache/geode/internal/protocol/exception/InvalidProtocolMessageException.java
diff --git a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/operations/OperationHandler.java b/geode-client-protocol/src/main/java/org/apache/geode/internal/protocol/operations/OperationHandler.java
similarity index 87%
rename from geode-protobuf/src/main/java/org/apache/geode/internal/protocol/operations/OperationHandler.java
rename to geode-client-protocol/src/main/java/org/apache/geode/internal/protocol/operations/OperationHandler.java
index 286c525..a388166 100644
--- a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/operations/OperationHandler.java
+++ b/geode-client-protocol/src/main/java/org/apache/geode/internal/protocol/operations/OperationHandler.java
@@ -17,7 +17,6 @@ package org.apache.geode.internal.protocol.operations;
 import org.apache.geode.annotations.Experimental;
 import org.apache.geode.internal.protocol.MessageExecutionContext;
 import org.apache.geode.internal.exception.InvalidExecutionContextException;
-import org.apache.geode.internal.protocol.protobuf.ProtobufOpsProcessor;
 import org.apache.geode.internal.protocol.Result;
 import org.apache.geode.internal.serialization.SerializationService;
 
@@ -25,15 +24,14 @@ import org.apache.geode.internal.serialization.SerializationService;
  * This interface is implemented by a object capable of handling request types 'Req' and returning
  * an a response of type 'Resp'
  *
- * See {@link ProtobufOpsProcessor}
  */
 @Experimental
-public interface OperationHandler<Req, Resp> {
+public interface OperationHandler<Req, Resp, ErrorResp> {
   /**
    * Decode the message, deserialize contained values using the serialization service, do the work
    * indicated on the provided cache, and return a response.
    */
-  Result<Resp> process(SerializationService serializationService, Req request,
+  Result<Resp, ErrorResp> process(SerializationService serializationService, Req request,
       MessageExecutionContext messageExecutionContext) throws InvalidExecutionContextException;
 }
 
diff --git a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/security/Authenticator.java b/geode-client-protocol/src/main/java/org/apache/geode/internal/protocol/security/Authenticator.java
similarity index 100%
rename from geode-protobuf/src/main/java/org/apache/geode/internal/protocol/security/Authenticator.java
rename to geode-client-protocol/src/main/java/org/apache/geode/internal/protocol/security/Authenticator.java
diff --git a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/security/Authorizer.java b/geode-client-protocol/src/main/java/org/apache/geode/internal/protocol/security/Authorizer.java
similarity index 100%
rename from geode-protobuf/src/main/java/org/apache/geode/internal/protocol/security/Authorizer.java
rename to geode-client-protocol/src/main/java/org/apache/geode/internal/protocol/security/Authorizer.java
diff --git a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/security/InvalidConfigAuthenticator.java b/geode-client-protocol/src/main/java/org/apache/geode/internal/protocol/security/InvalidConfigAuthenticator.java
similarity index 73%
rename from geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/security/InvalidConfigAuthenticator.java
rename to geode-client-protocol/src/main/java/org/apache/geode/internal/protocol/security/InvalidConfigAuthenticator.java
index bed24bb..5750e13 100644
--- a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/security/InvalidConfigAuthenticator.java
+++ b/geode-client-protocol/src/main/java/org/apache/geode/internal/protocol/security/InvalidConfigAuthenticator.java
@@ -13,21 +13,12 @@
  * the License.
  */
 
-package org.apache.geode.internal.protocol.protobuf.security;
+package org.apache.geode.internal.protocol.security;
 
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-
-import org.apache.geode.internal.protocol.protobuf.BasicTypes;
-import org.apache.geode.internal.protocol.protobuf.ClientProtocol;
-import org.apache.geode.internal.protocol.ProtocolErrorCode;
 import org.apache.logging.log4j.Logger;
 
 import org.apache.geode.internal.logging.LogService;
-import org.apache.geode.internal.protocol.protobuf.security.exception.IncompatibleAuthenticationMechanismsException;
-import org.apache.geode.internal.protocol.security.Authenticator;
-import org.apache.geode.internal.security.SecurityService;
+import org.apache.geode.internal.protocol.security.exception.IncompatibleAuthenticationMechanismsException;
 import org.apache.geode.security.AuthenticationFailedException;
 
 public class InvalidConfigAuthenticator implements Authenticator<Object, Object> {
diff --git a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/security/NoOpAuthenticator.java b/geode-client-protocol/src/main/java/org/apache/geode/internal/protocol/security/NoOpAuthenticator.java
similarity index 89%
rename from geode-protobuf/src/main/java/org/apache/geode/internal/protocol/security/NoOpAuthenticator.java
rename to geode-client-protocol/src/main/java/org/apache/geode/internal/protocol/security/NoOpAuthenticator.java
index 022fa30..55f5add 100644
--- a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/security/NoOpAuthenticator.java
+++ b/geode-client-protocol/src/main/java/org/apache/geode/internal/protocol/security/NoOpAuthenticator.java
@@ -14,11 +14,6 @@
  */
 package org.apache.geode.internal.protocol.security;
 
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-
-import org.apache.geode.internal.security.SecurityService;
 import org.apache.geode.security.AuthenticationFailedException;
 
 /**
diff --git a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/security/NoOpAuthorizer.java b/geode-client-protocol/src/main/java/org/apache/geode/internal/protocol/security/NoOpAuthorizer.java
similarity index 100%
rename from geode-protobuf/src/main/java/org/apache/geode/internal/protocol/security/NoOpAuthorizer.java
rename to geode-client-protocol/src/main/java/org/apache/geode/internal/protocol/security/NoOpAuthorizer.java
diff --git a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/security/SecurityProcessor.java b/geode-client-protocol/src/main/java/org/apache/geode/internal/protocol/security/SecurityProcessor.java
similarity index 100%
rename from geode-protobuf/src/main/java/org/apache/geode/internal/protocol/security/SecurityProcessor.java
rename to geode-client-protocol/src/main/java/org/apache/geode/internal/protocol/security/SecurityProcessor.java
diff --git a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/security/exception/IncompatibleAuthenticationMechanismsException.java b/geode-client-protocol/src/main/java/org/apache/geode/internal/protocol/security/exception/IncompatibleAuthenticationMechanismsException.java
similarity index 93%
rename from geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/security/exception/IncompatibleAuthenticationMechanismsException.java
rename to geode-client-protocol/src/main/java/org/apache/geode/internal/protocol/security/exception/IncompatibleAuthenticationMechanismsException.java
index 1afecb0..e799522 100644
--- a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/security/exception/IncompatibleAuthenticationMechanismsException.java
+++ b/geode-client-protocol/src/main/java/org/apache/geode/internal/protocol/security/exception/IncompatibleAuthenticationMechanismsException.java
@@ -12,7 +12,7 @@
  * or implied. See the License for the specific language governing permissions and limitations under
  * the License.
  */
-package org.apache.geode.internal.protocol.protobuf.security.exception;
+package org.apache.geode.internal.protocol.security.exception;
 
 import org.apache.geode.security.AuthenticationFailedException;
 
diff --git a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/security/processors/AuthorizationSecurityProcessor.java b/geode-client-protocol/src/main/java/org/apache/geode/internal/protocol/security/processors/AuthorizationSecurityProcessor.java
similarity index 100%
rename from geode-protobuf/src/main/java/org/apache/geode/internal/protocol/security/processors/AuthorizationSecurityProcessor.java
rename to geode-client-protocol/src/main/java/org/apache/geode/internal/protocol/security/processors/AuthorizationSecurityProcessor.java
diff --git a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/security/processors/NoAuthenticationSecurityProcessor.java b/geode-client-protocol/src/main/java/org/apache/geode/internal/protocol/security/processors/NoAuthenticationSecurityProcessor.java
similarity index 100%
rename from geode-protobuf/src/main/java/org/apache/geode/internal/protocol/security/processors/NoAuthenticationSecurityProcessor.java
rename to geode-client-protocol/src/main/java/org/apache/geode/internal/protocol/security/processors/NoAuthenticationSecurityProcessor.java
diff --git a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/serializer/ProtocolSerializer.java b/geode-client-protocol/src/main/java/org/apache/geode/internal/protocol/serializer/ProtocolSerializer.java
similarity index 100%
rename from geode-protobuf/src/main/java/org/apache/geode/internal/protocol/serializer/ProtocolSerializer.java
rename to geode-client-protocol/src/main/java/org/apache/geode/internal/protocol/serializer/ProtocolSerializer.java
diff --git a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/statistics/NoOpStatistics.java b/geode-client-protocol/src/main/java/org/apache/geode/internal/protocol/statistics/NoOpStatistics.java
similarity index 100%
rename from geode-protobuf/src/main/java/org/apache/geode/internal/protocol/statistics/NoOpStatistics.java
rename to geode-client-protocol/src/main/java/org/apache/geode/internal/protocol/statistics/NoOpStatistics.java
diff --git a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/statistics/ProtocolClientStatistics.java b/geode-client-protocol/src/main/java/org/apache/geode/internal/protocol/statistics/ProtocolClientStatistics.java
similarity index 100%
rename from geode-protobuf/src/main/java/org/apache/geode/internal/protocol/statistics/ProtocolClientStatistics.java
rename to geode-client-protocol/src/main/java/org/apache/geode/internal/protocol/statistics/ProtocolClientStatistics.java
diff --git a/geode-protobuf/src/main/java/org/apache/geode/internal/serialization/SerializationService.java b/geode-client-protocol/src/main/java/org/apache/geode/internal/serialization/SerializationService.java
similarity index 100%
rename from geode-protobuf/src/main/java/org/apache/geode/internal/serialization/SerializationService.java
rename to geode-client-protocol/src/main/java/org/apache/geode/internal/serialization/SerializationService.java
diff --git a/geode-protobuf/src/main/java/org/apache/geode/internal/serialization/SerializationType.java b/geode-client-protocol/src/main/java/org/apache/geode/internal/serialization/SerializationType.java
similarity index 100%
rename from geode-protobuf/src/main/java/org/apache/geode/internal/serialization/SerializationType.java
rename to geode-client-protocol/src/main/java/org/apache/geode/internal/serialization/SerializationType.java
diff --git a/geode-protobuf/src/main/java/org/apache/geode/internal/serialization/TypeCodec.java b/geode-client-protocol/src/main/java/org/apache/geode/internal/serialization/TypeCodec.java
similarity index 100%
rename from geode-protobuf/src/main/java/org/apache/geode/internal/serialization/TypeCodec.java
rename to geode-client-protocol/src/main/java/org/apache/geode/internal/serialization/TypeCodec.java
diff --git a/geode-protobuf/src/main/java/org/apache/geode/internal/serialization/codec/JSONCodec.java b/geode-client-protocol/src/main/java/org/apache/geode/internal/serialization/codec/JSONCodec.java
similarity index 100%
rename from geode-protobuf/src/main/java/org/apache/geode/internal/serialization/codec/JSONCodec.java
rename to geode-client-protocol/src/main/java/org/apache/geode/internal/serialization/codec/JSONCodec.java
diff --git a/geode-protobuf/src/main/java/org/apache/geode/internal/serialization/exception/UnsupportedEncodingTypeException.java b/geode-client-protocol/src/main/java/org/apache/geode/internal/serialization/exception/UnsupportedEncodingTypeException.java
similarity index 100%
rename from geode-protobuf/src/main/java/org/apache/geode/internal/serialization/exception/UnsupportedEncodingTypeException.java
rename to geode-client-protocol/src/main/java/org/apache/geode/internal/serialization/exception/UnsupportedEncodingTypeException.java
diff --git a/geode-protobuf/src/main/java/org/apache/geode/internal/serialization/registry/SerializationCodecRegistry.java b/geode-client-protocol/src/main/java/org/apache/geode/internal/serialization/registry/SerializationCodecRegistry.java
similarity index 100%
rename from geode-protobuf/src/main/java/org/apache/geode/internal/serialization/registry/SerializationCodecRegistry.java
rename to geode-client-protocol/src/main/java/org/apache/geode/internal/serialization/registry/SerializationCodecRegistry.java
diff --git a/geode-protobuf/src/main/java/org/apache/geode/internal/serialization/registry/exception/CodecAlreadyRegisteredForTypeException.java b/geode-client-protocol/src/main/java/org/apache/geode/internal/serialization/registry/exception/CodecAlreadyRegisteredForTypeException.java
similarity index 100%
rename from geode-protobuf/src/main/java/org/apache/geode/internal/serialization/registry/exception/CodecAlreadyRegisteredForTypeException.java
rename to geode-client-protocol/src/main/java/org/apache/geode/internal/serialization/registry/exception/CodecAlreadyRegisteredForTypeException.java
diff --git a/geode-protobuf/src/main/java/org/apache/geode/internal/serialization/registry/exception/CodecNotRegisteredForTypeException.java b/geode-client-protocol/src/main/java/org/apache/geode/internal/serialization/registry/exception/CodecNotRegisteredForTypeException.java
similarity index 100%
rename from geode-protobuf/src/main/java/org/apache/geode/internal/serialization/registry/exception/CodecNotRegisteredForTypeException.java
rename to geode-client-protocol/src/main/java/org/apache/geode/internal/serialization/registry/exception/CodecNotRegisteredForTypeException.java
diff --git a/geode-protobuf/build.gradle b/geode-protobuf/build.gradle
index 7b605be..7b13a09 100644
--- a/geode-protobuf/build.gradle
+++ b/geode-protobuf/build.gradle
@@ -28,6 +28,7 @@ buildscript {
 }
 
 dependencies {
+    provided project(':geode-client-protocol')
     provided project(':geode-core')
     testCompile project(':geode-junit')
     testCompile files(project(':geode-core').sourceSets.test.output)
diff --git a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/EncodingTypeTranslator.java b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/EncodingTypeTranslator.java
similarity index 92%
rename from geode-protobuf/src/main/java/org/apache/geode/internal/protocol/EncodingTypeTranslator.java
rename to geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/EncodingTypeTranslator.java
index 5801292..5ec3908 100644
--- a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/EncodingTypeTranslator.java
+++ b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/EncodingTypeTranslator.java
@@ -12,12 +12,13 @@
  * or implied. See the License for the specific language governing permissions and limitations under
  * the License.
  */
-package org.apache.geode.internal.protocol;
+package org.apache.geode.internal.protocol.protobuf;
+
+import static org.apache.geode.internal.protocol.protobuf.BasicTypes.EncodingType.JSON;
 
 import java.util.HashMap;
 
 import org.apache.geode.annotations.Experimental;
-import org.apache.geode.internal.protocol.protobuf.BasicTypes;
 import org.apache.geode.pdx.JSONFormatter;
 import org.apache.geode.pdx.PdxInstance;
 import org.apache.geode.internal.serialization.SerializationType;
@@ -32,7 +33,7 @@ public abstract class EncodingTypeTranslator {
 
   private static HashMap<Class, BasicTypes.EncodingType> intializeTypeMap() {
     HashMap<Class, BasicTypes.EncodingType> result = new HashMap<>();
-    result.put(PdxInstance.class, BasicTypes.EncodingType.JSON);
+    result.put(PdxInstance.class, JSON);
     return result;
   }
 
@@ -52,7 +53,7 @@ public abstract class EncodingTypeTranslator {
     if (resultValue instanceof PdxInstance) {
       String pdxClassName = ((PdxInstance) resultValue).getClassName();
       if (pdxClassName.equals(JSONFormatter.JSON_CLASSNAME)) {
-        return BasicTypes.EncodingType.JSON;
+        return JSON;
       }
     }
 
diff --git a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/ProtobufOperationContext.java b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/ProtobufOperationContext.java
new file mode 100644
index 0000000..0c65ce7
--- /dev/null
+++ b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/ProtobufOperationContext.java
@@ -0,0 +1,39 @@
+/*
+ * 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;
+
+import java.util.function.Function;
+
+import org.apache.geode.internal.protocol.OperationContext;
+import org.apache.geode.internal.protocol.operations.OperationHandler;
+import org.apache.geode.internal.protocol.protobuf.operations.security.AuthenticationRequestOperationHandler;
+import org.apache.geode.security.ResourcePermission;
+
+public class ProtobufOperationContext<OperationRequest, OperationResponse> extends
+    OperationContext<OperationRequest, OperationResponse, ClientProtocol.ErrorResponse, ClientProtocol.Request, ClientProtocol.Response.Builder> {
+
+  public ProtobufOperationContext(Function<ClientProtocol.Request, OperationRequest> fromRequest,
+      OperationHandler<OperationRequest, OperationResponse, ClientProtocol.ErrorResponse> operationHandler,
+      Function<OperationResponse, ClientProtocol.Response.Builder> toResponse,
+      ResourcePermission permissionRequired) {
+    super(fromRequest, operationHandler, toResponse, permissionRequired);
+  }
+
+  @Override
+  protected ClientProtocol.Response.Builder makeErrorBuilder(
+      ClientProtocol.ErrorResponse errorResponse) {
+    return ClientProtocol.Response.newBuilder().setErrorResponse(errorResponse);
+  }
+}
diff --git a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/ProtobufProtocolService.java b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/ProtobufProtocolService.java
index 4d8a100..6c63042 100644
--- a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/ProtobufProtocolService.java
+++ b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/ProtobufProtocolService.java
@@ -22,7 +22,7 @@ import org.apache.geode.internal.cache.client.protocol.ClientProtocolService;
 import org.apache.geode.internal.protocol.protobuf.statistics.ProtobufClientStatisticsImpl;
 import org.apache.geode.internal.protocol.security.Authenticator;
 import org.apache.geode.internal.protocol.security.Authorizer;
-import org.apache.geode.internal.protocol.security.SecurityLookupService;
+import org.apache.geode.internal.protocol.protobuf.security.ProtobufSecurityLookupService;
 import org.apache.geode.internal.protocol.statistics.NoOpStatistics;
 import org.apache.geode.internal.protocol.statistics.ProtocolClientStatistics;
 import org.apache.geode.internal.security.SecurityService;
@@ -30,7 +30,8 @@ import org.apache.geode.internal.security.SecurityService;
 public class ProtobufProtocolService implements ClientProtocolService {
   private volatile ProtocolClientStatistics statistics;
   private final ProtobufStreamProcessor protobufStreamProcessor = new ProtobufStreamProcessor();
-  private final SecurityLookupService securityLookupService = new SecurityLookupService();
+  private final ProtobufSecurityLookupService protobufSecurityLookupService =
+      new ProtobufSecurityLookupService();
 
   @Override
   public synchronized void initializeStatistics(String statisticsName, StatisticsFactory factory) {
@@ -44,11 +45,12 @@ public class ProtobufProtocolService implements ClientProtocolService {
       SecurityService securityService) {
     assert (statistics != null);
 
-    Authenticator authenticator = securityLookupService.lookupAuthenticator(securityService);
-    Authorizer authorizer = securityLookupService.lookupAuthorizer(securityService);
+    Authenticator authenticator =
+        protobufSecurityLookupService.lookupAuthenticator(securityService);
+    Authorizer authorizer = protobufSecurityLookupService.lookupAuthorizer(securityService);
 
     return new ProtobufCachePipeline(protobufStreamProcessor, getStatistics(), cache, authenticator,
-        authorizer, securityLookupService.lookupProcessor(securityService));
+        authorizer, protobufSecurityLookupService.lookupProcessor(securityService));
   }
 
   /**
diff --git a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/ProtobufSerializationService.java b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/ProtobufSerializationService.java
index f7281fd..8b8dbb3 100644
--- a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/ProtobufSerializationService.java
+++ b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/ProtobufSerializationService.java
@@ -15,7 +15,6 @@
 package org.apache.geode.internal.protocol.protobuf;
 
 import org.apache.geode.annotations.Experimental;
-import org.apache.geode.internal.protocol.EncodingTypeTranslator;
 import org.apache.geode.internal.serialization.SerializationService;
 import org.apache.geode.internal.serialization.SerializationType;
 import org.apache.geode.internal.serialization.TypeCodec;
diff --git a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/operations/GetAllRequestOperationHandler.java b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/operations/GetAllRequestOperationHandler.java
index c91c9e1..f697a68 100644
--- a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/operations/GetAllRequestOperationHandler.java
+++ b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/operations/GetAllRequestOperationHandler.java
@@ -30,6 +30,7 @@ import org.apache.geode.internal.exception.InvalidExecutionContextException;
 import org.apache.geode.internal.logging.LogService;
 import org.apache.geode.internal.protocol.operations.OperationHandler;
 import org.apache.geode.internal.protocol.protobuf.BasicTypes;
+import org.apache.geode.internal.protocol.protobuf.ClientProtocol;
 import org.apache.geode.internal.protocol.protobuf.RegionAPI;
 import org.apache.geode.internal.protocol.Failure;
 import org.apache.geode.internal.protocol.ProtocolErrorCode;
@@ -44,14 +45,14 @@ import org.apache.geode.internal.serialization.registry.exception.CodecNotRegist
 import static org.apache.geode.internal.protocol.ProtocolErrorCode.*;
 
 @Experimental
-public class GetAllRequestOperationHandler
-    implements OperationHandler<RegionAPI.GetAllRequest, RegionAPI.GetAllResponse> {
+public class GetAllRequestOperationHandler implements
+    OperationHandler<RegionAPI.GetAllRequest, RegionAPI.GetAllResponse, ClientProtocol.ErrorResponse> {
   private static final Logger logger = LogService.getLogger();
 
   @Override
-  public Result<RegionAPI.GetAllResponse> process(SerializationService serializationService,
-      RegionAPI.GetAllRequest request, MessageExecutionContext messageExecutionContext)
-      throws InvalidExecutionContextException {
+  public Result<RegionAPI.GetAllResponse, ClientProtocol.ErrorResponse> process(
+      SerializationService serializationService, RegionAPI.GetAllRequest request,
+      MessageExecutionContext messageExecutionContext) throws InvalidExecutionContextException {
     String regionName = request.getRegionName();
     Region region = messageExecutionContext.getCache().getRegion(regionName);
     if (region == null) {
diff --git a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/operations/GetAvailableServersOperationHandler.java b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/operations/GetAvailableServersOperationHandler.java
index f15e94c..87842ae 100644
--- a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/operations/GetAvailableServersOperationHandler.java
+++ b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/operations/GetAvailableServersOperationHandler.java
@@ -26,16 +26,17 @@ import org.apache.geode.internal.exception.InvalidExecutionContextException;
 import org.apache.geode.internal.protocol.operations.OperationHandler;
 import org.apache.geode.internal.protocol.protobuf.BasicTypes;
 import org.apache.geode.internal.protocol.Result;
+import org.apache.geode.internal.protocol.protobuf.ClientProtocol;
 import org.apache.geode.internal.protocol.protobuf.ServerAPI;
 import org.apache.geode.internal.protocol.Success;
 import org.apache.geode.internal.serialization.SerializationService;
 
 @Experimental
 public class GetAvailableServersOperationHandler implements
-    OperationHandler<ServerAPI.GetAvailableServersRequest, ServerAPI.GetAvailableServersResponse> {
+    OperationHandler<ServerAPI.GetAvailableServersRequest, ServerAPI.GetAvailableServersResponse, ClientProtocol.ErrorResponse> {
 
   @Override
-  public Result<ServerAPI.GetAvailableServersResponse> process(
+  public Result<ServerAPI.GetAvailableServersResponse, ClientProtocol.ErrorResponse> process(
       SerializationService serializationService, ServerAPI.GetAvailableServersRequest request,
       MessageExecutionContext messageExecutionContext) throws InvalidExecutionContextException {
 
diff --git a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/operations/GetRegionNamesRequestOperationHandler.java b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/operations/GetRegionNamesRequestOperationHandler.java
index 7e7cf71..f3f6007 100644
--- a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/operations/GetRegionNamesRequestOperationHandler.java
+++ b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/operations/GetRegionNamesRequestOperationHandler.java
@@ -21,6 +21,7 @@ import org.apache.geode.cache.Region;
 import org.apache.geode.internal.protocol.MessageExecutionContext;
 import org.apache.geode.internal.exception.InvalidExecutionContextException;
 import org.apache.geode.internal.protocol.operations.OperationHandler;
+import org.apache.geode.internal.protocol.protobuf.ClientProtocol;
 import org.apache.geode.internal.protocol.protobuf.RegionAPI;
 import org.apache.geode.internal.protocol.Result;
 import org.apache.geode.internal.protocol.Success;
@@ -28,13 +29,13 @@ import org.apache.geode.internal.protocol.protobuf.utilities.ProtobufResponseUti
 import org.apache.geode.internal.serialization.SerializationService;
 
 @Experimental
-public class GetRegionNamesRequestOperationHandler
-    implements OperationHandler<RegionAPI.GetRegionNamesRequest, RegionAPI.GetRegionNamesResponse> {
+public class GetRegionNamesRequestOperationHandler implements
+    OperationHandler<RegionAPI.GetRegionNamesRequest, RegionAPI.GetRegionNamesResponse, ClientProtocol.ErrorResponse> {
 
   @Override
-  public Result<RegionAPI.GetRegionNamesResponse> process(SerializationService serializationService,
-      RegionAPI.GetRegionNamesRequest request, MessageExecutionContext messageExecutionContext)
-      throws InvalidExecutionContextException {
+  public Result<RegionAPI.GetRegionNamesResponse, ClientProtocol.ErrorResponse> process(
+      SerializationService serializationService, RegionAPI.GetRegionNamesRequest request,
+      MessageExecutionContext messageExecutionContext) throws InvalidExecutionContextException {
     Set<Region<?, ?>> regions = messageExecutionContext.getCache().rootRegions();
     return Success.of(ProtobufResponseUtilities.createGetRegionNamesResponse(regions));
   }
diff --git a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/operations/GetRegionRequestOperationHandler.java b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/operations/GetRegionRequestOperationHandler.java
index f602d6a..1e320ff 100644
--- a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/operations/GetRegionRequestOperationHandler.java
+++ b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/operations/GetRegionRequestOperationHandler.java
@@ -24,6 +24,7 @@ import org.apache.geode.internal.logging.LogService;
 import org.apache.geode.internal.protocol.protobuf.BasicTypes;
 import org.apache.geode.internal.protocol.operations.OperationHandler;
 import org.apache.geode.internal.protocol.Failure;
+import org.apache.geode.internal.protocol.protobuf.ClientProtocol;
 import org.apache.geode.internal.protocol.protobuf.RegionAPI;
 import org.apache.geode.internal.protocol.Result;
 import org.apache.geode.internal.protocol.Success;
@@ -34,14 +35,14 @@ import org.apache.geode.internal.serialization.SerializationService;
 import static org.apache.geode.internal.protocol.ProtocolErrorCode.*;
 
 @Experimental
-public class GetRegionRequestOperationHandler
-    implements OperationHandler<RegionAPI.GetRegionRequest, RegionAPI.GetRegionResponse> {
+public class GetRegionRequestOperationHandler implements
+    OperationHandler<RegionAPI.GetRegionRequest, RegionAPI.GetRegionResponse, ClientProtocol.ErrorResponse> {
   private static final Logger logger = LogService.getLogger();
 
   @Override
-  public Result<RegionAPI.GetRegionResponse> process(SerializationService serializationService,
-      RegionAPI.GetRegionRequest request, MessageExecutionContext messageExecutionContext)
-      throws InvalidExecutionContextException {
+  public Result<RegionAPI.GetRegionResponse, ClientProtocol.ErrorResponse> process(
+      SerializationService serializationService, RegionAPI.GetRegionRequest request,
+      MessageExecutionContext messageExecutionContext) throws InvalidExecutionContextException {
     String regionName = request.getRegionName();
 
     Region region = messageExecutionContext.getCache().getRegion(regionName);
diff --git a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/operations/GetRequestOperationHandler.java b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/operations/GetRequestOperationHandler.java
index a67bdc9..ec43bee 100644
--- a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/operations/GetRequestOperationHandler.java
+++ b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/operations/GetRequestOperationHandler.java
@@ -24,6 +24,7 @@ import org.apache.geode.internal.logging.LogService;
 import org.apache.geode.internal.protocol.operations.OperationHandler;
 import org.apache.geode.internal.protocol.protobuf.BasicTypes;
 import org.apache.geode.internal.protocol.Failure;
+import org.apache.geode.internal.protocol.protobuf.ClientProtocol;
 import org.apache.geode.internal.protocol.protobuf.RegionAPI;
 import org.apache.geode.internal.protocol.Result;
 import org.apache.geode.internal.protocol.Success;
@@ -36,14 +37,14 @@ import org.apache.geode.internal.serialization.registry.exception.CodecNotRegist
 import static org.apache.geode.internal.protocol.ProtocolErrorCode.*;
 
 @Experimental
-public class GetRequestOperationHandler
-    implements OperationHandler<RegionAPI.GetRequest, RegionAPI.GetResponse> {
+public class GetRequestOperationHandler implements
+    OperationHandler<RegionAPI.GetRequest, RegionAPI.GetResponse, ClientProtocol.ErrorResponse> {
   private static final Logger logger = LogService.getLogger();
 
   @Override
-  public Result<RegionAPI.GetResponse> process(SerializationService serializationService,
-      RegionAPI.GetRequest request, MessageExecutionContext messageExecutionContext)
-      throws InvalidExecutionContextException {
+  public Result<RegionAPI.GetResponse, ClientProtocol.ErrorResponse> process(
+      SerializationService serializationService, RegionAPI.GetRequest request,
+      MessageExecutionContext messageExecutionContext) throws InvalidExecutionContextException {
     String regionName = request.getRegionName();
     Region region = messageExecutionContext.getCache().getRegion(regionName);
     if (region == null) {
diff --git a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/operations/PutAllRequestOperationHandler.java b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/operations/PutAllRequestOperationHandler.java
index b085370..6a1b12a 100644
--- a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/operations/PutAllRequestOperationHandler.java
+++ b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/operations/PutAllRequestOperationHandler.java
@@ -28,6 +28,7 @@ import org.apache.geode.internal.protocol.operations.OperationHandler;
 import org.apache.geode.internal.protocol.protobuf.BasicTypes;
 import org.apache.geode.internal.protocol.Failure;
 import org.apache.geode.internal.protocol.ProtocolErrorCode;
+import org.apache.geode.internal.protocol.protobuf.ClientProtocol;
 import org.apache.geode.internal.protocol.protobuf.RegionAPI;
 import org.apache.geode.internal.protocol.Result;
 import org.apache.geode.internal.protocol.Success;
@@ -40,14 +41,14 @@ import org.apache.geode.internal.serialization.registry.exception.CodecNotRegist
 import static org.apache.geode.internal.protocol.ProtocolErrorCode.*;
 
 @Experimental
-public class PutAllRequestOperationHandler
-    implements OperationHandler<RegionAPI.PutAllRequest, RegionAPI.PutAllResponse> {
+public class PutAllRequestOperationHandler implements
+    OperationHandler<RegionAPI.PutAllRequest, RegionAPI.PutAllResponse, ClientProtocol.ErrorResponse> {
   private static final Logger logger = LogManager.getLogger();
 
   @Override
-  public Result<RegionAPI.PutAllResponse> process(SerializationService serializationService,
-      RegionAPI.PutAllRequest putAllRequest, MessageExecutionContext messageExecutionContext)
-      throws InvalidExecutionContextException {
+  public Result<RegionAPI.PutAllResponse, ClientProtocol.ErrorResponse> process(
+      SerializationService serializationService, RegionAPI.PutAllRequest putAllRequest,
+      MessageExecutionContext messageExecutionContext) throws InvalidExecutionContextException {
     String regionName = putAllRequest.getRegionName();
     Region region = messageExecutionContext.getCache().getRegion(regionName);
 
diff --git a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/operations/PutRequestOperationHandler.java b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/operations/PutRequestOperationHandler.java
index 345f829..59d4519 100644
--- a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/operations/PutRequestOperationHandler.java
+++ b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/operations/PutRequestOperationHandler.java
@@ -24,6 +24,7 @@ import org.apache.geode.internal.logging.LogService;
 import org.apache.geode.internal.protocol.operations.OperationHandler;
 import org.apache.geode.internal.protocol.protobuf.BasicTypes;
 import org.apache.geode.internal.protocol.Failure;
+import org.apache.geode.internal.protocol.protobuf.ClientProtocol;
 import org.apache.geode.internal.protocol.protobuf.RegionAPI;
 import org.apache.geode.internal.protocol.Result;
 import org.apache.geode.internal.protocol.Success;
@@ -36,14 +37,14 @@ import org.apache.geode.internal.serialization.registry.exception.CodecNotRegist
 import static org.apache.geode.internal.protocol.ProtocolErrorCode.*;
 
 @Experimental
-public class PutRequestOperationHandler
-    implements OperationHandler<RegionAPI.PutRequest, RegionAPI.PutResponse> {
+public class PutRequestOperationHandler implements
+    OperationHandler<RegionAPI.PutRequest, RegionAPI.PutResponse, ClientProtocol.ErrorResponse> {
   private static final Logger logger = LogService.getLogger();
 
   @Override
-  public Result<RegionAPI.PutResponse> process(SerializationService serializationService,
-      RegionAPI.PutRequest request, MessageExecutionContext messageExecutionContext)
-      throws InvalidExecutionContextException {
+  public Result<RegionAPI.PutResponse, ClientProtocol.ErrorResponse> process(
+      SerializationService serializationService, RegionAPI.PutRequest request,
+      MessageExecutionContext messageExecutionContext) throws InvalidExecutionContextException {
     String regionName = request.getRegionName();
     Region region = messageExecutionContext.getCache().getRegion(regionName);
     if (region == null) {
diff --git a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/operations/RemoveRequestOperationHandler.java b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/operations/RemoveRequestOperationHandler.java
index 2278f78..9c50f5c 100644
--- a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/operations/RemoveRequestOperationHandler.java
+++ b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/operations/RemoveRequestOperationHandler.java
@@ -23,6 +23,7 @@ import org.apache.geode.internal.protocol.MessageExecutionContext;
 import org.apache.geode.internal.exception.InvalidExecutionContextException;
 import org.apache.geode.internal.protocol.operations.OperationHandler;
 import org.apache.geode.internal.protocol.Failure;
+import org.apache.geode.internal.protocol.protobuf.ClientProtocol;
 import org.apache.geode.internal.protocol.protobuf.RegionAPI;
 import org.apache.geode.internal.protocol.Result;
 import org.apache.geode.internal.protocol.Success;
@@ -35,14 +36,14 @@ import org.apache.geode.internal.serialization.registry.exception.CodecNotRegist
 import static org.apache.geode.internal.protocol.ProtocolErrorCode.*;
 
 @Experimental
-public class RemoveRequestOperationHandler
-    implements OperationHandler<RegionAPI.RemoveRequest, RegionAPI.RemoveResponse> {
+public class RemoveRequestOperationHandler implements
+    OperationHandler<RegionAPI.RemoveRequest, RegionAPI.RemoveResponse, ClientProtocol.ErrorResponse> {
   private static final Logger logger = LogManager.getLogger();
 
   @Override
-  public Result<RegionAPI.RemoveResponse> process(SerializationService serializationService,
-      RegionAPI.RemoveRequest request, MessageExecutionContext messageExecutionContext)
-      throws InvalidExecutionContextException {
+  public Result<RegionAPI.RemoveResponse, ClientProtocol.ErrorResponse> process(
+      SerializationService serializationService, RegionAPI.RemoveRequest request,
+      MessageExecutionContext messageExecutionContext) throws InvalidExecutionContextException {
 
     String regionName = request.getRegionName();
     Region region = messageExecutionContext.getCache().getRegion(regionName);
diff --git a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/operations/security/AuthenticationRequestOperationHandler.java b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/operations/security/AuthenticationRequestOperationHandler.java
index ffc3c04..876e845 100644
--- a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/operations/security/AuthenticationRequestOperationHandler.java
+++ b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/operations/security/AuthenticationRequestOperationHandler.java
@@ -29,18 +29,18 @@ import org.apache.geode.internal.protocol.operations.OperationHandler;
 import org.apache.geode.internal.protocol.protobuf.AuthenticationAPI;
 import org.apache.geode.internal.protocol.protobuf.BasicTypes;
 import org.apache.geode.internal.protocol.protobuf.ClientProtocol;
-import org.apache.geode.internal.protocol.protobuf.security.exception.IncompatibleAuthenticationMechanismsException;
+import org.apache.geode.internal.protocol.security.exception.IncompatibleAuthenticationMechanismsException;
 import org.apache.geode.internal.protocol.security.processors.AuthorizationSecurityProcessor;
 import org.apache.geode.internal.protocol.security.Authenticator;
 import org.apache.geode.internal.serialization.SerializationService;
 import org.apache.geode.security.AuthenticationFailedException;
 
 public class AuthenticationRequestOperationHandler implements
-    OperationHandler<AuthenticationAPI.AuthenticationRequest, AuthenticationAPI.AuthenticationResponse> {
+    OperationHandler<AuthenticationAPI.AuthenticationRequest, AuthenticationAPI.AuthenticationResponse, ClientProtocol.ErrorResponse> {
   private static final Logger logger = LogManager.getLogger();
 
   @Override
-  public Result<AuthenticationAPI.AuthenticationResponse> process(
+  public Result<AuthenticationAPI.AuthenticationResponse, ClientProtocol.ErrorResponse> process(
       SerializationService serializationService, AuthenticationAPI.AuthenticationRequest request,
       MessageExecutionContext messageExecutionContext) throws InvalidExecutionContextException {
 
diff --git a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/registry/ProtobufOperationContextRegistry.java b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/registry/ProtobufOperationContextRegistry.java
index 757dd44..6fd228d 100644
--- a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/registry/ProtobufOperationContextRegistry.java
+++ b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/registry/ProtobufOperationContextRegistry.java
@@ -21,7 +21,7 @@ import java.util.concurrent.ConcurrentHashMap;
 import org.apache.geode.annotations.Experimental;
 import org.apache.geode.internal.protocol.protobuf.ClientProtocol;
 import org.apache.geode.internal.protocol.protobuf.ClientProtocol.Request.RequestAPICase;
-import org.apache.geode.internal.protocol.OperationContext;
+import org.apache.geode.internal.protocol.protobuf.ProtobufOperationContext;
 import org.apache.geode.internal.protocol.protobuf.operations.GetAllRequestOperationHandler;
 import org.apache.geode.internal.protocol.protobuf.operations.GetAvailableServersOperationHandler;
 import org.apache.geode.internal.protocol.protobuf.operations.GetRegionNamesRequestOperationHandler;
@@ -35,75 +35,76 @@ import org.apache.geode.security.ResourcePermission;
 
 @Experimental
 public class ProtobufOperationContextRegistry {
-  private Map<RequestAPICase, OperationContext> operationContexts = new ConcurrentHashMap<>();
+  private Map<RequestAPICase, ProtobufOperationContext> operationContexts =
+      new ConcurrentHashMap<>();
 
   public ProtobufOperationContextRegistry() {
     addContexts();
   }
 
-  public OperationContext getOperationContext(RequestAPICase apiCase) {
+  public ProtobufOperationContext getOperationContext(RequestAPICase apiCase) {
     return operationContexts.get(apiCase);
   }
 
   private void addContexts() {
     operationContexts.put(RequestAPICase.AUTHENTICATIONREQUEST,
-        new OperationContext<>(ClientProtocol.Request::getAuthenticationRequest,
+        new ProtobufOperationContext<>(ClientProtocol.Request::getAuthenticationRequest,
             new AuthenticationRequestOperationHandler(),
             opsResp -> ClientProtocol.Response.newBuilder().setAuthenticationResponse(opsResp),
             new ResourcePermission(ResourcePermission.Resource.DATA,
                 ResourcePermission.Operation.READ)));
 
     operationContexts.put(RequestAPICase.GETREQUEST,
-        new OperationContext<>(ClientProtocol.Request::getGetRequest,
+        new ProtobufOperationContext<>(ClientProtocol.Request::getGetRequest,
             new GetRequestOperationHandler(),
             opsResp -> ClientProtocol.Response.newBuilder().setGetResponse(opsResp),
             new ResourcePermission(ResourcePermission.Resource.DATA,
                 ResourcePermission.Operation.READ)));
 
     operationContexts.put(RequestAPICase.GETALLREQUEST,
-        new OperationContext<>(ClientProtocol.Request::getGetAllRequest,
+        new ProtobufOperationContext<>(ClientProtocol.Request::getGetAllRequest,
             new GetAllRequestOperationHandler(),
             opsResp -> ClientProtocol.Response.newBuilder().setGetAllResponse(opsResp),
             new ResourcePermission(ResourcePermission.Resource.DATA,
                 ResourcePermission.Operation.READ)));
 
     operationContexts.put(RequestAPICase.PUTREQUEST,
-        new OperationContext<>(ClientProtocol.Request::getPutRequest,
+        new ProtobufOperationContext<>(ClientProtocol.Request::getPutRequest,
             new PutRequestOperationHandler(),
             opsResp -> ClientProtocol.Response.newBuilder().setPutResponse(opsResp),
             new ResourcePermission(ResourcePermission.Resource.DATA,
                 ResourcePermission.Operation.WRITE)));
 
     operationContexts.put(RequestAPICase.PUTALLREQUEST,
-        new OperationContext<>(ClientProtocol.Request::getPutAllRequest,
+        new ProtobufOperationContext<>(ClientProtocol.Request::getPutAllRequest,
             new PutAllRequestOperationHandler(),
             opsResp -> ClientProtocol.Response.newBuilder().setPutAllResponse(opsResp),
             new ResourcePermission(ResourcePermission.Resource.DATA,
                 ResourcePermission.Operation.WRITE)));
 
     operationContexts.put(RequestAPICase.REMOVEREQUEST,
-        new OperationContext<>(ClientProtocol.Request::getRemoveRequest,
+        new ProtobufOperationContext<>(ClientProtocol.Request::getRemoveRequest,
             new RemoveRequestOperationHandler(),
             opsResp -> ClientProtocol.Response.newBuilder().setRemoveResponse(opsResp),
             new ResourcePermission(ResourcePermission.Resource.DATA,
                 ResourcePermission.Operation.WRITE)));
 
     operationContexts.put(RequestAPICase.GETREGIONNAMESREQUEST,
-        new OperationContext<>(ClientProtocol.Request::getGetRegionNamesRequest,
+        new ProtobufOperationContext<>(ClientProtocol.Request::getGetRegionNamesRequest,
             new GetRegionNamesRequestOperationHandler(),
             opsResp -> ClientProtocol.Response.newBuilder().setGetRegionNamesResponse(opsResp),
             new ResourcePermission(ResourcePermission.Resource.DATA,
                 ResourcePermission.Operation.READ)));
 
     operationContexts.put(RequestAPICase.GETREGIONREQUEST,
-        new OperationContext<>(ClientProtocol.Request::getGetRegionRequest,
+        new ProtobufOperationContext<>(ClientProtocol.Request::getGetRegionRequest,
             new GetRegionRequestOperationHandler(),
             opsResp -> ClientProtocol.Response.newBuilder().setGetRegionResponse(opsResp),
             new ResourcePermission(ResourcePermission.Resource.DATA,
                 ResourcePermission.Operation.READ)));
 
     operationContexts.put(RequestAPICase.GETAVAILABLESERVERSREQUEST,
-        new OperationContext<>(ClientProtocol.Request::getGetAvailableServersRequest,
+        new ProtobufOperationContext<>(ClientProtocol.Request::getGetAvailableServersRequest,
             new GetAvailableServersOperationHandler(),
             opsResp -> ClientProtocol.Response.newBuilder().setGetAvailableServersResponse(opsResp),
             new ResourcePermission(ResourcePermission.Resource.CLUSTER,
diff --git a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/security/SecurityLookupService.java b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/security/ProtobufSecurityLookupService.java
similarity index 86%
rename from geode-protobuf/src/main/java/org/apache/geode/internal/protocol/security/SecurityLookupService.java
rename to geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/security/ProtobufSecurityLookupService.java
index c4b54b0..f19c763 100644
--- a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/security/SecurityLookupService.java
+++ b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/security/ProtobufSecurityLookupService.java
@@ -12,21 +12,24 @@
  * or implied. See the License for the specific language governing permissions and limitations under
  * the License.
  */
-package org.apache.geode.internal.protocol.security;
+package org.apache.geode.internal.protocol.protobuf.security;
 
-import org.apache.geode.internal.protocol.protobuf.security.InvalidConfigAuthenticator;
-import org.apache.geode.internal.protocol.protobuf.security.ProtobufShiroAuthenticator;
-import org.apache.geode.internal.protocol.protobuf.security.ProtobufShiroAuthorizer;
 import org.apache.geode.internal.protocol.protobuf.security.processors.AuthenticationSecurityProcessor;
+import org.apache.geode.internal.protocol.security.Authenticator;
+import org.apache.geode.internal.protocol.security.Authorizer;
+import org.apache.geode.internal.protocol.security.InvalidConfigAuthenticator;
+import org.apache.geode.internal.protocol.security.NoOpAuthenticator;
+import org.apache.geode.internal.protocol.security.NoOpAuthorizer;
+import org.apache.geode.internal.protocol.security.SecurityProcessor;
 import org.apache.geode.internal.protocol.security.processors.NoAuthenticationSecurityProcessor;
 import org.apache.geode.internal.security.SecurityService;
 
-public class SecurityLookupService {
+public class ProtobufSecurityLookupService {
   private final Authenticator[] authenticators = new Authenticator[3];
   private final Authorizer[] authorizers = new Authorizer[2];
   private final SecurityProcessor[] securityProcessors = new SecurityProcessor[2];
 
-  public SecurityLookupService() {
+  public ProtobufSecurityLookupService() {
     initializeAuthenticators();
     initializeAuthortizers();
     initializeSecurityProcessors();
diff --git a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/security/ProtobufShiroAuthorizer.java b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/security/ProtobufShiroAuthorizer.java
index 04149eb..96610e4 100644
--- a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/security/ProtobufShiroAuthorizer.java
+++ b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/security/ProtobufShiroAuthorizer.java
@@ -18,7 +18,6 @@ import org.apache.shiro.subject.Subject;
 import org.apache.shiro.util.ThreadState;
 
 import org.apache.geode.internal.security.SecurityService;
-import org.apache.geode.security.NotAuthorizedException;
 import org.apache.geode.security.ResourcePermission;
 import org.apache.geode.internal.protocol.security.Authorizer;
 
diff --git a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/utilities/ProtobufUtilities.java b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/utilities/ProtobufUtilities.java
index 1053f64..320a10c 100644
--- a/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/utilities/ProtobufUtilities.java
+++ b/geode-protobuf/src/main/java/org/apache/geode/internal/protocol/protobuf/utilities/ProtobufUtilities.java
@@ -21,7 +21,7 @@ import org.apache.geode.cache.Region;
 import org.apache.geode.cache.RegionAttributes;
 import org.apache.geode.internal.protocol.protobuf.BasicTypes;
 import org.apache.geode.internal.protocol.protobuf.ClientProtocol;
-import org.apache.geode.internal.protocol.EncodingTypeTranslator;
+import org.apache.geode.internal.protocol.protobuf.EncodingTypeTranslator;
 import org.apache.geode.internal.protocol.protobuf.ProtobufSerializationService;
 import org.apache.geode.internal.protocol.protobuf.RegionAPI;
 import org.apache.geode.internal.protocol.protobuf.utilities.exception.UnknownProtobufPrimitiveType;
diff --git a/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/acceptance/CacheConnectionJUnitTest.java b/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/acceptance/CacheConnectionJUnitTest.java
index 4a76966..8160cb8 100644
--- a/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/acceptance/CacheConnectionJUnitTest.java
+++ b/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/acceptance/CacheConnectionJUnitTest.java
@@ -67,7 +67,6 @@ import org.apache.geode.internal.protocol.protobuf.ProtobufSerializationService;
 import org.apache.geode.internal.protocol.protobuf.RegionAPI;
 import org.apache.geode.internal.protocol.protobuf.serializer.ProtobufProtocolSerializer;
 import org.apache.geode.internal.protocol.protobuf.statistics.ProtobufClientStatisticsImpl;
-import org.apache.geode.internal.protocol.statistics.ProtocolClientStatistics;
 import org.apache.geode.internal.serialization.SerializationService;
 import org.apache.geode.test.junit.categories.IntegrationTest;
 import org.apache.geode.util.test.TestUtil;
diff --git a/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/acceptance/CacheConnectionTimeoutJUnitTest.java b/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/acceptance/CacheConnectionTimeoutJUnitTest.java
index 2b910da..b0b7518 100644
--- a/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/acceptance/CacheConnectionTimeoutJUnitTest.java
+++ b/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/acceptance/CacheConnectionTimeoutJUnitTest.java
@@ -26,7 +26,6 @@ import java.net.Socket;
 import java.util.Properties;
 import java.util.concurrent.TimeUnit;
 
-import org.apache.geode.distributed.internal.SecurityConfig;
 import org.awaitility.Awaitility;
 import org.junit.After;
 import org.junit.Before;
diff --git a/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/acceptance/CacheMaxConnectionJUnitTest.java b/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/acceptance/CacheMaxConnectionJUnitTest.java
index 83084e9..565349a 100644
--- a/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/acceptance/CacheMaxConnectionJUnitTest.java
+++ b/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/acceptance/CacheMaxConnectionJUnitTest.java
@@ -32,7 +32,6 @@ import java.util.concurrent.Executors;
 import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
 
-import org.apache.geode.distributed.internal.SecurityConfig;
 import org.awaitility.Awaitility;
 import org.junit.After;
 import org.junit.Before;
@@ -57,7 +56,6 @@ import org.apache.geode.internal.protocol.MessageUtil;
 import org.apache.geode.internal.protocol.exception.InvalidProtocolMessageException;
 import org.apache.geode.internal.protocol.protobuf.ProtobufSerializationService;
 import org.apache.geode.internal.protocol.protobuf.serializer.ProtobufProtocolSerializer;
-import org.apache.geode.internal.protocol.protobuf.utilities.ProtobufUtilities;
 import org.apache.geode.test.junit.categories.FlakyTest;
 import org.apache.geode.test.junit.categories.IntegrationTest;
 
diff --git a/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/acceptance/CacheOperationsJUnitTest.java b/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/acceptance/CacheOperationsJUnitTest.java
index d5638ca..3a2b46e 100644
--- a/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/acceptance/CacheOperationsJUnitTest.java
+++ b/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/acceptance/CacheOperationsJUnitTest.java
@@ -36,7 +36,6 @@ import java.util.Set;
 import java.util.concurrent.TimeUnit;
 import java.util.stream.Stream;
 
-import org.apache.geode.distributed.internal.SecurityConfig;
 import org.awaitility.Awaitility;
 import org.junit.After;
 import org.junit.Assert;
diff --git a/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/EncodingTypeToSerializationTypeTranslatorJUnitTest.java b/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/EncodingTypeToSerializationTypeTranslatorJUnitTest.java
index 0a67aff..883b0f6 100644
--- a/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/EncodingTypeToSerializationTypeTranslatorJUnitTest.java
+++ b/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/EncodingTypeToSerializationTypeTranslatorJUnitTest.java
@@ -19,7 +19,6 @@ import static org.junit.Assert.assertSame;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import org.apache.geode.internal.protocol.EncodingTypeTranslator;
 import org.apache.geode.internal.serialization.SerializationType;
 import org.apache.geode.internal.serialization.exception.UnsupportedEncodingTypeException;
 import org.apache.geode.test.junit.categories.UnitTest;
diff --git a/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/ProtobufProtocolServiceJUnitTest.java b/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/ProtobufProtocolServiceJUnitTest.java
index 52b78d0..912463a 100644
--- a/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/ProtobufProtocolServiceJUnitTest.java
+++ b/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/ProtobufProtocolServiceJUnitTest.java
@@ -19,7 +19,6 @@ import static org.junit.Assert.*;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import org.apache.geode.internal.protocol.protobuf.ProtobufProtocolService;
 import org.apache.geode.internal.protocol.statistics.ProtocolClientStatistics;
 import org.apache.geode.internal.statistics.DummyStatisticsFactory;
 import org.apache.geode.test.junit.categories.UnitTest;
diff --git a/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/operations/GetAllRequestOperationHandlerJUnitTest.java b/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/operations/GetAllRequestOperationHandlerJUnitTest.java
index bcd98c3..6465b64 100644
--- a/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/operations/GetAllRequestOperationHandlerJUnitTest.java
+++ b/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/operations/GetAllRequestOperationHandlerJUnitTest.java
@@ -34,11 +34,11 @@ import org.junit.experimental.categories.Category;
 import org.apache.geode.cache.CacheLoaderException;
 import org.apache.geode.cache.Region;
 import org.apache.geode.internal.exception.InvalidExecutionContextException;
-import org.apache.geode.internal.protocol.protobuf.BasicTypes;
 import org.apache.geode.internal.protocol.ProtobufTestExecutionContext;
-import org.apache.geode.internal.protocol.protobuf.RegionAPI;
 import org.apache.geode.internal.protocol.Result;
 import org.apache.geode.internal.protocol.Success;
+import org.apache.geode.internal.protocol.protobuf.BasicTypes;
+import org.apache.geode.internal.protocol.protobuf.RegionAPI;
 import org.apache.geode.internal.protocol.protobuf.utilities.ProtobufRequestUtilities;
 import org.apache.geode.internal.protocol.protobuf.utilities.ProtobufUtilities;
 import org.apache.geode.internal.serialization.exception.UnsupportedEncodingTypeException;
@@ -76,13 +76,13 @@ public class GetAllRequestOperationHandlerJUnitTest extends OperationHandlerJUni
 
   @Test
   public void processReturnsExpectedValuesForValidKeys() throws Exception {
-    Result<RegionAPI.GetAllResponse> result =
+    Result result =
         operationHandler.process(serializationServiceStub, generateTestRequest(true, false),
             ProtobufTestExecutionContext.getNoAuthCacheExecutionContext(cacheStub));
 
     assertTrue(result instanceof Success);
 
-    RegionAPI.GetAllResponse response = result.getMessage();
+    RegionAPI.GetAllResponse response = (RegionAPI.GetAllResponse) result.getMessage();
 
     assertEquals(3, response.getEntriesCount());
 
@@ -97,13 +97,14 @@ public class GetAllRequestOperationHandlerJUnitTest extends OperationHandlerJUni
   @Test
   public void processReturnsNoEntriesForNoKeysRequested() throws UnsupportedEncodingTypeException,
       CodecNotRegisteredForTypeException, InvalidExecutionContextException {
-    Result<RegionAPI.GetAllResponse> result =
+    Result result =
         operationHandler.process(serializationServiceStub, generateTestRequest(false, false),
             ProtobufTestExecutionContext.getNoAuthCacheExecutionContext(cacheStub));
 
     assertTrue(result instanceof Success);
 
-    List<BasicTypes.Entry> entriesList = result.getMessage().getEntriesList();
+    RegionAPI.GetAllResponse response = (RegionAPI.GetAllResponse) result.getMessage();
+    List<BasicTypes.Entry> entriesList = response.getEntriesList();
     Map<String, String> responseEntries = convertEntryListToMap(entriesList);
     assertEquals(0, responseEntries.size());
   }
@@ -115,11 +116,11 @@ public class GetAllRequestOperationHandlerJUnitTest extends OperationHandlerJUni
         NO_VALUE_PRESENT_FOR_THIS_KEY));
     RegionAPI.GetAllRequest getAllRequest =
         ProtobufRequestUtilities.createGetAllRequest(TEST_REGION, testKeys);
-    Result<RegionAPI.GetAllResponse> result = operationHandler.process(serializationServiceStub,
-        getAllRequest, ProtobufTestExecutionContext.getNoAuthCacheExecutionContext(cacheStub));
+    Result result = operationHandler.process(serializationServiceStub, getAllRequest,
+        ProtobufTestExecutionContext.getNoAuthCacheExecutionContext(cacheStub));
 
     assertTrue(result instanceof Success);
-    RegionAPI.GetAllResponse message = result.getMessage();
+    RegionAPI.GetAllResponse message = (RegionAPI.GetAllResponse) result.getMessage();
     assertEquals(1, message.getEntriesCount());
     assertFalse(message.getEntries(0).hasValue());
     assertEquals(NO_VALUE_PRESENT_FOR_THIS_KEY, message.getEntries(0).getKey().getStringResult());
@@ -130,13 +131,13 @@ public class GetAllRequestOperationHandlerJUnitTest extends OperationHandlerJUni
   @Test
   public void multipleKeysWhereOneThrows() throws UnsupportedEncodingTypeException,
       CodecNotRegisteredForTypeException, InvalidExecutionContextException {
-    Result<RegionAPI.GetAllResponse> result =
+    Result result =
         operationHandler.process(serializationServiceStub, generateTestRequest(true, true),
             ProtobufTestExecutionContext.getNoAuthCacheExecutionContext(cacheStub));
 
     assertTrue(result instanceof Success);
 
-    RegionAPI.GetAllResponse response = result.getMessage();
+    RegionAPI.GetAllResponse response = (RegionAPI.GetAllResponse) result.getMessage();
 
     assertEquals(3, response.getEntriesCount());
 
diff --git a/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/operations/GetAvailableServersOperationHandlerJUnitTest.java b/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/operations/GetAvailableServersOperationHandlerJUnitTest.java
index 6e26fda..cee9075 100644
--- a/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/operations/GetAvailableServersOperationHandlerJUnitTest.java
+++ b/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/operations/GetAvailableServersOperationHandlerJUnitTest.java
@@ -19,14 +19,12 @@ import org.apache.geode.distributed.internal.LocatorLoadSnapshot;
 import org.apache.geode.distributed.internal.ServerLocation;
 import org.apache.geode.distributed.internal.ServerLocator;
 import org.apache.geode.internal.exception.InvalidExecutionContextException;
-import org.apache.geode.internal.protocol.MessageExecutionContext;
 import org.apache.geode.internal.protocol.ProtobufTestExecutionContext;
 import org.apache.geode.internal.protocol.protobuf.BasicTypes;
 import org.apache.geode.internal.protocol.Result;
 import org.apache.geode.internal.protocol.protobuf.ServerAPI;
 import org.apache.geode.internal.protocol.protobuf.ServerAPI.GetAvailableServersResponse;
 import org.apache.geode.internal.protocol.Success;
-import org.apache.geode.internal.protocol.statistics.NoOpStatistics;
 import org.apache.geode.internal.protocol.protobuf.utilities.ProtobufRequestUtilities;
 import org.apache.geode.test.junit.categories.UnitTest;
 
diff --git a/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/operations/GetRegionNamesRequestOperationHandlerJUnitTest.java b/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/operations/GetRegionNamesRequestOperationHandlerJUnitTest.java
index 5e09ec6..c4268c7 100644
--- a/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/operations/GetRegionNamesRequestOperationHandlerJUnitTest.java
+++ b/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/operations/GetRegionNamesRequestOperationHandlerJUnitTest.java
@@ -32,9 +32,9 @@ import org.junit.experimental.categories.Category;
 import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.Region;
 import org.apache.geode.internal.exception.InvalidExecutionContextException;
-import org.apache.geode.internal.protocol.protobuf.RegionAPI;
 import org.apache.geode.internal.protocol.Result;
 import org.apache.geode.internal.protocol.Success;
+import org.apache.geode.internal.protocol.protobuf.RegionAPI;
 import org.apache.geode.internal.protocol.protobuf.utilities.ProtobufRequestUtilities;
 import org.apache.geode.internal.serialization.exception.UnsupportedEncodingTypeException;
 import org.apache.geode.internal.serialization.registry.exception.CodecNotRegisteredForTypeException;
@@ -63,14 +63,14 @@ public class GetRegionNamesRequestOperationHandlerJUnitTest extends OperationHan
   }
 
   @Test
-  public void processReturnsCacheRegions() throws UnsupportedEncodingTypeException,
-      CodecNotRegisteredForTypeException, InvalidExecutionContextException {
-    Result<RegionAPI.GetRegionNamesResponse> result = operationHandler.process(
-        serializationServiceStub, ProtobufRequestUtilities.createGetRegionNamesRequest(),
+  public void processReturnsCacheRegions() throws InvalidExecutionContextException {
+    Result result = operationHandler.process(serializationServiceStub,
+        ProtobufRequestUtilities.createGetRegionNamesRequest(),
         getNoAuthCacheExecutionContext(cacheStub));
     Assert.assertTrue(result instanceof Success);
 
-    RegionAPI.GetRegionNamesResponse getRegionsResponse = result.getMessage();
+    RegionAPI.GetRegionNamesResponse getRegionsResponse =
+        (RegionAPI.GetRegionNamesResponse) result.getMessage();
     Assert.assertEquals(3, getRegionsResponse.getRegionsCount());
 
     // There's no guarantee for what order we receive the regions in from the response
@@ -94,12 +94,13 @@ public class GetRegionNamesRequestOperationHandlerJUnitTest extends OperationHan
     Cache emptyCache = mock(Cache.class);;
     when(emptyCache.rootRegions())
         .thenReturn(Collections.unmodifiableSet(new HashSet<Region<String, String>>()));
-    Result<RegionAPI.GetRegionNamesResponse> result = operationHandler.process(
-        serializationServiceStub, ProtobufRequestUtilities.createGetRegionNamesRequest(),
+    Result result = operationHandler.process(serializationServiceStub,
+        ProtobufRequestUtilities.createGetRegionNamesRequest(),
         getNoAuthCacheExecutionContext(emptyCache));
     Assert.assertTrue(result instanceof Success);
 
-    RegionAPI.GetRegionNamesResponse getRegionsResponse = result.getMessage();
+    RegionAPI.GetRegionNamesResponse getRegionsResponse =
+        (RegionAPI.GetRegionNamesResponse) result.getMessage();
     Assert.assertEquals(0, getRegionsResponse.getRegionsCount());
   }
 }
diff --git a/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/operations/GetRegionRequestOperationHandlerJUnitTest.java b/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/operations/GetRegionRequestOperationHandlerJUnitTest.java
index 6775f06..d002b01 100644
--- a/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/operations/GetRegionRequestOperationHandlerJUnitTest.java
+++ b/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/operations/GetRegionRequestOperationHandlerJUnitTest.java
@@ -69,9 +69,9 @@ public class GetRegionRequestOperationHandlerJUnitTest extends OperationHandlerJ
     when(regionAttributesStub.getScope()).thenReturn(Scope.DISTRIBUTED_ACK);
 
 
-    Result<RegionAPI.GetRegionResponse> result = operationHandler.process(serializationServiceStub,
+    Result result = operationHandler.process(serializationServiceStub,
         MessageUtil.makeGetRegionRequest(TEST_REGION1), getNoAuthCacheExecutionContext(cacheStub));
-    RegionAPI.GetRegionResponse response = result.getMessage();
+    RegionAPI.GetRegionResponse response = (RegionAPI.GetRegionResponse) result.getMessage();
     BasicTypes.Region region = response.getRegion();
     Assert.assertEquals(TEST_REGION1, region.getName());
     Assert.assertEquals(String.class.toString(), region.getKeyConstraint());
@@ -92,12 +92,14 @@ public class GetRegionRequestOperationHandlerJUnitTest extends OperationHandlerJ
     when(emptyCache.rootRegions())
         .thenReturn(Collections.unmodifiableSet(new HashSet<Region<String, String>>()));
     String unknownRegionName = "UNKNOWN_REGION";
-    Result<RegionAPI.GetRegionResponse> result = operationHandler.process(serializationServiceStub,
+    Result result = operationHandler.process(serializationServiceStub,
         MessageUtil.makeGetRegionRequest(unknownRegionName),
         getNoAuthCacheExecutionContext(emptyCache));
     Assert.assertTrue(result instanceof Failure);
+    ClientProtocol.ErrorResponse errorMessage =
+        (ClientProtocol.ErrorResponse) result.getErrorMessage();
     Assert.assertEquals(ProtocolErrorCode.REGION_NOT_FOUND.codeValue,
-        result.getErrorMessage().getError().getErrorCode());
+        errorMessage.getError().getErrorCode());
   }
 
 }
diff --git a/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/operations/GetRequestOperationHandlerJUnitTest.java b/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/operations/GetRequestOperationHandlerJUnitTest.java
index 302232c..dc9a211 100644
--- a/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/operations/GetRequestOperationHandlerJUnitTest.java
+++ b/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/operations/GetRequestOperationHandlerJUnitTest.java
@@ -29,6 +29,7 @@ import org.apache.geode.internal.protocol.protobuf.BasicTypes;
 import org.apache.geode.internal.protocol.Failure;
 import org.apache.geode.internal.protocol.ProtobufTestExecutionContext;
 import org.apache.geode.internal.protocol.ProtocolErrorCode;
+import org.apache.geode.internal.protocol.protobuf.ClientProtocol;
 import org.apache.geode.internal.protocol.protobuf.RegionAPI;
 import org.apache.geode.internal.protocol.Result;
 import org.apache.geode.internal.protocol.Success;
@@ -66,32 +67,35 @@ public class GetRequestOperationHandlerJUnitTest extends OperationHandlerJUnitTe
   @Test
   public void processReturnsTheEncodedValueFromTheRegion() throws Exception {
     RegionAPI.GetRequest getRequest = generateTestRequest(false, false, false);
-    Result<RegionAPI.GetResponse> result = operationHandler.process(serializationServiceStub,
-        getRequest, ProtobufTestExecutionContext.getNoAuthCacheExecutionContext(cacheStub));
+    Result result = operationHandler.process(serializationServiceStub, getRequest,
+        ProtobufTestExecutionContext.getNoAuthCacheExecutionContext(cacheStub));
 
     Assert.assertTrue(result instanceof Success);
+    RegionAPI.GetResponse response = (RegionAPI.GetResponse) result.getMessage();
     Assert.assertEquals(BasicTypes.EncodedValue.ValueCase.STRINGRESULT,
-        result.getMessage().getResult().getValueCase());
-    String actualValue = result.getMessage().getResult().getStringResult();
+        response.getResult().getValueCase());
+    String actualValue = response.getResult().getStringResult();
     Assert.assertEquals(TEST_VALUE, actualValue);
   }
 
   @Test
   public void processReturnsUnsucessfulResponseForInvalidRegion() throws Exception {
     RegionAPI.GetRequest getRequest = generateTestRequest(true, false, false);
-    Result<RegionAPI.GetResponse> response = operationHandler.process(serializationServiceStub,
-        getRequest, ProtobufTestExecutionContext.getNoAuthCacheExecutionContext(cacheStub));
+    Result response = operationHandler.process(serializationServiceStub, getRequest,
+        ProtobufTestExecutionContext.getNoAuthCacheExecutionContext(cacheStub));
 
     Assert.assertTrue(response instanceof Failure);
+    ClientProtocol.ErrorResponse errorMessage =
+        (ClientProtocol.ErrorResponse) response.getErrorMessage();
     Assert.assertEquals(ProtocolErrorCode.REGION_NOT_FOUND.codeValue,
-        response.getErrorMessage().getError().getErrorCode());
+        errorMessage.getError().getErrorCode());
   }
 
   @Test
   public void processReturnsKeyNotFoundWhenKeyIsNotFound() throws Exception {
     RegionAPI.GetRequest getRequest = generateTestRequest(false, true, false);
-    Result<RegionAPI.GetResponse> response = operationHandler.process(serializationServiceStub,
-        getRequest, ProtobufTestExecutionContext.getNoAuthCacheExecutionContext(cacheStub));
+    Result response = operationHandler.process(serializationServiceStub, getRequest,
+        ProtobufTestExecutionContext.getNoAuthCacheExecutionContext(cacheStub));
 
     Assert.assertTrue(response instanceof Success);
   }
@@ -99,8 +103,8 @@ public class GetRequestOperationHandlerJUnitTest extends OperationHandlerJUnitTe
   @Test
   public void processReturnsLookupFailureWhenKeyFoundWithNoValue() throws Exception {
     RegionAPI.GetRequest getRequest = generateTestRequest(false, false, true);
-    Result<RegionAPI.GetResponse> response = operationHandler.process(serializationServiceStub,
-        getRequest, ProtobufTestExecutionContext.getNoAuthCacheExecutionContext(cacheStub));
+    Result response = operationHandler.process(serializationServiceStub, getRequest,
+        ProtobufTestExecutionContext.getNoAuthCacheExecutionContext(cacheStub));
 
     Assert.assertTrue(response instanceof Success);
   }
@@ -118,12 +122,14 @@ public class GetRequestOperationHandlerJUnitTest extends OperationHandlerJUnitTe
         .setCustomEncodedValue(customEncodedValueBuilder).build();
     RegionAPI.GetRequest getRequest =
         ProtobufRequestUtilities.createGetRequest(TEST_REGION, encodedKey).getGetRequest();
-    Result<RegionAPI.GetResponse> response = operationHandler.process(serializationServiceStub,
-        getRequest, ProtobufTestExecutionContext.getNoAuthCacheExecutionContext(cacheStub));
+    Result response = operationHandler.process(serializationServiceStub, getRequest,
+        ProtobufTestExecutionContext.getNoAuthCacheExecutionContext(cacheStub));
 
     Assert.assertTrue(response instanceof Failure);
+    ClientProtocol.ErrorResponse errorMessage =
+        (ClientProtocol.ErrorResponse) response.getErrorMessage();
     Assert.assertEquals(ProtocolErrorCode.VALUE_ENCODING_ERROR.codeValue,
-        response.getErrorMessage().getError().getErrorCode());
+        errorMessage.getError().getErrorCode());
   }
 
   private RegionAPI.GetRequest generateTestRequest(boolean missingRegion, boolean missingKey,
diff --git a/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/operations/PutAllRequestOperationHandlerJUnitTest.java b/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/operations/PutAllRequestOperationHandlerJUnitTest.java
index 80b15ff..66c99dc 100644
--- a/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/operations/PutAllRequestOperationHandlerJUnitTest.java
+++ b/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/operations/PutAllRequestOperationHandlerJUnitTest.java
@@ -70,7 +70,7 @@ public class PutAllRequestOperationHandlerJUnitTest extends OperationHandlerJUni
   public void processInsertsMultipleValidEntriesInCache() throws Exception {
     PutAllRequestOperationHandler operationHandler = new PutAllRequestOperationHandler();
 
-    Result<RegionAPI.PutAllResponse> result = operationHandler.process(serializationServiceStub,
+    Result result = operationHandler.process(serializationServiceStub,
         generateTestRequest(false, true), getNoAuthCacheExecutionContext(cacheStub));
 
     Assert.assertTrue(result instanceof Success);
@@ -84,7 +84,7 @@ public class PutAllRequestOperationHandlerJUnitTest extends OperationHandlerJUni
   public void processWithInvalidEntrySucceedsAndReturnsFailedKey() throws Exception {
     PutAllRequestOperationHandler operationHandler = new PutAllRequestOperationHandler();
 
-    Result<RegionAPI.PutAllResponse> result = operationHandler.process(serializationServiceStub,
+    Result result = operationHandler.process(serializationServiceStub,
         generateTestRequest(true, true), getNoAuthCacheExecutionContext(cacheStub));
 
     assertTrue(result instanceof Success);
@@ -92,7 +92,7 @@ public class PutAllRequestOperationHandlerJUnitTest extends OperationHandlerJUni
     verify(regionMock).put(TEST_KEY2, TEST_VALUE2);
     verify(regionMock).put(TEST_KEY3, TEST_VALUE3);
 
-    RegionAPI.PutAllResponse putAllResponse = result.getMessage();
+    RegionAPI.PutAllResponse putAllResponse = (RegionAPI.PutAllResponse) result.getMessage();
     assertEquals(1, putAllResponse.getFailedKeysCount());
     BasicTypes.KeyedError error = putAllResponse.getFailedKeys(0);
     assertEquals(TEST_INVALID_KEY,
@@ -103,7 +103,7 @@ public class PutAllRequestOperationHandlerJUnitTest extends OperationHandlerJUni
   public void processWithNoEntriesPasses() throws Exception {
     PutAllRequestOperationHandler operationHandler = new PutAllRequestOperationHandler();
 
-    Result<RegionAPI.PutAllResponse> result = operationHandler.process(serializationServiceStub,
+    Result result = operationHandler.process(serializationServiceStub,
         generateTestRequest(false, false), getNoAuthCacheExecutionContext(cacheStub));
 
     assertTrue(result instanceof Success);
diff --git a/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/operations/PutRequestOperationHandlerJUnitTest.java b/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/operations/PutRequestOperationHandlerJUnitTest.java
index 04ce826..8f87b45 100644
--- a/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/operations/PutRequestOperationHandlerJUnitTest.java
+++ b/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/operations/PutRequestOperationHandlerJUnitTest.java
@@ -33,6 +33,7 @@ import org.apache.geode.internal.protocol.protobuf.BasicTypes;
 import org.apache.geode.internal.protocol.Failure;
 import org.apache.geode.internal.protocol.ProtobufTestExecutionContext;
 import org.apache.geode.internal.protocol.ProtocolErrorCode;
+import org.apache.geode.internal.protocol.protobuf.ClientProtocol;
 import org.apache.geode.internal.protocol.protobuf.RegionAPI;
 import org.apache.geode.internal.protocol.Result;
 import org.apache.geode.internal.protocol.Success;
@@ -62,9 +63,8 @@ public class PutRequestOperationHandlerJUnitTest extends OperationHandlerJUnitTe
   @Test
   public void test_puttingTheEncodedEntryIntoRegion() throws Exception {
     PutRequestOperationHandler operationHandler = new PutRequestOperationHandler();
-    Result<RegionAPI.PutResponse> result =
-        operationHandler.process(serializationServiceStub, generateTestRequest(),
-            ProtobufTestExecutionContext.getNoAuthCacheExecutionContext(cacheStub));
+    Result result = operationHandler.process(serializationServiceStub, generateTestRequest(),
+        ProtobufTestExecutionContext.getNoAuthCacheExecutionContext(cacheStub));
 
     assertTrue(result instanceof Success);
 
@@ -92,25 +92,28 @@ public class PutRequestOperationHandlerJUnitTest extends OperationHandlerJUnitTe
     BasicTypes.Entry testEntry = ProtobufUtilities.createEntry(encodedKey, testValue);
     RegionAPI.PutRequest putRequest =
         ProtobufRequestUtilities.createPutRequest(TEST_REGION, testEntry).getPutRequest();
-    Result<RegionAPI.PutResponse> result = operationHandler.process(serializationServiceStub,
-        putRequest, ProtobufTestExecutionContext.getNoAuthCacheExecutionContext(cacheStub));
+    Result result = operationHandler.process(serializationServiceStub, putRequest,
+        ProtobufTestExecutionContext.getNoAuthCacheExecutionContext(cacheStub));
 
     assertTrue(result instanceof Failure);
+    ClientProtocol.ErrorResponse errorMessage =
+        (ClientProtocol.ErrorResponse) result.getErrorMessage();
     assertEquals(ProtocolErrorCode.VALUE_ENCODING_ERROR.codeValue,
-        result.getErrorMessage().getError().getErrorCode());
+        errorMessage.getError().getErrorCode());
   }
 
   @Test
   public void test_RegionNotFound() throws Exception {
     when(cacheStub.getRegion(TEST_REGION)).thenReturn(null);
     PutRequestOperationHandler operationHandler = new PutRequestOperationHandler();
-    Result<RegionAPI.PutResponse> result =
-        operationHandler.process(serializationServiceStub, generateTestRequest(),
-            ProtobufTestExecutionContext.getNoAuthCacheExecutionContext(cacheStub));
+    Result result = operationHandler.process(serializationServiceStub, generateTestRequest(),
+        ProtobufTestExecutionContext.getNoAuthCacheExecutionContext(cacheStub));
 
     assertTrue(result instanceof Failure);
+    ClientProtocol.ErrorResponse errorMessage =
+        (ClientProtocol.ErrorResponse) result.getErrorMessage();
     assertEquals(ProtocolErrorCode.REGION_NOT_FOUND.codeValue,
-        result.getErrorMessage().getError().getErrorCode());
+        errorMessage.getError().getErrorCode());
   }
 
   @Test
@@ -118,13 +121,14 @@ public class PutRequestOperationHandlerJUnitTest extends OperationHandlerJUnitTe
     when(regionMock.put(any(), any())).thenThrow(ClassCastException.class);
 
     PutRequestOperationHandler operationHandler = new PutRequestOperationHandler();
-    Result<RegionAPI.PutResponse> result =
-        operationHandler.process(serializationServiceStub, generateTestRequest(),
-            ProtobufTestExecutionContext.getNoAuthCacheExecutionContext(cacheStub));
+    Result result = operationHandler.process(serializationServiceStub, generateTestRequest(),
+        ProtobufTestExecutionContext.getNoAuthCacheExecutionContext(cacheStub));
 
     assertTrue(result instanceof Failure);
+    ClientProtocol.ErrorResponse errorMessage =
+        (ClientProtocol.ErrorResponse) result.getErrorMessage();
     assertEquals(ProtocolErrorCode.CONSTRAINT_VIOLATION.codeValue,
-        result.getErrorMessage().getError().getErrorCode());
+        errorMessage.getError().getErrorCode());
   }
 
   private RegionAPI.PutRequest generateTestRequest()
diff --git a/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/operations/RemoveRequestOperationHandlerJUnitTest.java b/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/operations/RemoveRequestOperationHandlerJUnitTest.java
index 3b8fc66..14d15ba 100644
--- a/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/operations/RemoveRequestOperationHandlerJUnitTest.java
+++ b/geode-protobuf/src/test/java/org/apache/geode/internal/protocol/protobuf/operations/RemoveRequestOperationHandlerJUnitTest.java
@@ -67,8 +67,8 @@ public class RemoveRequestOperationHandlerJUnitTest extends OperationHandlerJUni
   @Test
   public void processValidKeyRemovesTheEntryAndReturnSuccess() throws Exception {
     RegionAPI.RemoveRequest removeRequest = generateTestRequest(false, false).getRemoveRequest();
-    Result<RegionAPI.RemoveResponse> result = operationHandler.process(serializationServiceStub,
-        removeRequest, ProtobufTestExecutionContext.getNoAuthCacheExecutionContext(cacheStub));
+    Result result = operationHandler.process(serializationServiceStub, removeRequest,
+        ProtobufTestExecutionContext.getNoAuthCacheExecutionContext(cacheStub));
 
     assertTrue(result instanceof Success);
     verify(regionStub).remove(TEST_KEY);
@@ -77,19 +77,21 @@ public class RemoveRequestOperationHandlerJUnitTest extends OperationHandlerJUni
   @Test
   public void processReturnsUnsucessfulResponseForInvalidRegion() throws Exception {
     RegionAPI.RemoveRequest removeRequest = generateTestRequest(true, false).getRemoveRequest();
-    Result<RegionAPI.RemoveResponse> result = operationHandler.process(serializationServiceStub,
-        removeRequest, ProtobufTestExecutionContext.getNoAuthCacheExecutionContext(cacheStub));
+    Result result = operationHandler.process(serializationServiceStub, removeRequest,
+        ProtobufTestExecutionContext.getNoAuthCacheExecutionContext(cacheStub));
 
     assertTrue(result instanceof Failure);
+    ClientProtocol.ErrorResponse errorMessage =
+        (ClientProtocol.ErrorResponse) result.getErrorMessage();
     assertEquals(ProtocolErrorCode.REGION_NOT_FOUND.codeValue,
-        result.getErrorMessage().getError().getErrorCode());
+        errorMessage.getError().getErrorCode());
   }
 
   @Test
   public void processReturnsSuccessWhenKeyIsNotFound() throws Exception {
     RegionAPI.RemoveRequest removeRequest = generateTestRequest(false, true).getRemoveRequest();
-    Result<RegionAPI.RemoveResponse> result = operationHandler.process(serializationServiceStub,
-        removeRequest, ProtobufTestExecutionContext.getNoAuthCacheExecutionContext(cacheStub));
+    Result result = operationHandler.process(serializationServiceStub, removeRequest,
+        ProtobufTestExecutionContext.getNoAuthCacheExecutionContext(cacheStub));
 
     assertTrue(result instanceof Success);
   }
@@ -108,12 +110,14 @@ public class RemoveRequestOperationHandlerJUnitTest extends OperationHandlerJUni
 
     RegionAPI.RemoveRequest removeRequest =
         ProtobufRequestUtilities.createRemoveRequest(TEST_REGION, encodedKey).getRemoveRequest();;
-    Result<RegionAPI.RemoveResponse> result = operationHandler.process(serializationServiceStub,
-        removeRequest, ProtobufTestExecutionContext.getNoAuthCacheExecutionContext(cacheStub));
+    Result result = operationHandler.process(serializationServiceStub, removeRequest,
+        ProtobufTestExecutionContext.getNoAuthCacheExecutionContext(cacheStub));
 
     assertTrue(result instanceof Failure);
+    ClientProtocol.ErrorResponse errorMessage =
+        (ClientProtocol.ErrorResponse) result.getErrorMessage();
     assertEquals(ProtocolErrorCode.VALUE_ENCODING_ERROR.codeValue,
-        result.getErrorMessage().getError().getErrorCode());
+        errorMessage.getError().getErrorCode());
   }
 
   private ClientProtocol.Request generateTestRequest(boolean missingRegion, boolean missingKey)
diff --git a/geode-protobuf/src/test/java/org/apache/geode/internal/serialization/registry/CodecRegistryJUnitTest.java b/geode-protobuf/src/test/java/org/apache/geode/internal/serialization/registry/CodecRegistryJUnitTest.java
index d9310dd..c3c3a61 100644
--- a/geode-protobuf/src/test/java/org/apache/geode/internal/serialization/registry/CodecRegistryJUnitTest.java
+++ b/geode-protobuf/src/test/java/org/apache/geode/internal/serialization/registry/CodecRegistryJUnitTest.java
@@ -20,7 +20,6 @@ import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
-import org.powermock.api.mockito.PowerMockito;
 
 import org.apache.geode.internal.serialization.SerializationType;
 import org.apache.geode.internal.serialization.registry.exception.CodecNotRegisteredForTypeException;
diff --git a/settings.gradle b/settings.gradle
index 87f4a9c..006345c 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -40,6 +40,7 @@ include 'extensions/geode-modules-assembly'
 include 'geode-protobuf'
 include 'extensions/session-testing-war'
 include 'geode-concurrency-test'
+include 'geode-client-protocol'
 
 if (GradleVersion.current() < GradleVersion.version(minimumGradleVersion)) {
   throw new GradleException('Running with unsupported Gradle Version. Use Gradle Wrapper or with Gradle version >= ' + minimumGradleVersion)

-- 
To stop receiving notification emails like this one, please contact
"commits@geode.apache.org" <commits@geode.apache.org>.

Mime
View raw message