From 282288d61ff6180e6798948e3aaa49271e306e70 Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Mon, 30 Jul 2007 06:26:11 +0000
Subject: [PATCH] Update the server to provide an idle time limit configuration option that can be used to terminate client connections that have been idle for too long. This can be controlled on a server-wide default level using the ds-cfg-idle-time-limit configuration attribute in the cn=config entry, but it can also be overridden on a per-user level with the ds-rlim-idle-time-limit operational attribute in the user's entry.
---
opends/src/server/org/opends/server/core/DirectoryServer.java | 34 ++++++++++++++++++++++++++++++++++
1 files changed, 34 insertions(+), 0 deletions(-)
diff --git a/opends/src/server/org/opends/server/core/DirectoryServer.java b/opends/src/server/org/opends/server/core/DirectoryServer.java
index 78ffd8b..4d56604 100644
--- a/opends/src/server/org/opends/server/core/DirectoryServer.java
+++ b/opends/src/server/org/opends/server/core/DirectoryServer.java
@@ -463,6 +463,9 @@
// The number of connections currently established to the server.
private long currentConnections;
+ // The idle time limit for the server.
+ private long idleTimeLimit;
+
// The maximum number of connections that will be allowed at any given time.
private long maxAllowedConnections;
@@ -731,6 +734,7 @@
directoryServer.allowedTasks = new LinkedHashSet<String>(0);
directoryServer.disabledPrivileges = new LinkedHashSet<Privilege>(0);
directoryServer.returnBindErrorMessages = false;
+ directoryServer.idleTimeLimit = 0L;
}
@@ -1204,6 +1208,7 @@
if (startConnectionHandlers)
{
startConnectionHandlers();
+ new IdleTimeLimitThread().start();
}
@@ -7526,6 +7531,35 @@
/**
+ * Retrieves the maximum length of time in milliseconds that client
+ * connections should be allowed to remain idle without being disconnected.
+ *
+ * @return The maximum length of time in milliseconds that client connections
+ * should be allowed to remain idle without being disconnected.
+ */
+ public static long getIdleTimeLimit()
+ {
+ return directoryServer.idleTimeLimit;
+ }
+
+
+
+ /**
+ * Specifies the maximum length of time in milliseconds that client
+ * connections should be allowed to remain idle without being disconnected.
+ *
+ * @param idleTimeLimit The maximum length of time in milliseconds that
+ * client connections should be allowed to remain idle
+ * without being disconnected.
+ */
+ public static void setIdleTimeLimit(long idleTimeLimit)
+ {
+ directoryServer.idleTimeLimit = idleTimeLimit;
+ }
+
+
+
+ /**
* Registers the provided backup task listener with the Directory Server.
*
* @param listener The backup task listener to register with the Directory
--
Gitblit v1.10.0