opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/AggregationPropertyDefinition.java
@@ -22,7 +22,7 @@ * * * Copyright 2007-2008 Sun Microsystems, Inc. * Portions Copyright 2014 ForgeRock AS * Portions Copyright 2014-2015 ForgeRock AS */ package org.forgerock.opendj.config; @@ -63,7 +63,6 @@ import org.forgerock.opendj.config.server.ServerManagementContext; import org.forgerock.opendj.ldap.DN; import org.forgerock.opendj.ldap.LdapException; import org.forgerock.opendj.ldap.ResultCode; /** * Aggregation property definition. @@ -245,7 +244,7 @@ public ConfigChangeResult applyConfigurationChange(ServerManagedObject<? extends S> mo) { try { if (targetIsEnabledCondition.evaluate(mo)) { return new ConfigChangeResult(ResultCode.SUCCESS, false); return new ConfigChangeResult(); } } catch (ConfigException e) { // This should not happen - ignore it and throw an exception @@ -323,7 +322,7 @@ throw new IllegalStateException("Attempting to delete a referenced " + relationDefinition.getChildDefinition().getUserFriendlyName()); } else { return new ConfigChangeResult(ResultCode.SUCCESS, false); return new ConfigChangeResult(); } } opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/server/ConfigAddListenerAdaptor.java
@@ -22,6 +22,7 @@ * * * Copyright 2007-2009 Sun Microsystems, Inc. * Portions copyright 2015 ForgeRock AS */ package org.forgerock.opendj.config.server; @@ -159,12 +160,11 @@ DN expectedDN = DNBuilder.create(childPath); if (!configEntry.getName().equals(expectedDN)) { // Doesn't apply to us. return new ConfigChangeResult(ResultCode.SUCCESS, false); return new ConfigChangeResult(); } } // Cached objects are guaranteed to be from previous acceptable // callback. // Cached objects are guaranteed to be from previous acceptable callback ConfigChangeResult result = listener.applyConfigurationAdd(cachedManagedObject); // Now apply post constraint call-backs. opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/server/ConfigChangeListenerAdaptor.java
@@ -22,6 +22,7 @@ * * * Copyright 2007-2008 Sun Microsystems, Inc. * Portions copyright 2015 ForgeRock AS */ package org.forgerock.opendj.config.server; @@ -220,7 +221,7 @@ } else { // The dependent entry was not found. configRepository.deregisterChangeListener(configEntry.getName(), this); return new ConfigChangeResult(ResultCode.SUCCESS, false); return new ConfigChangeResult(); } } @@ -265,7 +266,7 @@ if (configEntry.getName().equals(dn)) { finalizeChangeListener(); } return new ConfigChangeResult(ResultCode.SUCCESS, false); return new ConfigChangeResult(); } public boolean configDeleteIsAcceptable(Entry configEntry, LocalizableMessageBuilder unacceptableReason) { opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/server/ConfigChangeResult.java
@@ -22,6 +22,7 @@ * * * Copyright 2006-2008 Sun Microsystems, Inc. * Portions copyright 2015 ForgeRock AS */ package org.forgerock.opendj.config.server; @@ -41,7 +42,7 @@ * A set of messages describing the changes that were made, any * action that may be required, or any problems that were encountered. */ private List<LocalizableMessage> messages; private List<LocalizableMessage> messages = new ArrayList<LocalizableMessage>(); /** * Indicates whether one or more of the changes requires @@ -52,39 +53,13 @@ /** * The result code to return to the client from this configuration change. */ private ResultCode resultCode; private ResultCode resultCode = ResultCode.SUCCESS; /** * Creates a new config change result object with the provided information. * * @param resultCode * The result code for this config change result. * @param adminActionRequired * Indicates whether administrative action is required for one or * more of the changes to take effect. */ public ConfigChangeResult(ResultCode resultCode, boolean adminActionRequired) { this.resultCode = resultCode; this.adminActionRequired = adminActionRequired; this.messages = new ArrayList<LocalizableMessage>(); } /** * Creates a new config change result object with the provided information. * * @param resultCode * The result code for this config change result. * @param adminActionRequired * Indicates whether administrative action is required for one or * more of the changes to take effect. * @param messages * A set of messages that provide additional information about * the change processing. */ public ConfigChangeResult(ResultCode resultCode, boolean adminActionRequired, List<LocalizableMessage> messages) { this.resultCode = resultCode; this.adminActionRequired = adminActionRequired; this.messages = messages; public ConfigChangeResult() { // nothing more to do } /** @@ -158,6 +133,7 @@ * * @return A string representation of this config change result. */ @Override public String toString() { StringBuilder buffer = new StringBuilder(); toString(buffer); opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/server/ConfigDeleteListenerAdaptor.java
@@ -22,6 +22,7 @@ * * * Copyright 2007-2009 Sun Microsystems, Inc. * Portions copyright 2015 ForgeRock AS */ package org.forgerock.opendj.config.server; @@ -108,7 +109,8 @@ /** * Create a new configuration delete listener adaptor for an optional * relation. * @param serverContext TODO * @param serverContext * The server context. * @param path * The managed object path of the parent. * @param relation @@ -129,7 +131,8 @@ /** * Create a new configuration delete listener adaptor for an set relation. * @param serverContext TODO * @param serverContext * The server context. * @param path * The managed object path of the parent. * @param relation @@ -159,7 +162,7 @@ DN expectedDN = DNBuilder.create(childPath); if (!configEntry.getName().equals(expectedDN)) { // Doesn't apply to us. return new ConfigChangeResult(ResultCode.SUCCESS, false); return new ConfigChangeResult(); } } opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/server/DelayedConfigAddListener.java
@@ -22,6 +22,7 @@ * * * Copyright 2008 Sun Microsystems, Inc. * Portions copyright 2015 ForgeRock AS */ package org.forgerock.opendj.config.server; @@ -32,7 +33,6 @@ import org.forgerock.opendj.config.server.spi.ConfigurationRepository; import org.forgerock.opendj.ldap.DN; import org.forgerock.opendj.ldap.Entry; import org.forgerock.opendj.ldap.ResultCode; import org.forgerock.i18n.LocalizableMessageBuilder; /** @@ -136,7 +136,7 @@ } } return new ConfigChangeResult(ResultCode.SUCCESS, false); return new ConfigChangeResult(); } /** {@inheritDoc} */ opendj-sdk/opendj-config/src/test/java/org/forgerock/opendj/config/server/AggregationServerTest.java
@@ -22,7 +22,7 @@ * * * Copyright 2007-2008 Sun Microsystems, Inc. * Portions copyright 2013 ForgeRock AS * Portions copyright 2013-2015 ForgeRock AS */ package org.forgerock.opendj.config.server; @@ -54,7 +54,6 @@ import org.forgerock.opendj.config.server.spi.ConfigDeleteListener; import org.forgerock.opendj.config.server.spi.ConfigurationRepository; import org.forgerock.opendj.ldap.Entry; import org.forgerock.opendj.ldap.ResultCode; import org.forgerock.opendj.ldap.schema.Schema; import org.forgerock.opendj.ldif.LDIF; import org.forgerock.opendj.server.config.client.ConnectionHandlerCfgClient; @@ -78,7 +77,7 @@ private static final class DummyChangeListener implements ConfigurationChangeListener<TestChildCfg> { public ConfigChangeResult applyConfigurationChange(TestChildCfg configuration) { return new ConfigChangeResult(ResultCode.SUCCESS, false); return new ConfigChangeResult(); } public boolean isConfigurationChangeAcceptable(TestChildCfg configuration, @@ -93,7 +92,7 @@ private static final class DummyDeleteListener implements ConfigurationDeleteListener<TestChildCfg> { public ConfigChangeResult applyConfigurationDelete(TestChildCfg configuration) { return new ConfigChangeResult(ResultCode.SUCCESS, false); return new ConfigChangeResult(); } public boolean isConfigurationDeleteAcceptable(TestChildCfg configuration, opendj-sdk/opendj-config/src/test/java/org/forgerock/opendj/config/server/ConstraintTest.java
@@ -22,6 +22,7 @@ * * * Copyright 2008 Sun Microsystems, Inc. * Portions copyright 2015 ForgeRock AS */ package org.forgerock.opendj.config.server; @@ -45,7 +46,6 @@ import org.forgerock.opendj.config.server.spi.ConfigDeleteListener; import org.forgerock.opendj.config.server.spi.ConfigurationRepository; import org.forgerock.opendj.ldap.Entry; import org.forgerock.opendj.ldap.ResultCode; import org.forgerock.opendj.ldif.LDIF; import org.mockito.ArgumentCaptor; import org.testng.annotations.AfterClass; @@ -62,7 +62,7 @@ private static class AddListener implements ConfigurationAddListener<TestChildCfg> { public ConfigChangeResult applyConfigurationAdd(TestChildCfg configuration) { return new ConfigChangeResult(ResultCode.SUCCESS, false); return new ConfigChangeResult(); } public boolean isConfigurationAddAcceptable(TestChildCfg configuration, @@ -74,7 +74,7 @@ private static class DeleteListener implements ConfigurationDeleteListener<TestChildCfg> { public ConfigChangeResult applyConfigurationDelete(TestChildCfg configuration) { return new ConfigChangeResult(ResultCode.SUCCESS, false); return new ConfigChangeResult(); } public boolean isConfigurationDeleteAcceptable(TestChildCfg configuration, @@ -87,7 +87,7 @@ private static class ChangeListener implements ConfigurationChangeListener<TestChildCfg> { public ConfigChangeResult applyConfigurationChange(TestChildCfg configuration) { return new ConfigChangeResult(ResultCode.SUCCESS, false); return new ConfigChangeResult(); } public boolean isConfigurationChangeAcceptable(TestChildCfg configuration, opendj-sdk/opendj-config/src/test/java/org/forgerock/opendj/config/server/DefaultBehaviorTest.java
@@ -22,6 +22,7 @@ * * * Copyright 2008 Sun Microsystems, Inc. * Portions copyright 2015 ForgeRock AS */ package org.forgerock.opendj.config.server; @@ -47,7 +48,6 @@ import org.forgerock.opendj.config.server.spi.ConfigurationRepository; import org.forgerock.opendj.ldap.DN; import org.forgerock.opendj.ldap.Entry; import org.forgerock.opendj.ldap.ResultCode; import org.forgerock.opendj.ldap.schema.Schema; import org.mockito.ArgumentCaptor; import org.testng.Assert; @@ -67,7 +67,7 @@ private TestChildCfg childCfg; public ConfigChangeResult applyConfigurationAdd(TestChildCfg configuration) { return new ConfigChangeResult(ResultCode.SUCCESS, false); return new ConfigChangeResult(); } /** Gets the child configuration checking that it has the expected name. */ @@ -89,7 +89,7 @@ private TestChildCfg childCfg; public ConfigChangeResult applyConfigurationChange(TestChildCfg configuration) { return new ConfigChangeResult(ResultCode.SUCCESS, false); return new ConfigChangeResult(); } /** Gets the child configuration checking that it has the expected name. */ opendj-sdk/opendj-server-example-plugin/src/main/java/com/example/opendj/ExamplePlugin.java
@@ -22,7 +22,7 @@ * * * Copyright 2006-2008 Sun Microsystems, Inc. * Portions copyright 2014 ForgeRock AS. * Portions copyright 2014-2015 ForgeRock AS. */ package com.example.opendj; @@ -31,7 +31,6 @@ import org.forgerock.i18n.LocalizableMessage; import org.forgerock.opendj.config.server.ConfigChangeResult; import org.forgerock.opendj.config.server.ConfigurationChangeListener; import org.forgerock.opendj.ldap.ResultCode; import com.example.opendj.server.ExamplePluginCfg; @@ -55,7 +54,7 @@ // The new configuration has already been validated. // Update was successful, no restart required. return new ConfigChangeResult(ResultCode.SUCCESS, false); return new ConfigChangeResult(); } /** {@inheritDoc} */