From ca57d6ca9f260c6332d0bf0ab3ff37c476ec9fb3 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Mon, 18 Mar 2013 17:06:12 +0000
Subject: [PATCH] OPENDJ-808 Implement a simple commons REST based HTTP connection handler
---
opends/src/server/org/opends/server/protocols/ldap/LDAPConnectionHandler.java | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/opends/src/server/org/opends/server/protocols/ldap/LDAPConnectionHandler.java b/opends/src/server/org/opends/server/protocols/ldap/LDAPConnectionHandler.java
index bb65828..62ce09b 100644
--- a/opends/src/server/org/opends/server/protocols/ldap/LDAPConnectionHandler.java
+++ b/opends/src/server/org/opends/server/protocols/ldap/LDAPConnectionHandler.java
@@ -171,12 +171,12 @@
private boolean enabled;
/** The set of clients that are explicitly allowed access to the server. */
- private AddressMask[] allowedClients;
+ private Collection<AddressMask> allowedClients;
/**
* The set of clients that have been explicitly denied access to the server.
*/
- private AddressMask[] deniedClients;
+ private Collection<AddressMask> deniedClients;
/**
* The index to the request handler that will be used for the next connection
@@ -348,8 +348,8 @@
// Apply the changes.
currentConfig = config;
enabled = config.isEnabled();
- allowedClients = config.getAllowedClient().toArray(new AddressMask[0]);
- deniedClients = config.getDeniedClient().toArray(new AddressMask[0]);
+ allowedClients = config.getAllowedClient();
+ deniedClients = config.getDeniedClient();
// Reconfigure SSL if needed.
protocol = config.isUseSSL() ? "LDAPS" : "LDAP";
@@ -712,8 +712,8 @@
currentConfig = config;
enabled = config.isEnabled();
requestHandlerIndex = 0;
- allowedClients = config.getAllowedClient().toArray(new AddressMask[0]);
- deniedClients = config.getDeniedClient().toArray(new AddressMask[0]);
+ allowedClients = config.getAllowedClient();
+ deniedClients = config.getDeniedClient();
// Configure SSL if needed.
protocol = config.isUseSSL() ? "LDAPS" : "LDAP";
@@ -1251,7 +1251,7 @@
InetAddress clientAddr = clientConnection.getRemoteAddress();
// Check to see if the client is on the denied list.
// If so, then reject it immediately.
- if ((deniedClients.length > 0)
+ if ((!deniedClients.isEmpty())
&& AddressMask.maskListContains(clientAddr, deniedClients))
{
clientConnection.disconnect(
@@ -1265,7 +1265,7 @@
// Check to see if there is an allowed list and if
// there is whether the client is on that list. If
// not, then reject the connection.
- if ((allowedClients.length > 0)
+ if ((!allowedClients.isEmpty())
&& (!AddressMask.maskListContains(clientAddr, allowedClients)))
{
clientConnection.disconnect(
--
Gitblit v1.10.0