From 550e5feae27507412b2715bfdefa8f23f975a164 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Wed, 10 Jul 2013 08:05:32 +0000
Subject: [PATCH] *.java: Replaced collection concrete classes with interfaces. Used javadocs instead of line comments.
---
opendj-sdk/opends/src/server/org/opends/server/core/DirectoryServer.java | 84 ++++++++--------
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/TestLDAPConnectionHandler.java | 16 +-
opendj-sdk/opends/src/server/org/opends/server/config/JMXMBean.java | 69 +++++++------
opendj-sdk/opends/src/server/org/opends/server/api/AlertGenerator.java | 5
opendj-sdk/opends/src/server/org/opends/server/protocols/jmx/JmxConnectionHandler.java | 28 +++--
opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/LDAPConnectionHandler.java | 4
opendj-sdk/opends/src/server/org/opends/server/protocols/http/HTTPConnectionHandler.java | 4
opendj-sdk/opends/src/server/org/opends/server/backends/SchemaBackend.java | 4
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/BackendImpl.java | 55 ++++++-----
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/backends/SchemaBackendTestCase.java | 13 +-
10 files changed, 148 insertions(+), 134 deletions(-)
diff --git a/opendj-sdk/opends/src/server/org/opends/server/api/AlertGenerator.java b/opendj-sdk/opends/src/server/org/opends/server/api/AlertGenerator.java
index 02d3f55..d99ea17 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/api/AlertGenerator.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/api/AlertGenerator.java
@@ -23,12 +23,13 @@
*
*
* Copyright 2006-2008 Sun Microsystems, Inc.
+ * Portions Copyright 2013 ForgeRock AS
*/
package org.opends.server.api;
-import java.util.LinkedHashMap;
+import java.util.Map;
import org.opends.server.types.DN;
@@ -80,6 +81,6 @@
* @return Information about the set of alerts that this generator
* may produce.
*/
- public LinkedHashMap<String,String> getAlerts();
+ public Map<String, String> getAlerts();
}
diff --git a/opendj-sdk/opends/src/server/org/opends/server/backends/SchemaBackend.java b/opendj-sdk/opends/src/server/org/opends/server/backends/SchemaBackend.java
index 7061048..23aa92d 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/backends/SchemaBackend.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/backends/SchemaBackend.java
@@ -5934,9 +5934,9 @@
* {@inheritDoc}
*/
@Override
- public LinkedHashMap<String,String> getAlerts()
+ public Map<String, String> getAlerts()
{
- LinkedHashMap<String,String> alerts = new LinkedHashMap<String,String>();
+ Map<String, String> alerts = new LinkedHashMap<String, String>();
alerts.put(ALERT_TYPE_CANNOT_COPY_SCHEMA_FILES,
ALERT_DESCRIPTION_CANNOT_COPY_SCHEMA_FILES);
diff --git a/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/BackendImpl.java b/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/BackendImpl.java
index 8f9ef2a..39fdada 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/BackendImpl.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/BackendImpl.java
@@ -26,17 +26,16 @@
* Portions Copyright 2013 ForgeRock AS
*/
package org.opends.server.backends.jeb;
-import org.opends.messages.Message;
-import java.io.IOException;
import java.io.File;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.TimeUnit;
-
import java.io.FileInputStream;
import java.io.FilenameFilter;
+import java.io.IOException;
import java.util.*;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.logging.Level;
import java.util.zip.Adler32;
import java.util.zip.CheckedInputStream;
@@ -45,14 +44,16 @@
import com.sleepycat.je.EnvironmentConfig;
import com.sleepycat.je.EnvironmentFailureException;
-import java.util.logging.Level;
-
-import org.opends.server.api.DiskSpaceMonitorHandler;
-import org.opends.server.backends.jeb.importLDIF.*;
+import org.opends.messages.Message;
+import org.opends.server.admin.Configuration;
+import org.opends.server.admin.server.ConfigurationChangeListener;
import org.opends.server.admin.std.meta.LocalDBIndexCfgDefn;
-import org.opends.server.api.Backend;
-import org.opends.server.api.MonitorProvider;
+import org.opends.server.admin.std.server.LocalDBBackendCfg;
import org.opends.server.api.AlertGenerator;
+import org.opends.server.api.Backend;
+import org.opends.server.api.DiskSpaceMonitorHandler;
+import org.opends.server.api.MonitorProvider;
+import org.opends.server.backends.jeb.importLDIF.Importer;
import org.opends.server.config.ConfigException;
import org.opends.server.core.AddOperation;
import org.opends.server.core.DeleteOperation;
@@ -61,23 +62,18 @@
import org.opends.server.core.ModifyDNOperation;
import org.opends.server.core.SearchOperation;
import org.opends.server.extensions.DiskSpaceMonitor;
+import org.opends.server.loggers.debug.DebugTracer;
+import org.opends.server.types.*;
import org.opends.server.util.LDIFException;
import org.opends.server.util.RuntimeInformation;
import org.opends.server.util.Validator;
-import static org.opends.server.util.StaticUtils.*;
import static org.opends.messages.BackendMessages.*;
import static org.opends.messages.JebMessages.*;
-import static org.opends.server.loggers.ErrorLogger.logError;
+import static org.opends.server.loggers.ErrorLogger.*;
import static org.opends.server.loggers.debug.DebugLogger.*;
-import org.opends.server.loggers.debug.DebugTracer;
-import org.opends.server.types.*;
-
import static org.opends.server.util.ServerConstants.*;
-import org.opends.server.admin.std.server.LocalDBBackendCfg;
-import org.opends.server.admin.Configuration;
-import org.opends.server.admin.server.ConfigurationChangeListener;
-import org.opends.server.types.DN;
+import static org.opends.server.util.StaticUtils.*;
/**
* This is an implementation of a Directory Server Backend which stores entries
@@ -241,6 +237,7 @@
{
jdbFiles =
Arrays.asList(backendDirectory.listFiles(new FilenameFilter() {
+ @Override
public boolean accept(File dir, String name) {
return name.endsWith(".jdb");
}
@@ -918,8 +915,7 @@
// FIXME: No reason why we cannot implement a move between containers
// since the containers share the same database environment.
Message msg = WARN_JEB_FUNCTION_NOT_SUPPORTED.get();
- throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM,
- msg);
+ throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, msg);
}
currentContainer.sharedLock.lock();
@@ -1512,6 +1508,7 @@
/**
* {@inheritDoc}
*/
+ @Override
public boolean isConfigurationChangeAcceptable(
LocalDBBackendCfg cfg,
List<Message> unacceptableReasons)
@@ -1535,6 +1532,7 @@
/**
* {@inheritDoc}
*/
+ @Override
public ConfigChangeResult applyConfigurationChange(LocalDBBackendCfg newCfg)
{
ConfigChangeResult ccr;
@@ -1712,6 +1710,7 @@
/**
* {@inheritDoc}
*/
+ @Override
public String getClassName() {
return CLASS_NAME;
}
@@ -1719,8 +1718,10 @@
/**
* {@inheritDoc}
*/
- public LinkedHashMap<String, String> getAlerts() {
- LinkedHashMap<String, String> alerts = new LinkedHashMap<String, String>();
+ @Override
+ public Map<String, String> getAlerts()
+ {
+ Map<String, String> alerts = new LinkedHashMap<String, String>();
alerts.put(ALERT_TYPE_BACKEND_ENVIRONMENT_UNUSABLE,
ALERT_DESCRIPTION_BACKEND_ENVIRONMENT_UNUSABLE);
@@ -1734,6 +1735,7 @@
/**
* {@inheritDoc}
*/
+ @Override
public DN getComponentEntryDN() {
return cfg.dn();
}
@@ -1769,6 +1771,7 @@
/**
* {@inheritDoc}
*/
+ @Override
public void diskLowThresholdReached(DiskSpaceMonitor monitor) {
Message msg = ERR_JEB_DISK_LOW_THRESHOLD_REACHED.get(
monitor.getDirectory().getPath(), cfg.getBackendId(),
@@ -1781,6 +1784,7 @@
/**
* {@inheritDoc}
*/
+ @Override
public void diskFullThresholdReached(DiskSpaceMonitor monitor) {
Message msg = ERR_JEB_DISK_FULL_THRESHOLD_REACHED.get(
monitor.getDirectory().getPath(), cfg.getBackendId(),
@@ -1793,6 +1797,7 @@
/**
* {@inheritDoc}
*/
+ @Override
public void diskSpaceRestored(DiskSpaceMonitor monitor) {
Message msg = NOTE_JEB_DISK_SPACE_RESTORED.get(monitor.getFreeSpace(),
monitor.getDirectory().getPath(), cfg.getBackendId(),
diff --git a/opendj-sdk/opends/src/server/org/opends/server/config/JMXMBean.java b/opendj-sdk/opends/src/server/org/opends/server/config/JMXMBean.java
index ac7bf5e..d505ebe 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/config/JMXMBean.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/config/JMXMBean.java
@@ -23,17 +23,17 @@
*
*
* Portions Copyright 2006-2007-2008 Sun Microsystems, Inc.
+ * Portions Copyright 2013 ForgeRock AS
*/
package org.opends.server.config;
-import org.opends.messages.Message;
-
-
import java.util.ArrayList;
import java.util.Iterator;
-import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArrayList;
+
import javax.management.Attribute;
import javax.management.AttributeList;
import javax.management.AttributeNotFoundException;
@@ -48,6 +48,7 @@
import javax.management.MBeanServer;
import javax.management.ObjectName;
+import org.opends.messages.Message;
import org.opends.server.admin.std.server.MonitorProviderCfg;
import org.opends.server.api.AlertGenerator;
import org.opends.server.api.ClientConnection;
@@ -55,19 +56,19 @@
import org.opends.server.api.InvokableComponent;
import org.opends.server.api.MonitorProvider;
import org.opends.server.core.DirectoryServer;
-import org.opends.server.protocols.jmx.Credential;
-
-import static org.opends.server.loggers.debug.DebugLogger.*;
-import static org.opends.server.loggers.ErrorLogger.*;
import org.opends.server.loggers.debug.DebugTracer;
+import org.opends.server.protocols.internal.InternalClientConnection;
+import org.opends.server.protocols.internal.InternalSearchOperation;
+import org.opends.server.protocols.jmx.Credential;
+import org.opends.server.protocols.jmx.JmxClientConnection;
+import org.opends.server.protocols.ldap.LDAPFilter;
+import org.opends.server.types.*;
+
import static org.opends.messages.ConfigMessages.*;
+import static org.opends.server.loggers.ErrorLogger.*;
+import static org.opends.server.loggers.debug.DebugLogger.*;
import static org.opends.server.util.ServerConstants.*;
import static org.opends.server.util.StaticUtils.*;
-import org.opends.server.protocols.jmx.JmxClientConnection;
-import org.opends.server.protocols.internal.InternalClientConnection;
-import org.opends.server.protocols.ldap.LDAPFilter;
-import org.opends.server.protocols.internal.InternalSearchOperation ;
-import org.opends.server.types.*;
/**
@@ -96,20 +97,19 @@
- // The set of alert generators for this MBean.
- private CopyOnWriteArrayList<AlertGenerator> alertGenerators;
+ /** The set of alert generators for this MBean. */
+ private List<AlertGenerator> alertGenerators;
- // The set of invokable components for this MBean.
- private CopyOnWriteArrayList<InvokableComponent> invokableComponents;
+ /** The set of invokable components for this MBean. */
+ private List<InvokableComponent> invokableComponents;
- // The set of monitor providers for this MBean.
- private CopyOnWriteArrayList<MonitorProvider<? extends MonitorProviderCfg>>
- monitorProviders;
+ /** The set of monitor providers for this MBean. */
+ private List<MonitorProvider<? extends MonitorProviderCfg>> monitorProviders;
- // The DN of the configuration entry with which this MBean is associated.
+ /** The DN of the configuration entry with which this MBean is associated. */
private DN configEntryDN;
- // The object name for this MBean.
+ /** The object name for this MBean. */
private ObjectName objectName;
@@ -237,6 +237,7 @@
*
* @return The JMX object name for this JMX MBean.
*/
+ @Override
public ObjectName getObjectName()
{
return objectName;
@@ -249,7 +250,7 @@
*
* @return The set of alert generators for this JMX MBean.
*/
- public CopyOnWriteArrayList<AlertGenerator> getAlertGenerators()
+ public List<AlertGenerator> getAlertGenerators()
{
return alertGenerators;
}
@@ -301,7 +302,7 @@
*
* @return The set of invokable components associated with this JMX MBean.
*/
- public CopyOnWriteArrayList<InvokableComponent> getInvokableComponents()
+ public List<InvokableComponent> getInvokableComponents()
{
return invokableComponents;
}
@@ -353,7 +354,7 @@
*
* @return The set of monitor providers associated with this JMX MBean.
*/
- public CopyOnWriteArrayList<MonitorProvider<? extends MonitorProviderCfg>>
+ public List<MonitorProvider<? extends MonitorProviderCfg>>
getMonitorProviders()
{
return monitorProviders;
@@ -437,7 +438,7 @@
if (iterator.hasNext())
{
- ArrayList<String> stringValues = new ArrayList<String>();
+ List<String> stringValues = new ArrayList<String>();
stringValues.add(value.getValue().toString());
while (iterator.hasNext())
@@ -473,6 +474,7 @@
* @throws AttributeNotFoundException If the specified attribute is not
* associated with this MBean.
*/
+ @Override
public Attribute getAttribute(String attributeName)
throws AttributeNotFoundException
{
@@ -563,6 +565,7 @@
* @throws InvalidAttributeValueException If the provided value is not
* acceptable for this MBean.
*/
+ @Override
public void setAttribute(javax.management.Attribute attribute)
throws AttributeNotFoundException, InvalidAttributeValueException
{
@@ -576,6 +579,7 @@
*
* @return The list of attributes retrieved.
*/
+ @Override
public AttributeList getAttributes(String[] attributes)
{
@@ -670,7 +674,7 @@
if (iterator.hasNext())
{
- ArrayList<String> stringValues = new ArrayList<String>();
+ List<String> stringValues = new ArrayList<String>();
stringValues.add(value.getValue().toString());
while (iterator.hasNext())
@@ -709,6 +713,7 @@
* this case, the list will always be empty because we do not support
* setting attribute values over JMX.
*/
+ @Override
public AttributeList setAttributes(AttributeList attributes)
{
return new AttributeList();
@@ -733,6 +738,7 @@
* @throws MBeanException If a problem is encountered while invoking the
* method.
*/
+ @Override
public Object invoke(String actionName, Object[] params, String[] signature)
throws MBeanException
{
@@ -803,6 +809,7 @@
* @return An instance of <CODE>MBeanInfo</CODE> allowing all attributes and
* actions exposed by this Dynamic MBean to be retrieved.
*/
+ @Override
public MBeanInfo getMBeanInfo()
{
ClientConnection clientConnection = getClientConnection();
@@ -811,7 +818,7 @@
return new MBeanInfo(CLASS_NAME, null, null, null, null, null);
}
- ArrayList<MBeanAttributeInfo> attrs = new ArrayList<MBeanAttributeInfo>();
+ List<MBeanAttributeInfo> attrs = new ArrayList<MBeanAttributeInfo>();
for (MonitorProvider<? extends MonitorProviderCfg> monitor :
monitorProviders)
{
@@ -826,13 +833,13 @@
attrs.toArray(mBeanAttributes);
- ArrayList<MBeanNotificationInfo> notifications =
+ List<MBeanNotificationInfo> notifications =
new ArrayList<MBeanNotificationInfo>();
for (AlertGenerator generator : alertGenerators)
{
String className = generator.getClassName();
- LinkedHashMap<String,String> alerts = generator.getAlerts();
+ Map<String, String> alerts = generator.getAlerts();
for (String type : alerts.keySet())
{
String[] types = { type };
@@ -848,7 +855,7 @@
notifications.toArray(mBeanNotifications);
- ArrayList<MBeanOperationInfo> ops = new ArrayList<MBeanOperationInfo>();
+ List<MBeanOperationInfo> ops = new ArrayList<MBeanOperationInfo>();
for (InvokableComponent component : invokableComponents)
{
for (InvokableMethod method : component.getOperationSignatures())
diff --git a/opendj-sdk/opends/src/server/org/opends/server/core/DirectoryServer.java b/opendj-sdk/opends/src/server/org/opends/server/core/DirectoryServer.java
index e950d76..7f65dbd 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/core/DirectoryServer.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/core/DirectoryServer.java
@@ -46,6 +46,7 @@
import java.text.DecimalFormat;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.CopyOnWriteArraySet;
import java.util.concurrent.atomic.AtomicInteger;
@@ -283,20 +284,20 @@
private ConfigHandler configHandler;
/** The set of account status notification handlers defined in the server. */
- private ConcurrentHashMap<DN,AccountStatusNotificationHandler>
+ private ConcurrentMap<DN, AccountStatusNotificationHandler>
accountStatusNotificationHandlers;
/** The set of certificate mappers registered with the server. */
- private ConcurrentHashMap<DN,CertificateMapper> certificateMappers;
+ private ConcurrentMap<DN, CertificateMapper> certificateMappers;
/** The set of alternate bind DNs for the root users. */
- private ConcurrentHashMap<DN,DN> alternateRootBindDNs;
+ private ConcurrentMap<DN, DN> alternateRootBindDNs;
/**
* The set of identity mappers registered with the server (mapped between the
* configuration entry Dn and the mapper).
*/
- private ConcurrentHashMap<DN,IdentityMapper> identityMappers;
+ private ConcurrentMap<DN, IdentityMapper> identityMappers;
/**
* The set of JMX MBeans that have been registered with the server (mapped
@@ -305,67 +306,67 @@
private ConcurrentHashMap<DN,JMXMBean> mBeans;
/** The set of key manager providers registered with the server. */
- private ConcurrentHashMap<DN,KeyManagerProvider> keyManagerProviders;
+ private ConcurrentMap<DN, KeyManagerProvider> keyManagerProviders;
/** The set of extensions registered with the server. */
- private ConcurrentHashMap<DN,Extension> extensions;
+ private ConcurrentMap<DN, Extension> extensions;
/**
* The set of password generators registered with the Directory Server, as a
* mapping between the DN of the associated configuration entry and the
* generator implementation.
*/
- private ConcurrentHashMap<DN,PasswordGenerator> passwordGenerators;
+ private ConcurrentMap<DN, PasswordGenerator> passwordGenerators;
/**
* The set of authentication policies registered with the Directory Server, as
* a mapping between the DN of the associated configuration entry and the
* policy implementation.
*/
- private ConcurrentHashMap<DN,AuthenticationPolicy> authenticationPolicies;
+ private ConcurrentMap<DN, AuthenticationPolicy> authenticationPolicies;
/**
* The set of password validators registered with the Directory Server, as a
* mapping between the DN of the associated configuration entry and the
* validator implementation.
*/
- private ConcurrentHashMap<DN,
+ private ConcurrentMap<DN,
PasswordValidator<? extends PasswordValidatorCfg>>
passwordValidators;
/** The set of trust manager providers registered with the server. */
- private ConcurrentHashMap<DN,TrustManagerProvider> trustManagerProviders;
+ private ConcurrentMap<DN, TrustManagerProvider> trustManagerProviders;
/**
* The set of log rotation policies registered with the Directory Server, as a
* mapping between the DN of the associated configuration entry and the policy
* implementation.
*/
- private ConcurrentHashMap<DN, RotationPolicy> rotationPolicies;
+ private ConcurrentMap<DN, RotationPolicy> rotationPolicies;
/**
* The set of log retention policies registered with the Directory Server, as
* a mapping between the DN of the associated configuration entry and the
* policy implementation.
*/
- private ConcurrentHashMap<DN, RetentionPolicy> retentionPolicies;
+ private ConcurrentMap<DN, RetentionPolicy> retentionPolicies;
/** The set supported LDAP protocol versions. */
- private ConcurrentHashMap<Integer,List<ConnectionHandler>>
+ private ConcurrentMap<Integer, List<ConnectionHandler>>
supportedLDAPVersions;
/**
* The set of extended operation handlers registered with the server (mapped
* between the OID of the extended operation and the handler).
*/
- private ConcurrentHashMap<String,ExtendedOperationHandler>
+ private ConcurrentMap<String, ExtendedOperationHandler>
extendedOperationHandlers;
/**
* The set of monitor providers registered with the Directory Server, as a
* mapping between the monitor name and the corresponding implementation.
*/
- private ConcurrentHashMap<String,
+ private ConcurrentMap<String,
MonitorProvider<? extends MonitorProviderCfg>>
monitorProviders;
@@ -388,14 +389,14 @@
* The set of password storage schemes defined in the server (mapped between
* the DN of the configuration entry and the storage scheme).
*/
- private ConcurrentHashMap<DN,PasswordStorageScheme>
+ private ConcurrentMap<DN, PasswordStorageScheme>
passwordStorageSchemesByDN;
/**
* The set of SASL mechanism handlers registered with the server (mapped
* between the mechanism name and the handler).
*/
- private ConcurrentHashMap<String,SASLMechanismHandler> saslMechanismHandlers;
+ private ConcurrentMap<String, SASLMechanismHandler> saslMechanismHandlers;
/** The connection handler configuration manager for the Directory Server. */
private ConnectionHandlerConfigManager connectionHandlerConfigManager;
@@ -660,7 +661,7 @@
* state, representing either checksum or other unique value to be used for
* detecting any offline modifications to a given backend.
*/
- private ConcurrentHashMap<String,Long> offlineBackendsStateIDs;
+ private ConcurrentMap<String, Long> offlineBackendsStateIDs;
/** The set of supported controls registered with the Directory Server. */
private TreeSet<String> supportedControls;
@@ -689,7 +690,7 @@
* The mappings between the names and WorkflowElements registered with the
* Directory Server.
*/
- private final ConcurrentHashMap<String, WorkflowElement> workflowElements =
+ private final ConcurrentMap<String, WorkflowElement> workflowElements =
new ConcurrentHashMap<String, WorkflowElement>();
/** The workflow configuration mode (auto or manual). */
@@ -3041,7 +3042,7 @@
*
* @return The set of matching rules registered with the Directory Server.
*/
- public static ConcurrentHashMap<String,MatchingRule> getMatchingRules()
+ public static ConcurrentMap<String, MatchingRule> getMatchingRules()
{
return directoryServer.schema.getMatchingRules();
}
@@ -3123,7 +3124,7 @@
* @return The set of approximate matching rules registered with the
* Directory Server.
*/
- public static ConcurrentHashMap<String,ApproximateMatchingRule>
+ public static ConcurrentMap<String, ApproximateMatchingRule>
getApproximateMatchingRules()
{
return directoryServer.schema.getApproximateMatchingRules();
@@ -3197,7 +3198,7 @@
* @return The set of equality matching rules registered with the Directory
* Server.
*/
- public static ConcurrentHashMap<String,EqualityMatchingRule>
+ public static ConcurrentMap<String, EqualityMatchingRule>
getEqualityMatchingRules()
{
return directoryServer.schema.getEqualityMatchingRules();
@@ -3268,7 +3269,7 @@
* @return The set of ordering matching rules registered with the Directory
* Server.
*/
- public static ConcurrentHashMap<String,OrderingMatchingRule>
+ public static ConcurrentMap<String, OrderingMatchingRule>
getOrderingMatchingRules()
{
return directoryServer.schema.getOrderingMatchingRules();
@@ -3339,7 +3340,7 @@
* @return The set of substring matching rules registered with the Directory
* Server.
*/
- public static ConcurrentHashMap<String,SubstringMatchingRule>
+ public static ConcurrentMap<String, SubstringMatchingRule>
getSubstringMatchingRules()
{
return directoryServer.schema.getSubstringMatchingRules();
@@ -3440,7 +3441,7 @@
*
* @return The set of objectclasses defined in the Directory Server.
*/
- public static ConcurrentHashMap<String,ObjectClass> getObjectClasses()
+ public static ConcurrentMap<String, ObjectClass> getObjectClasses()
{
return directoryServer.schema.getObjectClasses();
}
@@ -3644,7 +3645,7 @@
* @return The set of attribute type definitions that have been
* defined in the Directory Server.
*/
- public static ConcurrentHashMap<String,AttributeType> getAttributeTypes()
+ public static ConcurrentMap<String, AttributeType> getAttributeTypes()
{
return directoryServer.schema.getAttributeTypes();
}
@@ -3862,7 +3863,7 @@
*
* @return The set of attribute syntaxes defined in the Directory Server.
*/
- public static ConcurrentHashMap<String,
+ public static ConcurrentMap<String,
AttributeSyntax<?>> getAttributeSyntaxes()
{
return directoryServer.schema.getSyntaxes();
@@ -4043,7 +4044,7 @@
*
* @return The set of matching rule uses defined in the Directory Server.
*/
- public static ConcurrentHashMap<MatchingRule,MatchingRuleUse>
+ public static ConcurrentMap<MatchingRule, MatchingRuleUse>
getMatchingRuleUses()
{
return directoryServer.schema.getMatchingRuleUses();
@@ -4123,7 +4124,7 @@
*
* @return The set of DIT content rules defined in the Directory Server.
*/
- public static ConcurrentHashMap<ObjectClass,DITContentRule>
+ public static ConcurrentMap<ObjectClass, DITContentRule>
getDITContentRules()
{
return directoryServer.schema.getDITContentRules();
@@ -4202,7 +4203,7 @@
*
* @return The set of DIT structure rules defined in the Directory Server.
*/
- public static ConcurrentHashMap<NameForm,DITStructureRule>
+ public static ConcurrentMap<NameForm, DITStructureRule>
getDITStructureRules()
{
return directoryServer.schema.getDITStructureRulesByNameForm();
@@ -4299,7 +4300,7 @@
*
* @return The set of name forms defined in the Directory Server.
*/
- public static ConcurrentHashMap<ObjectClass,List<NameForm>> getNameForms()
+ public static ConcurrentMap<ObjectClass, List<NameForm>> getNameForms()
{
return directoryServer.schema.getNameFormsByObjectClass();
}
@@ -4877,8 +4878,7 @@
* @return The set of password validators that have been registered for use
* with the Directory Server.
*/
- public static
- ConcurrentHashMap<DN,
+ public static ConcurrentMap<DN,
PasswordValidator<? extends PasswordValidatorCfg>>
getPasswordValidators()
{
@@ -4946,7 +4946,7 @@
* @return The set of account status notification handlers defined in the
* Directory Server.
*/
- public static ConcurrentHashMap<DN,AccountStatusNotificationHandler>
+ public static ConcurrentMap<DN, AccountStatusNotificationHandler>
getAccountStatusNotificationHandlers()
{
return directoryServer.accountStatusNotificationHandlers;
@@ -5012,7 +5012,7 @@
* @return The set of password generators that have been registered for use
* with the Directory Server.
*/
- public static ConcurrentHashMap<DN,PasswordGenerator> getPasswordGenerators()
+ public static ConcurrentMap<DN, PasswordGenerator> getPasswordGenerators()
{
return directoryServer.passwordGenerators;
}
@@ -5353,7 +5353,7 @@
* @return The set of monitor providers that have been registered with the
* Directory Server.
*/
- public static ConcurrentHashMap<String,
+ public static ConcurrentMap<String,
MonitorProvider<? extends MonitorProviderCfg>>
getMonitorProviders()
{
@@ -5740,7 +5740,7 @@
* @return The set of alternate bind DNs for root users, mapped between the
* alternate DN and the real DN.
*/
- public static ConcurrentHashMap<DN,DN> getAlternateRootBindDNs()
+ public static ConcurrentMap<DN, DN> getAlternateRootBindDNs()
{
return directoryServer.alternateRootBindDNs;
}
@@ -6686,7 +6686,7 @@
* @return The set of extended operations that may be processed by the
* Directory Server.
*/
- public static ConcurrentHashMap<String,ExtendedOperationHandler>
+ public static ConcurrentMap<String, ExtendedOperationHandler>
getSupportedExtensions()
{
return directoryServer.extendedOperationHandlers;
@@ -6745,7 +6745,7 @@
* @return The set of SASL mechanisms that are supported by the Directory
* Server.
*/
- public static ConcurrentHashMap<String,SASLMechanismHandler>
+ public static ConcurrentMap<String, SASLMechanismHandler>
getSupportedSASLMechanisms()
{
return directoryServer.saslMechanismHandlers;
@@ -6879,7 +6879,7 @@
* @return The set of identity mappers defined in the Directory Server
* configuration.
*/
- public static ConcurrentHashMap<DN,IdentityMapper> getIdentityMappers()
+ public static ConcurrentMap<DN, IdentityMapper> getIdentityMappers()
{
return directoryServer.identityMappers;
}
@@ -9022,9 +9022,9 @@
* produce.
*/
@Override
- public LinkedHashMap<String,String> getAlerts()
+ public Map<String, String> getAlerts()
{
- LinkedHashMap<String,String> alerts = new LinkedHashMap<String,String>();
+ Map<String, String> alerts = new LinkedHashMap<String, String>();
alerts.put(ALERT_TYPE_SERVER_STARTED, ALERT_DESCRIPTION_SERVER_STARTED);
alerts.put(ALERT_TYPE_SERVER_SHUTDOWN, ALERT_DESCRIPTION_SERVER_SHUTDOWN);
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 e96d88d..ae23cdf 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
@@ -364,9 +364,9 @@
/** {@inheritDoc} */
@Override
- public LinkedHashMap<String, String> getAlerts()
+ public Map<String, String> getAlerts()
{
- LinkedHashMap<String, String> alerts = new LinkedHashMap<String, String>();
+ Map<String, String> alerts = new LinkedHashMap<String, String>();
alerts.put(ALERT_TYPE_HTTP_CONNECTION_HANDLER_CONSECUTIVE_FAILURES,
ALERT_DESCRIPTION_HTTP_CONNECTION_HANDLER_CONSECUTIVE_FAILURES);
diff --git a/opendj-sdk/opends/src/server/org/opends/server/protocols/jmx/JmxConnectionHandler.java b/opendj-sdk/opends/src/server/org/opends/server/protocols/jmx/JmxConnectionHandler.java
index 0d5ecdb..3ca70f3 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/protocols/jmx/JmxConnectionHandler.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/protocols/jmx/JmxConnectionHandler.java
@@ -28,7 +28,7 @@
package org.opends.server.protocols.jmx;
import static org.opends.messages.ProtocolMessages.*;
-import static org.opends.server.loggers.ErrorLogger.logError;
+import static org.opends.server.loggers.ErrorLogger.*;
import static org.opends.server.util.StaticUtils.*;
import java.io.IOException;
@@ -38,6 +38,7 @@
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
+import java.util.Map;
import org.opends.messages.Message;
import org.opends.server.admin.server.ConfigurationChangeListener;
@@ -80,27 +81,27 @@
public static final String TRUST_MANAGER_ARRAY_KEY =
"org.opends.server.protocol.jmx.ssl.trust.manager.array";
- // The fully-qualified name of this class.
+ /** The fully-qualified name of this class. */
private static final String CLASS_NAME =
"org.opends.server.protocols.jmx.JMXConnectionHandler";
- // The list of active client connection.
- private LinkedList<ClientConnection> connectionList;
+ /** The list of active client connection. */
+ private List<ClientConnection> connectionList;
- // The current configuration state.
+ /** The current configuration state. */
private JMXConnectionHandlerCfg currentConfig;
- // The JMX RMI Connector associated with the Connection handler.
+ /** The JMX RMI Connector associated with the Connection handler. */
private RmiConnector rmiConnector;
- // The unique name for this connection handler.
+ /** The unique name for this connection handler. */
private String connectionHandlerName;
- // The protocol used to communicate with clients.
+ /** The protocol used to communicate with clients. */
private String protocol;
- // The set of listeners for this connection handler.
- private LinkedList<HostPort> listeners = new LinkedList<HostPort>();
+ /** The set of listeners for this connection handler. */
+ private List<HostPort> listeners = new LinkedList<HostPort>();
/**
* Creates a new instance of this JMX connection handler. It must be
@@ -122,7 +123,7 @@
JMXConnectionHandlerCfg config) {
// Create variables to include in the response.
ResultCode resultCode = ResultCode.SUCCESS;
- ArrayList<Message> messages = new ArrayList<Message>();
+ List<Message> messages = new ArrayList<Message>();
// Determine whether or not the RMI connection needs restarting.
boolean rmiConnectorRestart = false;
@@ -214,8 +215,9 @@
* may produce.
*/
@Override
- public LinkedHashMap<String, String> getAlerts() {
- LinkedHashMap<String, String> alerts = new LinkedHashMap<String, String>();
+ public Map<String, String> getAlerts()
+ {
+ Map<String, String> alerts = new LinkedHashMap<String, String>();
return alerts;
}
diff --git a/opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/LDAPConnectionHandler.java b/opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/LDAPConnectionHandler.java
index ea92126..bd54e42 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/LDAPConnectionHandler.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/LDAPConnectionHandler.java
@@ -453,9 +453,9 @@
* produce.
*/
@Override
- public LinkedHashMap<String, String> getAlerts()
+ public Map<String, String> getAlerts()
{
- LinkedHashMap<String, String> alerts = new LinkedHashMap<String, String>();
+ Map<String, String> alerts = new LinkedHashMap<String, String>();
alerts.put(ALERT_TYPE_LDAP_CONNECTION_HANDLER_CONSECUTIVE_FAILURES,
ALERT_DESCRIPTION_LDAP_CONNECTION_HANDLER_CONSECUTIVE_FAILURES);
diff --git a/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/backends/SchemaBackendTestCase.java b/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/backends/SchemaBackendTestCase.java
index 108a92b..75dd993 100644
--- a/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/backends/SchemaBackendTestCase.java
+++ b/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/backends/SchemaBackendTestCase.java
@@ -30,10 +30,7 @@
import java.io.File;
-import java.util.LinkedHashMap;
-
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
+import java.util.Map;
import org.opends.server.TestCaseUtils;
import org.opends.server.config.ConfigException;
@@ -60,9 +57,10 @@
import org.opends.server.types.ResultCode;
import org.opends.server.types.SearchFilter;
import org.opends.server.types.SearchScope;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
import static org.testng.Assert.*;
-
import static org.opends.server.util.StaticUtils.*;
@@ -70,10 +68,11 @@
/**
* A set of test cases for the schema backend.
*/
+@SuppressWarnings("javadoc")
public class SchemaBackendTestCase
extends BackendTestCase
{
- // A reference to the schema backend.
+ /** A reference to the schema backend. */
private SchemaBackend schemaBackend;
@@ -5544,7 +5543,7 @@
@Test()
public void testGetAlerts()
{
- LinkedHashMap<String,String> alerts = schemaBackend.getAlerts();
+ Map<String, String> alerts = schemaBackend.getAlerts();
assertNotNull(alerts);
assertFalse(alerts.isEmpty());
}
diff --git a/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/TestLDAPConnectionHandler.java b/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/TestLDAPConnectionHandler.java
index bca3e48..8382ef1 100644
--- a/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/TestLDAPConnectionHandler.java
+++ b/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/TestLDAPConnectionHandler.java
@@ -23,17 +23,17 @@
*
*
* Copyright 2006-2009 Sun Microsystems, Inc.
- * Portions copyright 2012 ForgeRock AS.
+ * Portions copyright 2012-2013 ForgeRock AS.
*/
-
package org.opends.server.protocols.ldap;
import static org.opends.server.config.ConfigConstants.*;
import static org.testng.Assert.*;
import java.util.Collection;
-import java.util.LinkedHashMap;
import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
import org.opends.messages.Message;
import org.opends.server.TestCaseUtils;
@@ -50,6 +50,7 @@
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
+@SuppressWarnings("javadoc")
public class TestLDAPConnectionHandler extends LdapTestCase {
private static Message reasonMsg= Message.raw("Don't need a reason.");
@@ -67,13 +68,13 @@
TestCaseUtils.startServer();
}
- @Test()
/**
* Creates two handlers, one which is SSL type. Then change some values via the setter
* methods.
*
* @throws Exception if the handler cannot be instantiated.
*/
+ @Test()
public void testLDAPConnectionHandler() throws Exception {
Entry LDAPHandlerEntry=null;
@@ -108,7 +109,7 @@
LDAPConnHandler.toString(new StringBuilder());
LDAPConnHandler.toString();
LDAPStatistics tracker=LDAPConnHandler.getStatTracker();
- LinkedHashMap<String,String> alerts = LDAPConnHandler.getAlerts();
+ Map<String,String> alerts = LDAPConnHandler.getAlerts();
String c=LDAPConnHandler.getClassName();
DN dn = LDAPConnHandler.getComponentEntryDN();
Collection<String> cips = LDAPConnHandler.getEnabledSSLCipherSuites();
@@ -135,7 +136,6 @@
LDAPConnHandler.processServerShutdown(reasonMsg);
}
- @Test(expectedExceptions=ConfigException.class)
/**
* Start a handler an then give its hasAcceptableConfiguration a ConfigEntry with
* numerous invalid cases and single-valued attrs with duplicate values.
@@ -143,6 +143,7 @@
* @throws Exception if handler cannot be instantiated or the configuration is
* accepted.
*/
+ @Test(expectedExceptions = ConfigException.class)
public void testBadLDAPConnectionHandlerConfiguration() throws Exception
{
Entry BadHandlerEntry=TestCaseUtils.makeEntry(
@@ -314,7 +315,7 @@
GoodHandlerEntry.addAttribute(a13, null);
GoodHandlerEntry.addAttribute(a14, null);
GoodHandlerEntry.addAttribute(a15, null);
- LinkedList<Message> reasons = new LinkedList<Message>();
+ List<Message> reasons = new LinkedList<Message>();
LDAPConnectionHandlerCfg config = LdapTestCase.getConfiguration(GoodHandlerEntry);
//see if we're ok
boolean ret=LDAPConnHandler.isConfigurationChangeAcceptable(config, reasons);
@@ -322,6 +323,5 @@
//apply it
LDAPConnHandler.applyConfigurationChange(config);
LDAPConnHandler.finalizeConnectionHandler(reasonMsg);
-
}
}
--
Gitblit v1.10.0