| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | * Portions Copyright 2014-2016 ForgeRock AS |
| | | */ |
| | | package org.opends.server.config; |
| | | |
| | |
| | | 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 an integer configuration attribute, which can hold zero or |
| | |
| | | * |
| | | * @return The name of the data type for this configuration attribute. |
| | | */ |
| | | @Override |
| | | public String getDataType() |
| | | { |
| | | return "Integer"; |
| | |
| | | * |
| | | * @return The attribute syntax for this configuration attribute. |
| | | */ |
| | | @Override |
| | | public Syntax getSyntax() |
| | | { |
| | | return DirectoryServer.getDefaultIntegerSyntax(); |
| | |
| | | * configuration attribute. This will not take any action if there are no |
| | | * pending values. |
| | | */ |
| | | @Override |
| | | public void applyPendingValues() |
| | | { |
| | | if (! hasPendingValues()) |
| | |
| | | * @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) |
| | | { |
| | | // First, make sure we can represent it as a long. |
| | |
| | | * @throws ConfigException If an unrecoverable problem occurs while |
| | | * performing the conversion. |
| | | */ |
| | | @Override |
| | | public LinkedHashSet<ByteString> |
| | | stringsToValues(List<String> valueStrings, boolean allowFailures) |
| | | throws ConfigException |
| | |
| | | * @return The string representations of the set of active values for this |
| | | * configuration attribute. |
| | | */ |
| | | @Override |
| | | public List<String> activeValuesToStrings() |
| | | { |
| | | return toListOfString(activeValues); |
| | |
| | | * configuration attribute, or <CODE>null</CODE> if there are no |
| | | * pending values. |
| | | */ |
| | | @Override |
| | | public List<String> pendingValuesToStrings() |
| | | { |
| | | if (hasPendingValues()) |
| | |
| | | * single-valued and the provided attribute has |
| | | * multiple values). |
| | | */ |
| | | @Override |
| | | public ConfigAttribute getConfigAttribute(List<Attribute> attributeList) |
| | | throws ConfigException |
| | | { |
| | |
| | | * configuration attribute, or <CODE>null</CODE> if it does not have |
| | | * any active values. |
| | | */ |
| | | @Override |
| | | public javax.management.Attribute toJMXAttribute() |
| | | { |
| | | return _toJMXAttribute(false); |
| | |
| | | * @return A JMX attribute containing the pending value set for this |
| | | * configuration attribute. |
| | | */ |
| | | @Override |
| | | public javax.management.Attribute toJMXAttributePending() |
| | | { |
| | | return _toJMXAttribute(true); |
| | |
| | | * @param attributeList The attribute list to which the JMX attribute(s) |
| | | * should be added. |
| | | */ |
| | | @Override |
| | | public void toJMXAttribute(AttributeList attributeList) |
| | | { |
| | | if (!activeValues.isEmpty()) |
| | |
| | | * @param attributeInfoList The list to which the attribute information |
| | | * should be added. |
| | | */ |
| | | @Override |
| | | public void toJMXAttributeInfo(List<MBeanAttributeInfo> attributeInfoList) |
| | | { |
| | | if (isMultiValued()) |
| | |
| | | * @return A JMX <CODE>MBeanParameterInfo</CODE> object that describes this |
| | | * configuration attribute. |
| | | */ |
| | | @Override |
| | | public MBeanParameterInfo toJMXParameterInfo() |
| | | { |
| | | if (isMultiValued()) |
| | |
| | | * acceptable value for this configuration |
| | | * attribute. |
| | | */ |
| | | @Override |
| | | public void setValue(javax.management.Attribute jmxAttribute) |
| | | throws ConfigException |
| | | { |
| | |
| | | * |
| | | * @return A duplicate of this configuration attribute. |
| | | */ |
| | | @Override |
| | | public ConfigAttribute duplicate() |
| | | { |
| | | return new IntegerConfigAttribute(getName(), getDescription(), isRequired(), |