@PublicAPI(stability=VOLATILE, mayInstantiate=true, mayExtend=false, mayInvoke=true) public final class ReadOnlyConfigAttribute extends ConfigAttribute
Constructor and Description |
---|
ReadOnlyConfigAttribute(String name,
LocalizableMessage description,
boolean isMultiValued)
Creates a new read-only configuration attribute stub with the provided
information but no values.
|
ReadOnlyConfigAttribute(String name,
LocalizableMessage description,
List<String> values)
Creates a new read-only configuration attribute with the provided
information.
|
ReadOnlyConfigAttribute(String name,
LocalizableMessage description,
String value)
Creates a new read-only configuration attribute with the provided
information.
|
Modifier and Type | Method and Description |
---|---|
String |
activeValue()
Retrieves the active value for this configuration attribute as a string.
|
List<String> |
activeValues()
Retrieves the set of active values for this configuration attribute.
|
List<String> |
activeValuesToStrings()
Converts the set of active values for this configuration attribute into a
set of strings that may be stored in the configuration or represented over
protocol.
|
void |
applyPendingValues()
Applies the set of pending values, making them the active values for this
configuration attribute.
|
ConfigAttribute |
duplicate()
Creates a duplicate of this configuration attribute.
|
ConfigAttribute |
getConfigAttribute(List<Attribute> attributeList)
Retrieves a new configuration attribute of this type that will contain the
values from the provided attribute.
|
String |
getDataType()
Retrieves the name of the data type for this configuration attribute.
|
org.forgerock.opendj.ldap.schema.Syntax |
getSyntax()
Retrieves the attribute syntax for this configuration attribute.
|
String |
pendingValue()
Retrieves the pending value for this configuration attribute as a string.
|
List<String> |
pendingValues()
Retrieves the set of pending values for this configuration attribute.
|
List<String> |
pendingValuesToStrings()
Converts the set of pending values for this configuration attribute into a
set of strings that may be stored in the configuration or represented over
protocol.
|
void |
setValue(Attribute jmxAttribute)
Attempts to set the value of this configuration attribute based on the
information in the provided JMX attribute.
|
void |
setValue(String value)
Sets the value for this string configuration attribute.
|
void |
setValues(List<String> values)
Sets the values for this string configuration attribute.
|
LinkedHashSet<org.forgerock.opendj.ldap.ByteString> |
stringsToValues(List<String> valueStrings,
boolean allowFailures)
Converts the provided set of strings to a corresponding set of attribute
values.
|
Attribute |
toJMXAttribute()
Retrieves a JMX attribute containing the active value set for this
configuration attribute.
|
void |
toJMXAttribute(AttributeList attributeList)
Adds information about this configuration attribute to the provided JMX
attribute list.
|
void |
toJMXAttributeInfo(List<MBeanAttributeInfo> attributeInfoList)
Adds information about this configuration attribute to the provided list in
the form of a JMX
MBeanAttributeInfo object. |
Attribute |
toJMXAttributePending()
Retrieves a JMX attribute containing the pending value set for this
configuration attribute.
|
MBeanParameterInfo |
toJMXParameterInfo()
Retrieves a JMX
MBeanParameterInfo object that describes this
configuration attribute. |
boolean |
valueIsAcceptable(org.forgerock.opendj.ldap.ByteString value,
StringBuilder rejectReason)
Indicates whether the provided value is acceptable for use in this
attribute.
|
addValues, getActiveValues, getDescription, getName, getPendingValues, hasPendingValues, isMultiValued, isRequired, removeAllValues, removeValues, requiresAdminAction, setActiveValues, setInitialValues, setPendingValues, setValues
public ReadOnlyConfigAttribute(String name, LocalizableMessage description, boolean isMultiValued)
setInitialValue
method.name
- The name for this configuration attribute.description
- The description for this configuration attribute.isMultiValued
- Indicates whether this configuration attribute may
have multiple values.public ReadOnlyConfigAttribute(String name, LocalizableMessage description, String value)
name
- The name for this configuration attribute.description
- The description for this configuration attribute.value
- The value for this configuration attribute.public ReadOnlyConfigAttribute(String name, LocalizableMessage description, List<String> values)
name
- The name for this configuration attribute.description
- The description for this configuration attribute.values
- The set of values for this configuration attribute.public String getDataType()
getDataType
in class ConfigAttribute
public org.forgerock.opendj.ldap.schema.Syntax getSyntax()
getSyntax
in class ConfigAttribute
public String activeValue() throws ConfigException
ConfigException
- If this attribute does not have exactly one
active value.public List<String> activeValues()
public String pendingValue() throws ConfigException
ConfigException
- If this attribute does not have exactly one
pending value.public List<String> pendingValues()
public void setValue(String value) throws ConfigException
value
- The value for this string configuration attribute.ConfigException
- If the provided value is not acceptable.public void setValues(List<String> values) throws ConfigException
values
- The set of values for this string configuration attribute.ConfigException
- If the provided value set or any of the
individual values are not acceptable.public void applyPendingValues()
applyPendingValues
in class ConfigAttribute
public boolean valueIsAcceptable(org.forgerock.opendj.ldap.ByteString value, StringBuilder rejectReason)
valueIsAcceptable
in class ConfigAttribute
value
- The value for which to make the determination.rejectReason
- A buffer into which a human-readable reason for the
reject may be written.true
if the provided value is acceptable for use in
this attribute, or false
if not.public LinkedHashSet<org.forgerock.opendj.ldap.ByteString> stringsToValues(List<String> valueStrings, boolean allowFailures) throws ConfigException
stringsToValues
in class ConfigAttribute
valueStrings
- The set of strings to be converted into attribute
values.allowFailures
- Indicates whether the decoding process should allow
any failures in which one or more values could be
decoded but at least one could not. If this is
true
and such a condition is acceptable
for the underlying attribute type, then the returned
set of values should simply not include those
undecodable values.ConfigException
- If an unrecoverable problem occurs while
performing the conversion.public List<String> activeValuesToStrings()
stringsToValues
method.activeValuesToStrings
in class ConfigAttribute
public List<String> pendingValuesToStrings()
stringsToValues
method.pendingValuesToStrings
in class ConfigAttribute
null
if there are no
pending values.public ConfigAttribute getConfigAttribute(List<Attribute> attributeList) throws ConfigException
getConfigAttribute
in class ConfigAttribute
attributeList
- The list of attributes to use to create the config
attribute. The list must contain either one or two
elements, with both attributes having the same base
name and the only option allowed is ";pending" and
only if this attribute is one that requires admin
action before a change may take effect.ConfigException
- If the provided attribute cannot be treated as a
configuration attribute of this type (e.g., if
one or more of the values of the provided
attribute are not suitable for an attribute of
this type, or if this configuration attribute is
single-valued and the provided attribute has
multiple values).public Attribute toJMXAttribute()
toJMXAttribute
in class ConfigAttribute
null
if it does not have
any active values.public Attribute toJMXAttributePending()
toJMXAttributePending
in class ConfigAttribute
null
if it does
not have any active values.public void toJMXAttribute(AttributeList attributeList)
toJMXAttribute
in class ConfigAttribute
attributeList
- The attribute list to which the JMX attribute(s)
should be added.public void toJMXAttributeInfo(List<MBeanAttributeInfo> attributeInfoList)
MBeanAttributeInfo
object. If this
configuration attribute requires administrative action before changes take
effect and it has a set of pending values, then two attribute info objects
should be added to the list -- one for the active value (which should be
read-write) and one for the pending value (which should be read-only). The
pending value should be named with the pending option.toJMXAttributeInfo
in class ConfigAttribute
attributeInfoList
- The list to which the attribute information
should be added.public MBeanParameterInfo toJMXParameterInfo()
MBeanParameterInfo
object that describes this
configuration attribute.toJMXParameterInfo
in class ConfigAttribute
MBeanParameterInfo
object that describes this
configuration attribute.public void setValue(Attribute jmxAttribute) throws ConfigException
setValue
in class ConfigAttribute
jmxAttribute
- The JMX attribute to use to attempt to set the value
of this configuration attribute.ConfigException
- If the provided JMX attribute does not have an
acceptable value for this configuration
attribute.public ConfigAttribute duplicate()
duplicate
in class ConfigAttribute
Copyright © 2010-2016 ForgeRock AS. All Rights Reserved.