OPENDJ-2226 PR-96 Resolve split package issues
Rename opendj-config message resource files to change generated package from
com.forgerock.opendj.ldap.* to com.forgerock.opendj.ldap.config.*
to prevent OSGI package conflict between opendj-core and main jar.
Create an org.opends.server.loggers.slf4j package to prevent package splitting
between opendj-slf4j-adapter and main jar.
1 files added
6 files renamed
29 files modified
| | |
| | | </goals> |
| | | <configuration> |
| | | <messageFiles> |
| | | <messageFile>com/forgerock/opendj/ldap/admin.properties</messageFile> |
| | | <messageFile>com/forgerock/opendj/ldap/config.properties</messageFile> |
| | | <messageFile>com/forgerock/opendj/ldap/extension.properties</messageFile> |
| | | <messageFile>com/forgerock/opendj/ldap/protocol.properties</messageFile> |
| | | <messageFile>com/forgerock/opendj/ldap/config/admin.properties</messageFile> |
| | | <messageFile>com/forgerock/opendj/ldap/config/config.properties</messageFile> |
| | | <messageFile>com/forgerock/opendj/ldap/config/extension.properties</messageFile> |
| | | <messageFile>com/forgerock/opendj/ldap/config/protocol.properties</messageFile> |
| | | <messageFile>com/forgerock/opendj/dsconfig/dsconfig.properties</messageFile> |
| | | </messageFiles> |
| | | </configuration> |
| | |
| | | */ |
| | | package org.forgerock.opendj.config; |
| | | |
| | | import static com.forgerock.opendj.ldap.AdminMessages.*; |
| | | import static com.forgerock.opendj.ldap.config.AdminMessages.*; |
| | | import static com.forgerock.opendj.util.StaticUtils.*; |
| | | |
| | | import org.forgerock.util.Reject; |
| | |
| | | */ |
| | | package org.forgerock.opendj.config; |
| | | |
| | | import static com.forgerock.opendj.ldap.AdminMessages.*; |
| | | import static com.forgerock.opendj.ldap.ExtensionMessages.NOTE_LOG_EXTENSION_INFORMATION; |
| | | import static com.forgerock.opendj.ldap.config.AdminMessages.*; |
| | | import static com.forgerock.opendj.ldap.config.ExtensionMessages.NOTE_LOG_EXTENSION_INFORMATION; |
| | | import static com.forgerock.opendj.util.StaticUtils.EOL; |
| | | import static com.forgerock.opendj.util.StaticUtils.stackTraceToSingleLineString; |
| | | |
| | |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | |
| | | import com.forgerock.opendj.ldap.AdminMessages; |
| | | import com.forgerock.opendj.ldap.config.AdminMessages; |
| | | |
| | | /** |
| | | * This class is responsible for managing the configuration framework including: |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | */ |
| | | |
| | | package org.forgerock.opendj.config; |
| | | |
| | | import static com.forgerock.opendj.ldap.AdminMessages.*; |
| | | import static com.forgerock.opendj.ldap.config.AdminMessages.*; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | */ |
| | | package org.forgerock.opendj.config; |
| | | |
| | | import static com.forgerock.opendj.ldap.AdminMessages.*; |
| | | import static com.forgerock.opendj.ldap.config.AdminMessages.*; |
| | | |
| | | /** |
| | | * A managed object could not be created because there is an existing managed |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | */ |
| | | package org.forgerock.opendj.config; |
| | | |
| | | import static com.forgerock.opendj.ldap.AdminMessages.*; |
| | | import static com.forgerock.opendj.ldap.config.AdminMessages.*; |
| | | |
| | | /** |
| | | * The requested managed object could not be located. |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | */ |
| | | |
| | | package org.forgerock.opendj.config; |
| | | |
| | | import static com.forgerock.opendj.ldap.AdminMessages.ERR_DEFAULT_BEHAVIOR_PROPERTY_EXCEPTION; |
| | | import static com.forgerock.opendj.ldap.AdminMessages.ERR_ILLEGAL_PROPERTY_VALUE_EXCEPTION; |
| | | import static com.forgerock.opendj.ldap.AdminMessages.ERR_PROPERTY_IS_MANDATORY_EXCEPTION; |
| | | import static com.forgerock.opendj.ldap.AdminMessages.ERR_PROPERTY_IS_READ_ONLY_EXCEPTION; |
| | | import static com.forgerock.opendj.ldap.AdminMessages.ERR_PROPERTY_IS_SINGLE_VALUED_EXCEPTION; |
| | | import static com.forgerock.opendj.ldap.AdminMessages.ERR_UNKNOWN_PROPERTY_DEFINITION_EXCEPTION; |
| | | import static com.forgerock.opendj.ldap.config.AdminMessages.*; |
| | | |
| | | import org.forgerock.i18n.LocalizableException; |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | */ |
| | | package org.forgerock.opendj.config; |
| | | |
| | | import static com.forgerock.opendj.ldap.AdminMessages.*; |
| | | import static com.forgerock.opendj.ldap.config.AdminMessages.*; |
| | | |
| | | /** |
| | | * Thrown when an attempt is made to retrieve a property using its name but the |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | */ |
| | | package org.forgerock.opendj.config.client; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | |
| | | import static com.forgerock.opendj.ldap.AdminMessages.*; |
| | | import static com.forgerock.opendj.ldap.config.AdminMessages.*; |
| | | |
| | | /** |
| | | * This exception is thrown when an authentication error occurs while connecting |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | */ |
| | | package org.forgerock.opendj.config.client; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | |
| | | import static com.forgerock.opendj.ldap.AdminMessages.*; |
| | | import static com.forgerock.opendj.ldap.config.AdminMessages.*; |
| | | |
| | | /** |
| | | * This exception is thrown when the particular flavor of authentication |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | */ |
| | | package org.forgerock.opendj.config.client; |
| | | |
| | | import static com.forgerock.opendj.ldap.AdminMessages.*; |
| | | import static com.forgerock.opendj.ldap.config.AdminMessages.*; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.opendj.config.OperationsException; |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | */ |
| | | package org.forgerock.opendj.config.client; |
| | | |
| | | import static com.forgerock.opendj.ldap.AdminMessages.*; |
| | | import static com.forgerock.opendj.ldap.config.AdminMessages.*; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.opendj.config.PropertyException; |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | */ |
| | | package org.forgerock.opendj.config.client; |
| | | |
| | | import static com.forgerock.opendj.ldap.AdminMessages.*; |
| | | import static com.forgerock.opendj.ldap.config.AdminMessages.*; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | |
| | | */ |
| | | package org.forgerock.opendj.config.client; |
| | | |
| | | import static com.forgerock.opendj.ldap.AdminMessages.*; |
| | | import static com.forgerock.opendj.ldap.config.AdminMessages.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Collection; |
| | |
| | | */ |
| | | package org.forgerock.opendj.config.client; |
| | | |
| | | import static com.forgerock.opendj.ldap.AdminMessages.*; |
| | | import static com.forgerock.opendj.ldap.config.AdminMessages.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Collection; |
| | |
| | | */ |
| | | package org.forgerock.opendj.config.dsconfig; |
| | | |
| | | import static com.forgerock.opendj.ldap.ConfigMessages.ERR_BUILDVERSION_MISMATCH; |
| | | import static com.forgerock.opendj.ldap.ConfigMessages.ERR_BUILDVERSION_MALFORMED; |
| | | import static com.forgerock.opendj.ldap.ConfigMessages.ERR_BUILDVERSION_NOT_FOUND; |
| | | import static com.forgerock.opendj.ldap.ConfigMessages.ERR_CONFIGVERSION_NOT_FOUND; |
| | | import static com.forgerock.opendj.ldap.config.ConfigMessages.*; |
| | | import static org.forgerock.util.Utils.closeSilently; |
| | | |
| | | import java.io.BufferedReader; |
| | |
| | | */ |
| | | package org.forgerock.opendj.config.server; |
| | | |
| | | import static com.forgerock.opendj.ldap.AdminMessages.*; |
| | | import static com.forgerock.opendj.ldap.config.AdminMessages.*; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.HashSet; |
| | |
| | | */ |
| | | package org.forgerock.opendj.config.server; |
| | | |
| | | import static com.forgerock.opendj.ldap.AdminMessages.*; |
| | | import static com.forgerock.opendj.ldap.config.AdminMessages.*; |
| | | |
| | | import java.util.LinkedList; |
| | | import java.util.List; |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | */ |
| | | package org.forgerock.opendj.config.server; |
| | | |
| | |
| | | import org.forgerock.opendj.config.DefinitionDecodingException; |
| | | import org.forgerock.opendj.ldap.DN; |
| | | |
| | | import com.forgerock.opendj.ldap.AdminMessages; |
| | | import com.forgerock.opendj.ldap.config.AdminMessages; |
| | | |
| | | /** |
| | | * A utility class for converting admin exceptions to config exceptions. |
| | |
| | | */ |
| | | package org.forgerock.opendj.config.server; |
| | | |
| | | import static com.forgerock.opendj.ldap.AdminMessages.*; |
| | | import static com.forgerock.opendj.ldap.config.AdminMessages.*; |
| | | |
| | | import org.forgerock.opendj.config.DecodingException; |
| | | import org.forgerock.util.Reject; |
| | |
| | | */ |
| | | package org.forgerock.opendj.config.server; |
| | | |
| | | import static com.forgerock.opendj.ldap.AdminMessages.*; |
| | | import static com.forgerock.opendj.ldap.config.AdminMessages.*; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.LinkedList; |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | */ |
| | | |
| | | package org.forgerock.opendj.config.server; |
| | | |
| | | import static com.forgerock.opendj.ldap.AdminMessages.*; |
| | | import static com.forgerock.opendj.ldap.config.AdminMessages.*; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | |
| | | |
| | | package org.forgerock.opendj.config.server; |
| | | |
| | | import static com.forgerock.opendj.ldap.AdminMessages.*; |
| | | import static com.forgerock.opendj.ldap.config.AdminMessages.*; |
| | | import static com.forgerock.opendj.util.StaticUtils.*; |
| | | import static org.forgerock.opendj.config.PropertyException.defaultBehaviorException; |
| | | import static org.forgerock.opendj.config.PropertyException.propertyIsSingleValuedException; |
| | |
| | | <finalName>opendj-slf4j-adapter</finalName> |
| | | <includes> |
| | | <include>**/org/slf4j/**</include> |
| | | <include>**/org/opends/server/loggers/OpenDJLogger*</include> |
| | | <include>**/org/opends/server/loggers/slf4j/**</include> |
| | | </includes> |
| | | </configuration> |
| | | </execution> |
| | |
| | | <exclude>**/*_zh_CN.properties</exclude> |
| | | <exclude>**/*_zh_TW.properties</exclude> |
| | | <exclude>org/slf4j/**</exclude> |
| | | <exclude>org/opends/server/loggers/OpenDJLogger*</exclude> |
| | | <exclude>org/opends/server/loggers/slf4j/OpenDJLogger*</exclude> |
| | | <exclude>org/opends/server/backends/jeb/**</exclude> |
| | | <exclude>org/opends/server/replication/server/changelog/je/**</exclude> |
| | | </excludes> |
| | |
| | | * |
| | | * @return True if debug logging is enabled. False otherwise. |
| | | */ |
| | | static boolean debugEnabled() |
| | | public static boolean debugEnabled() |
| | | { |
| | | return enabled; |
| | | } |
| | |
| | | * @return The tracer for the provided class or null if there are |
| | | * no tracers registered. |
| | | */ |
| | | static DebugTracer getTracer(final String className) |
| | | public static DebugTracer getTracer(final String className) |
| | | { |
| | | DebugTracer tracer = classTracers.get(className); |
| | | if (tracer == null) |
| | |
| | | * Logging is always done at a level basis, with debug log messages |
| | | * exceeding the trace threshold being traced, others being discarded. |
| | | */ |
| | | class DebugTracer |
| | | public class DebugTracer |
| | | { |
| | | /** |
| | | * We have to harcode this value because we cannot import |
| | | * org.opends.server.loggers.slf4j.OpenDJLoggerAdapter(.class.getName()) |
| | | * to avoid OSGI split package issues. |
| | | * See OPENDJ-2226. |
| | | */ |
| | | private static final String OPENDJ_LOGGER_ADAPTER_CLASS_NAME = "org.opends.server.loggers.slf4j.OpenDJLoggerAdapter"; |
| | | |
| | | /** The class this aspect traces. */ |
| | | private String className; |
| | | |
| | |
| | | * @param msg |
| | | * message to log. |
| | | */ |
| | | void trace(String msg) |
| | | public void trace(String msg) |
| | | { |
| | | traceException(msg, null); |
| | | } |
| | |
| | | * @param exception |
| | | * the exception caught. May be {@code null}. |
| | | */ |
| | | void traceException(String msg, Throwable exception) |
| | | public void traceException(String msg, Throwable exception) |
| | | { |
| | | StackTraceElement[] stackTrace = null; |
| | | StackTraceElement[] filteredStackTrace = null; |
| | |
| | | * |
| | | * @return {@code true} if logging is enabled, false otherwise. |
| | | */ |
| | | boolean enabled() |
| | | public boolean enabled() |
| | | { |
| | | for (PublisherSettings settings : publisherSettings) |
| | | { |
| | |
| | | String name = trace.getClassName(); |
| | | return name.startsWith(Thread.class.getName()) |
| | | || name.startsWith(DebugTracer.class.getName()) |
| | | || name.startsWith(OpenDJLoggerAdapter.class.getName()) |
| | | || name.startsWith(OPENDJ_LOGGER_ADAPTER_CLASS_NAME) |
| | | || name.startsWith(LocalizedLogger.class.getName()); |
| | | } |
| | | |
| | |
| | | * @param exception |
| | | * The exception to be logged. May be {@code null}. |
| | | */ |
| | | static void log(String category, Severity severity, LocalizableMessage message, Throwable exception) |
| | | public static void log(String category, Severity severity, LocalizableMessage message, Throwable exception) |
| | | { |
| | | for (ErrorLogPublisher<?> publisher : loggerStorage.getLogPublishers()) |
| | | { |
| | |
| | | * The severity of logging event. |
| | | * @return {@code true} if logger is enabled |
| | | */ |
| | | static boolean isEnabledFor(String category, Severity severity) |
| | | public static boolean isEnabledFor(String category, Severity severity) |
| | | { |
| | | if (Thread.currentThread() instanceof DirectoryThread) |
| | | { |
| | |
| | | * to get the corresponding simplified category name if it exists, eg "CORE". If |
| | | * no simplified category name exist, the classname is used as a category name. |
| | | */ |
| | | class LoggingCategoryNames |
| | | public class LoggingCategoryNames |
| | | { |
| | | /** |
| | | * Contains mapping from class names (or package names) to category names. In |
| | |
| | | * @return the simple category name, or the provided className if no matching |
| | | * simple category name is found |
| | | */ |
| | | static String getCategoryName(final String className) |
| | | public static String getCategoryName(final String className) |
| | | { |
| | | final Entry<String, String> entry = NAMES.floorEntry(className); |
| | | if (entry != null && className.startsWith(entry.getKey())) |
| File was renamed from opendj-server-legacy/src/main/java/org/opends/server/loggers/OpenDJLoggerAdapter.java |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2014 ForgeRock AS. |
| | | * Copyright 2014-2015 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.loggers; |
| | | package org.opends.server.loggers.slf4j; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.i18n.slf4j.LocalizedMarker; |
| | | import org.opends.messages.Severity; |
| | | import org.opends.server.loggers.DebugLogger; |
| | | import org.opends.server.loggers.DebugTracer; |
| | | import org.opends.server.loggers.ErrorLogger; |
| | | import org.opends.server.loggers.LoggingCategoryNames; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.Marker; |
| | | |
| File was renamed from opendj-server-legacy/src/main/java/org/opends/server/loggers/OpenDJLoggerFactory.java |
| | |
| | | * |
| | | * Copyright 2014-2015 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.loggers; |
| | | package org.opends.server.loggers.slf4j; |
| | | |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | import java.util.concurrent.ConcurrentMap; |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at legal-notices/CDDLv1_0.txt |
| | | * or http://forgerock.org/license/CDDLv1.0.html. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at legal-notices/CDDLv1_0.txt. |
| | | * If applicable, add the following below this CDDL HEADER, with the |
| | | * fields enclosed by brackets "[]" replaced with your own identifying |
| | | * information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2015 ForgeRock AS |
| | | */ |
| | | |
| | | /** Contains classes exported in opendj-slf4j-adapter osgi bundle. */ |
| | | package org.opends.server.loggers.slf4j; |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2014 ForgeRock AS. |
| | | * Copyright 2014-2015 ForgeRock AS. |
| | | */ |
| | | package org.slf4j.impl; |
| | | |
| | | import org.opends.server.loggers.OpenDJLoggerFactory; |
| | | import org.opends.server.loggers.slf4j.OpenDJLoggerFactory; |
| | | import org.slf4j.ILoggerFactory; |
| | | import org.slf4j.spi.LoggerFactoryBinder; |
| | | |