geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bschucha...@apache.org
Subject [47/50] [abbrv] geode git commit: spotlessApply
Date Tue, 15 Aug 2017 23:10:58 GMT
spotlessApply


Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/e7eaf1c2
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/e7eaf1c2
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/e7eaf1c2

Branch: refs/heads/feature/GEODE-3249
Commit: e7eaf1c2f5c0cd15a63ff810f3152feaca3ce726
Parents: e0fbb3c
Author: Bruce Schuchardt <bschuchardt@pivotal.io>
Authored: Wed Aug 9 15:56:50 2017 -0700
Committer: Bruce Schuchardt <bschuchardt@pivotal.io>
Committed: Tue Aug 15 15:34:00 2017 -0700

----------------------------------------------------------------------
 .../cache/tier/sockets/ServerConnection.java    | 37 ++++++++------------
 .../ClientAuthenticationPart2DUnitTest.java     |  7 ++--
 2 files changed, 19 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/e7eaf1c2/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/ServerConnection.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/ServerConnection.java
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/ServerConnection.java
index d25722b..51e398c 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/ServerConnection.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/ServerConnection.java
@@ -88,9 +88,9 @@ public abstract class ServerConnection implements Runnable {
       "geode.allow-internal-messages-without-credentials";
 
   /**
-   * This property allows folks to perform a rolling upgrade from pre-1.2.1 to
-   * a post-1.2.1 cluster.  Normally internal messages that can affect server state
-   * require credentials but pre-1.2.1 this wasn't the case.  See GEODE-3249
+   * This property allows folks to perform a rolling upgrade from pre-1.2.1 to a post-1.2.1
cluster.
+   * Normally internal messages that can affect server state require credentials but pre-1.2.1
this
+   * wasn't the case. See GEODE-3249
    */
   private static final boolean ALLOW_INTERNAL_MESSAGES_WITHOUT_CREDENTIALS =
       Boolean.getBoolean(ALLOW_INTERNAL_MESSAGES_WITHOUT_CREDENTIALS_NAME);
@@ -775,8 +775,8 @@ public abstract class ServerConnection implements Runnable {
 
         // if a subject exists for this uniqueId, binds the subject to this thread so that
we can do
         // authorization later
-        if (AcceptorImpl.isIntegratedSecurity() && !isInternalMessage(
-            this.requestMsg, ALLOW_INTERNAL_MESSAGES_WITHOUT_CREDENTIALS)
+        if (AcceptorImpl.isIntegratedSecurity()
+            && !isInternalMessage(this.requestMsg, ALLOW_INTERNAL_MESSAGES_WITHOUT_CREDENTIALS)
             && this.communicationMode != Acceptor.GATEWAY_TO_GATEWAY) {
           long uniqueId = getUniqueId();
           Subject subject = this.clientUserAuths.getSubject(uniqueId);
@@ -1080,8 +1080,8 @@ public abstract class ServerConnection implements Runnable {
     if (AcceptorImpl.isAuthenticationRequired()
         && this.handshake.getVersion().compareTo(Version.GFE_65) >= 0
         && (this.communicationMode != Acceptor.GATEWAY_TO_GATEWAY)
-        && (!this.requestMsg.getAndResetIsMetaRegion()) && (!isInternalMessage(
-        this.requestMsg, ALLOW_INTERNAL_MESSAGES_WITHOUT_CREDENTIALS))) {
+        && (!this.requestMsg.getAndResetIsMetaRegion())
+        && (!isInternalMessage(this.requestMsg, ALLOW_INTERNAL_MESSAGES_WITHOUT_CREDENTIALS)))
{
       setSecurityPart();
       return this.securePart;
     } else {
@@ -1101,22 +1101,16 @@ public abstract class ServerConnection implements Runnable {
     int messageType = message.getMessageType();
     boolean isInternalMessage = messageType == MessageType.PING
         || messageType == MessageType.USER_CREDENTIAL_MESSAGE
-        || messageType == MessageType.REQUEST_EVENT_VALUE
-        || messageType == MessageType.MAKE_PRIMARY
-        || messageType == MessageType.REMOVE_USER_AUTH
-        || messageType == MessageType.CLIENT_READY
-        || messageType == MessageType.SIZE
-        || messageType == MessageType.TX_FAILOVER
-        || messageType == MessageType.TX_SYNCHRONIZATION
-        || messageType == MessageType.COMMIT
-        || messageType == MessageType.ROLLBACK
-        || messageType == MessageType.CLOSE_CONNECTION
-        || messageType == MessageType.INVALID
-        || messageType == MessageType.PERIODIC_ACK
+        || messageType == MessageType.REQUEST_EVENT_VALUE || messageType == MessageType.MAKE_PRIMARY
+        || messageType == MessageType.REMOVE_USER_AUTH || messageType == MessageType.CLIENT_READY
+        || messageType == MessageType.SIZE || messageType == MessageType.TX_FAILOVER
+        || messageType == MessageType.TX_SYNCHRONIZATION || messageType == MessageType.COMMIT
+        || messageType == MessageType.ROLLBACK || messageType == MessageType.CLOSE_CONNECTION
+        || messageType == MessageType.INVALID || messageType == MessageType.PERIODIC_ACK
         || messageType == MessageType.GET_CLIENT_PARTITION_ATTRIBUTES;
 
     // we allow older clients to not send credentials for a handful of messages
-    // if and only if a system property is set.  This allows a rolling upgrade
+    // if and only if a system property is set. This allows a rolling upgrade
     // to be performed.
     if (!isInternalMessage && allowOldInternalMessages) {
       isInternalMessage = messageType == MessageType.GETCQSTATS_MSG_TYPE
@@ -1131,8 +1125,7 @@ public abstract class ServerConnection implements Runnable {
           || messageType == MessageType.ADD_PDX_ENUM
           || messageType == MessageType.GET_PDX_ID_FOR_ENUM
           || messageType == MessageType.GET_PDX_ENUM_BY_ID
-          || messageType == MessageType.GET_PDX_TYPES
-          || messageType == MessageType.GET_PDX_ENUMS;
+          || messageType == MessageType.GET_PDX_TYPES || messageType == MessageType.GET_PDX_ENUMS;
     }
     return isInternalMessage;
   }

http://git-wip-us.apache.org/repos/asf/geode/blob/e7eaf1c2/geode-core/src/test/java/org/apache/geode/security/ClientAuthenticationPart2DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/security/ClientAuthenticationPart2DUnitTest.java
b/geode-core/src/test/java/org/apache/geode/security/ClientAuthenticationPart2DUnitTest.java
index f1d4f23..5a78535 100644
--- a/geode-core/src/test/java/org/apache/geode/security/ClientAuthenticationPart2DUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/security/ClientAuthenticationPart2DUnitTest.java
@@ -49,12 +49,13 @@ public class ClientAuthenticationPart2DUnitTest extends ClientAuthenticationTest
   public void testServerConnectionAcceptsOldInternalMessagesIfAllowed() throws Exception
{
 
     ServerConnection serverConnection = mock(ServerConnection.class);
-    when(serverConnection.isInternalMessage(any(Message.class), any(Boolean.class))).thenCallRealMethod();
+    when(serverConnection.isInternalMessage(any(Message.class), any(Boolean.class)))
+        .thenCallRealMethod();
 
-    int[] oldInternalMessages = new int[]{MessageType.ADD_PDX_TYPE, MessageType.ADD_PDX_ENUM,
+    int[] oldInternalMessages = new int[] {MessageType.ADD_PDX_TYPE, MessageType.ADD_PDX_ENUM,
         MessageType.REGISTER_INSTANTIATORS, MessageType.REGISTER_DATASERIALIZERS};
 
-    for (int i=0; i<oldInternalMessages.length; i++) {
+    for (int i = 0; i < oldInternalMessages.length; i++) {
       Message message = mock(Message.class);
       when(message.getMessageType()).thenReturn(oldInternalMessages[i]);
 


Mime
View raw message