This is an automated email from the ASF dual-hosted git repository.

tv pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-jcs.git

commit c514e3f42332ec555b09b6bc60e4250abf262447
Author: Thomas Vandahl <[email protected]>
AuthorDate: Thu Mar 19 16:56:41 2026 +0100

    Change type of LateralTCPCacheAttributes.SocketTimeOut and OpenTimeOut
    
    to Duration
---
 .../lateral/socket/tcp/LateralTCPCache.java        |  4 +--
 .../socket/tcp/LateralTCPCacheAttributes.java      | 31 +++-------------------
 .../lateral/socket/tcp/LateralTCPService.java      |  3 ++-
 .../tcp/behavior/ILateralTCPCacheAttributes.java   |  5 ----
 .../src/test/test-conf/TestTCPLateralCache.ccf     |  4 +--
 src/site/xdoc/LateralTCPAuxCache.xml               |  2 +-
 src/site/xdoc/LateralTCPProperties.xml             | 15 ++++++++---
 src/site/xdoc/UpgradingFrom3x.xml                  | 14 ++++++++--
 8 files changed, 34 insertions(+), 44 deletions(-)

diff --git 
a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/LateralTCPCache.java
 
b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/LateralTCPCache.java
index e6bc843a..f1a8f375 100644
--- 
a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/LateralTCPCache.java
+++ 
b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/LateralTCPCache.java
@@ -242,7 +242,7 @@ public class LateralTCPCache<K, V>
     {
         ICacheElement<K, V> obj = null;
 
-        if ( !this.getAuxiliaryCacheAttributes().getPutOnlyMode() )
+        if (this.getAuxiliaryCacheAttributes().isAllowGet())
         {
             try
             {
@@ -270,7 +270,7 @@ public class LateralTCPCache<K, V>
     {
         final Map<K, ICacheElement<K, V>> map = Collections.emptyMap();
 
-        if ( !this.getAuxiliaryCacheAttributes().getPutOnlyMode() )
+        if (this.getAuxiliaryCacheAttributes().isAllowGet())
         {
             try
             {
diff --git 
a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/LateralTCPCacheAttributes.java
 
b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/LateralTCPCacheAttributes.java
index 24ff04e7..ecfe0d96 100644
--- 
a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/LateralTCPCacheAttributes.java
+++ 
b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/LateralTCPCacheAttributes.java
@@ -111,9 +111,6 @@ public class LateralTCPCacheAttributes
     /** Default receive setting */
     private static final boolean DEFAULT_RECEIVE = true;
 
-    /** Disables gets from laterals */
-    private boolean putOnlyMode = true;
-
     /**
      * do we receive and broadcast or only broadcast this is useful when you 
don't want to get any
      * notifications
@@ -342,17 +339,17 @@ public class LateralTCPCacheAttributes
     /**
      * @param openTimeOut the openTimeOut to set
      */
-    public void setOpenTimeOut( final int openTimeOut )
+    public void setOpenTimeOut( final Duration openTimeOut )
     {
-        this.openTimeOut = Duration.ofMillis(openTimeOut);
+        this.openTimeOut = openTimeOut;
     }
 
     /**
      * @param socketTimeOut the socketTimeOut to set
      */
-    public void setSocketTimeOut( final int socketTimeOut )
+    public void setSocketTimeOut( final Duration socketTimeOut )
     {
-        this.socketTimeOut = Duration.ofMillis(socketTimeOut);
+        this.socketTimeOut = socketTimeOut;
     }
 
     /**
@@ -448,15 +445,6 @@ public class LateralTCPCacheAttributes
         this.udpTTL = udpTTL;
     }
 
-    /**
-     * @return The outgoingOnlyMode value. Stops gets from going remote.
-     */
-    @Override
-    public boolean getPutOnlyMode()
-    {
-        return putOnlyMode;
-    }
-
     /**
      * The number of elements the zombie queue will hold. This queue is used 
to store events if we
      * loose our connection with the server.
@@ -478,17 +466,6 @@ public class LateralTCPCacheAttributes
         return receive;
     }
 
-    /**
-     * Sets the outgoingOnlyMode attribute of the ILateralCacheAttributes. 
When this is true the
-     * lateral cache will only issue put and remove order and will not try to 
retrieve elements from
-     * other lateral caches.
-     * @param val The new transmissionTypeName value
-     */
-    public void setPutOnlyMode( final boolean val )
-    {
-        this.putOnlyMode = val;
-    }
-
     /**
      * @param receive The receive to set.
      */
diff --git 
a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/LateralTCPService.java
 
b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/LateralTCPService.java
index 42f6ac39..52c79820 100644
--- 
a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/LateralTCPService.java
+++ 
b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/LateralTCPService.java
@@ -204,7 +204,8 @@ public class LateralTCPService<K, V>
         throws IOException
     {
         // if get is not allowed return
-        if ( !this.allowGet ) {
+        if ( !this.allowGet )
+        {
             // nothing needs to be done
             return null;
         }
diff --git 
a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/behavior/ILateralTCPCacheAttributes.java
 
b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/behavior/ILateralTCPCacheAttributes.java
index 7abe1836..53ec9983 100644
--- 
a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/behavior/ILateralTCPCacheAttributes.java
+++ 
b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/behavior/ILateralTCPCacheAttributes.java
@@ -147,11 +147,6 @@ public interface ILateralTCPCacheAttributes
      */
     boolean isUdpDiscoveryEnabled();
 
-    /**
-     * @return The outgoingOnlyMode value. Stops gets from going remote.
-     */
-    boolean getPutOnlyMode();
-
     /**
      * The number of elements the zombie queue will hold. This queue is used 
to store events if we
      * loose our connection with the server.
diff --git a/commons-jcs4-core/src/test/test-conf/TestTCPLateralCache.ccf 
b/commons-jcs4-core/src/test/test-conf/TestTCPLateralCache.ccf
index 553d6464..a10b3b99 100644
--- a/commons-jcs4-core/src/test/test-conf/TestTCPLateralCache.ccf
+++ b/commons-jcs4-core/src/test/test-conf/TestTCPLateralCache.ccf
@@ -35,8 +35,8 @@ jcs.auxiliary.LTCP.attributes.TcpServers=localhost:1111
 jcs.auxiliary.LTCP.attributes.TcpListenerPort=1110
 jcs.auxiliary.LTCP.attributes.TcpListenerHost=localhost
 jcs.auxiliary.LTCP.attributes.AllowGet=false
-jcs.auxiliary.LTCP.attributes.SocketTimeOut=1001
-jcs.auxiliary.LTCP.attributes.OpenTimeOut=2002
+jcs.auxiliary.LTCP.attributes.SocketTimeOut=PT1.001s
+jcs.auxiliary.LTCP.attributes.OpenTimeOut=PT2.002s
 
 # #############################################################
 # ################# THREAD POOL CONFIGURATION ###################
diff --git a/src/site/xdoc/LateralTCPAuxCache.xml 
b/src/site/xdoc/LateralTCPAuxCache.xml
index 6236c89d..d0f00e06 100644
--- a/src/site/xdoc/LateralTCPAuxCache.xml
+++ b/src/site/xdoc/LateralTCPAuxCache.xml
@@ -76,7 +76,7 @@ jcs.auxiliary.LTCP.attributes.AllowGet=true
         <p>
                  A mostly configurationless mode is available for the TCP
                  lateral cache if you use the <a 
href="LateralUDPDiscovery.html">UDP Discovery</a>
-                  mechanism.
+                 mechanism.
         </p>
       </subsection>
       <subsection name="Send Only Configuration">
diff --git a/src/site/xdoc/LateralTCPProperties.xml 
b/src/site/xdoc/LateralTCPProperties.xml
index 04ffd8c3..5ea2cfa7 100644
--- a/src/site/xdoc/LateralTCPProperties.xml
+++ b/src/site/xdoc/LateralTCPProperties.xml
@@ -54,11 +54,18 @@
                                                <td> Should this cache be 
allowed to get from other laterals.
                                                        False means that it can 
only put, i.e. send updates and remove
                                                        requests to other 
laterals. Lateral gets are not recommended for
-                                                       performance reasons. 
This used to be controlled by the attribute
-                                                       PutOnlyMode.</td>
+                                                       performance 
reasons.</td>
                                                <td>N</td>
                                                <td>true</td>
                                        </tr>
+                    <tr>
+                        <td>AllowPut</td>
+                        <td> Should this cache be allowed to put to other 
laterals.
+                            False means that it can only get. Lateral gets are 
not recommended 
+                            for performance reasons.</td>
+                        <td>N</td>
+                        <td>true</td>
+                    </tr>
                                        <tr>
                                                <td>Receive</td>
                                                <td> Should this cache receive 
or only send to other laterals. You
@@ -92,13 +99,13 @@
                                                <td>SocketTimeOut</td>
                                                <td> This allows you to set the 
socket (read) timeout.</td>
                                                <td>N</td>
-                                               <td>1000</td>
+                                               <td>PT1s</td>
                                        </tr>
                                        <tr>
                                                <td>OpenTimeOut</td>
                                                <td> This allows you to set the 
socket open timeout.</td>
                                                <td>N</td>
-                                               <td>2000</td>
+                                               <td>PT2s</td>
                                        </tr>
                                        <tr>
                                                <td>UdpDiscoveryAddr</td>
diff --git a/src/site/xdoc/UpgradingFrom3x.xml 
b/src/site/xdoc/UpgradingFrom3x.xml
index 78d8ed91..a286f48d 100644
--- a/src/site/xdoc/UpgradingFrom3x.xml
+++ b/src/site/xdoc/UpgradingFrom3x.xml
@@ -230,12 +230,22 @@ java.util.logging.SimpleFormatter.format=[%1$tF %1$tT] 
%3$s [%4$-7s] %5$s %n
             <tr>
               <td>Thread Pool Configuration (thread_pool, 
PoolConfiguration)</td>
               <td>keepAliveTime</td>
-              <td>PT5M</td>
+              <td>PT5m</td>
             </tr>
             <tr>
               <td>JDBC Disk Cache configuration (JDBCDiskCacheAttributes)</td>
               <td>ShrinkerInterval</td>
-              <td>PT5M</td>
+              <td>PT5m</td>
+            </tr>
+            <tr>
+              <td>Lateral TCP Cache configuration 
(LateralTCPCacheAttributes)</td>
+              <td>SocketTimeOut</td>
+              <td>PT1s</td>
+            </tr>
+            <tr>
+              <td></td>
+              <td>OpenTimeOut</td>
+              <td>PT2s</td>
             </tr>
           </table>
         </p>

Reply via email to