From bf42203d7acafc7f0e859e971afd6ff95fb6a9a5 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Thu, 21 Mar 2013 11:43:51 +0000
Subject: [PATCH] OPENDJ-808 Implement a simple commons REST based HTTP connection handler
---
opendj-sdk/opends/src/server/org/opends/server/protocols/http/CollectClientConnectionsFilter.java | 6 +++---
opendj-sdk/opends/src/server/org/opends/server/protocols/http/HTTPConnectionHandler.java | 8 ++++----
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/opendj-sdk/opends/src/server/org/opends/server/protocols/http/CollectClientConnectionsFilter.java b/opendj-sdk/opends/src/server/org/opends/server/protocols/http/CollectClientConnectionsFilter.java
index b25bbfe..8b3dd12 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/protocols/http/CollectClientConnectionsFilter.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/protocols/http/CollectClientConnectionsFilter.java
@@ -61,7 +61,7 @@
/** The connection handler that created this servlet filter. */
private HTTPConnectionHandler connectionHandler;
- private final Map<ClientConnection, Void> clientConnections;
+ private final Map<ClientConnection, ClientConnection> clientConnections;
/**
* Constructs a new instance of this class.
@@ -73,7 +73,7 @@
*/
public CollectClientConnectionsFilter(
HTTPConnectionHandler connectionHandler,
- Map<ClientConnection, Void> clientConnections)
+ Map<ClientConnection, ClientConnection> clientConnections)
{
this.connectionHandler = connectionHandler;
this.clientConnections = clientConnections;
@@ -93,7 +93,7 @@
{
final ClientConnection clientConnection =
new HTTPClientConnection(this.connectionHandler, request);
- this.clientConnections.put(clientConnection, null);
+ this.clientConnections.put(clientConnection, clientConnection);
try
{
String ipAddress = request.getRemoteAddr();
diff --git a/opendj-sdk/opends/src/server/org/opends/server/protocols/http/HTTPConnectionHandler.java b/opendj-sdk/opends/src/server/org/opends/server/protocols/http/HTTPConnectionHandler.java
index 892b866..8c32c84 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/protocols/http/HTTPConnectionHandler.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/protocols/http/HTTPConnectionHandler.java
@@ -143,11 +143,11 @@
/**
* Holds the current client connections. Using {@link ConcurrentHashMap} to
- * ensure no concurrent reads/writes can happen and adds/removes are fast.
- * Using Void for the value since it has no use.
+ * ensure no concurrent reads/writes can happen and adds/removes are fast. We
+ * only use the keys, so it does not matter what value is put there.
*/
- private Map<ClientConnection, Void> clientConnections =
- new ConcurrentHashMap<ClientConnection, Void>();
+ private Map<ClientConnection, ClientConnection> clientConnections =
+ new ConcurrentHashMap<ClientConnection, ClientConnection>();
/** The unique name assigned to this connection handler. */
private String handlerName;
--
Gitblit v1.10.0