From 8b3cd28204e15e0a98ce038b355f100cd7c44e3c Mon Sep 17 00:00:00 2001
From: Nicolas Capponi <capponi.nicolas@gmail.com>
Date: Thu, 28 Jan 2016 08:28:20 +0000
Subject: [PATCH] OPENDJ-1632 (PR-201) Migrate AttributeType in one shot
---
opendj-server-legacy/src/main/java/org/opends/server/config/MultiChoiceConfigAttribute.java | 19 +++++++++++++++++--
1 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/config/MultiChoiceConfigAttribute.java b/opendj-server-legacy/src/main/java/org/opends/server/config/MultiChoiceConfigAttribute.java
index 0d808d6..8d9715f 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/config/MultiChoiceConfigAttribute.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/config/MultiChoiceConfigAttribute.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2006-2008 Sun Microsystems, Inc.
- * Portions Copyright 2014-2015 ForgeRock AS
+ * Portions Copyright 2014-2016 ForgeRock AS
*/
package org.opends.server.config;
@@ -44,8 +44,8 @@
import org.opends.server.types.Attribute;
import org.opends.server.util.CollectionUtils;
-import static org.opends.messages.ConfigMessages.*;
import static org.opends.server.config.ConfigConstants.*;
+import static org.opends.messages.ConfigMessages.*;
/**
* This class defines a multi-choice configuration attribute, which can hold
@@ -260,6 +260,7 @@
*
* @return The name of the data type for this configuration attribute.
*/
+ @Override
public String getDataType()
{
return "MultiChoice";
@@ -272,6 +273,7 @@
*
* @return The attribute syntax for this configuration attribute.
*/
+ @Override
public Syntax getSyntax()
{
return DirectoryServer.getDefaultStringSyntax();
@@ -503,6 +505,7 @@
* configuration attribute. This will not take any action if there are no
* pending values.
*/
+ @Override
public void applyPendingValues()
{
if (! hasPendingValues())
@@ -528,6 +531,7 @@
* @return <CODE>true</CODE> if the provided value is acceptable for use in
* this attribute, or <CODE>false</CODE> if not.
*/
+ @Override
public boolean valueIsAcceptable(ByteString value,
StringBuilder rejectReason)
{
@@ -572,6 +576,7 @@
* @throws ConfigException If an unrecoverable problem occurs while
* performing the conversion.
*/
+ @Override
public LinkedHashSet<ByteString>
stringsToValues(List<String> valueStrings, boolean allowFailures)
throws ConfigException
@@ -638,6 +643,7 @@
*
* @return The string representations of the set of active values for this configuration attribute.
*/
+ @Override
public List<String> activeValuesToStrings()
{
return activeValues;
@@ -656,6 +662,7 @@
* configuration attribute, or <CODE>null</CODE> if there are no
* pending values.
*/
+ @Override
public List<String> pendingValuesToStrings()
{
if (hasPendingValues())
@@ -688,6 +695,7 @@
* single-valued and the provided attribute has
* multiple values).
*/
+ @Override
public ConfigAttribute getConfigAttribute(List<Attribute> attributeList)
throws ConfigException
{
@@ -872,6 +880,7 @@
* configuration attribute, or <CODE>null</CODE> if it does not have
* any active values.
*/
+ @Override
public javax.management.Attribute toJMXAttribute()
{
return _toJMXAttribute(false) ;
@@ -885,6 +894,7 @@
* configuration attribute, or <CODE>null</CODE> if it does not have
* any active values.
*/
+ @Override
public javax.management.Attribute toJMXAttributePending()
{
return _toJMXAttribute(true) ;
@@ -902,6 +912,7 @@
* @param attributeList The attribute list to which the JMX attribute(s)
* should be added.
*/
+ @Override
public void toJMXAttribute(AttributeList attributeList)
{
if (!activeValues.isEmpty())
@@ -965,6 +976,7 @@
* @param attributeInfoList The list to which the attribute information
* should be added.
*/
+ @Override
public void toJMXAttributeInfo(List<MBeanAttributeInfo> attributeInfoList)
{
attributeInfoList.add(new MBeanAttributeInfo(getName(), getType(),
@@ -987,6 +999,7 @@
* @return A JMX <CODE>MBeanParameterInfo</CODE> object that describes this
* configuration attribute.
*/
+ @Override
public MBeanParameterInfo toJMXParameterInfo()
{
return new MBeanParameterInfo(getName(), getType(), String.valueOf(getDescription()));
@@ -1008,6 +1021,7 @@
* acceptable value for this configuration
* attribute.
*/
+ @Override
public void setValue(javax.management.Attribute jmxAttribute)
throws ConfigException
{
@@ -1068,6 +1082,7 @@
*
* @return A duplicate of this configuration attribute.
*/
+ @Override
public ConfigAttribute duplicate()
{
return new MultiChoiceConfigAttribute(getName(), getDescription(),
--
Gitblit v1.10.0