| | |
| | | */ |
| | | public String getDataType() |
| | | { |
| | | |
| | | return "Integer"; |
| | | } |
| | | |
| | |
| | | */ |
| | | public AttributeSyntax getSyntax() |
| | | { |
| | | |
| | | return DirectoryServer.getDefaultIntegerSyntax(); |
| | | } |
| | | |
| | |
| | | public long activeValue() |
| | | throws ConfigException |
| | | { |
| | | |
| | | if ((activeValues == null) || activeValues.isEmpty()) |
| | | { |
| | | int msgID = MSGID_CONFIG_ATTR_NO_INT_VALUE; |
| | |
| | | public int activeIntValue() |
| | | throws ConfigException |
| | | { |
| | | |
| | | if ((activeValues == null) || activeValues.isEmpty()) |
| | | { |
| | | int msgID = MSGID_CONFIG_ATTR_NO_INT_VALUE; |
| | |
| | | */ |
| | | public List<Long> activeValues() |
| | | { |
| | | |
| | | return activeValues; |
| | | } |
| | | |
| | |
| | | public long pendingValue() |
| | | throws ConfigException |
| | | { |
| | | |
| | | if (! hasPendingValues()) |
| | | { |
| | | return activeValue(); |
| | |
| | | public int pendingIntValue() |
| | | throws ConfigException |
| | | { |
| | | |
| | | if (! hasPendingValues()) |
| | | { |
| | | return activeIntValue(); |
| | |
| | | */ |
| | | public List<Long> pendingValues() |
| | | { |
| | | |
| | | if (! hasPendingValues()) |
| | | { |
| | | return activeValues; |
| | |
| | | */ |
| | | public boolean hasLowerBound() |
| | | { |
| | | |
| | | return hasLowerBound; |
| | | } |
| | | |
| | |
| | | */ |
| | | public long getLowerBound() |
| | | { |
| | | |
| | | return lowerBound; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean hasUpperBound() |
| | | { |
| | | |
| | | return hasUpperBound; |
| | | } |
| | | |
| | |
| | | */ |
| | | public long getUpperBound() |
| | | { |
| | | |
| | | return upperBound; |
| | | } |
| | | |
| | |
| | | public void setValue(long value) |
| | | throws ConfigException |
| | | { |
| | | |
| | | if (hasLowerBound && (value < lowerBound)) |
| | | { |
| | | int msgID = MSGID_CONFIG_ATTR_INT_BELOW_LOWER_BOUND; |
| | |
| | | public void setValues(List<Long> values) |
| | | throws ConfigException |
| | | { |
| | | |
| | | |
| | | // First check if the set is empty and if that is allowed. |
| | | if ((values == null) || (values.isEmpty())) |
| | | { |
| | |
| | | */ |
| | | private static LinkedHashSet<AttributeValue> getValueSet(long value) |
| | | { |
| | | |
| | | LinkedHashSet<AttributeValue> valueSet = |
| | | new LinkedHashSet<AttributeValue>(1); |
| | | |
| | |
| | | */ |
| | | private static LinkedHashSet<AttributeValue> getValueSet(List<Long> values) |
| | | { |
| | | |
| | | if (values == null) |
| | | { |
| | | return null; |
| | |
| | | */ |
| | | public void applyPendingValues() |
| | | { |
| | | |
| | | if (! hasPendingValues()) |
| | | { |
| | | return; |
| | |
| | | public boolean valueIsAcceptable(AttributeValue value, |
| | | StringBuilder rejectReason) |
| | | { |
| | | |
| | | |
| | | // First, make sure we can represent it as a long. |
| | | String stringValue = value.getStringValue(); |
| | | long longValue; |
| | |
| | | boolean allowFailures) |
| | | throws ConfigException |
| | | { |
| | | |
| | | if ((valueStrings == null) || valueStrings.isEmpty()) |
| | | { |
| | | if (isRequired()) |
| | |
| | | */ |
| | | public List<String> activeValuesToStrings() |
| | | { |
| | | |
| | | ArrayList<String> valueStrings = |
| | | new ArrayList<String>(activeValues.size()); |
| | | for (long l : activeValues) |
| | |
| | | */ |
| | | public List<String> pendingValuesToStrings() |
| | | { |
| | | |
| | | if (hasPendingValues()) |
| | | { |
| | | ArrayList<String> valueStrings = |
| | |
| | | public ConfigAttribute getConfigAttribute(List<Attribute> attributeList) |
| | | throws ConfigException |
| | | { |
| | | |
| | | |
| | | ArrayList<Long> activeValues = null; |
| | | ArrayList<Long> pendingValues = null; |
| | | |
| | |
| | | */ |
| | | public javax.management.Attribute toJMXAttributePending() |
| | | { |
| | | |
| | | return _toJMXAttribute(true); |
| | | } |
| | | |
| | |
| | | */ |
| | | public void toJMXAttribute(AttributeList attributeList) |
| | | { |
| | | |
| | | if (activeValues.size() > 0) |
| | | { |
| | | if (isMultiValued()) |
| | |
| | | */ |
| | | public void toJMXAttributeInfo(List<MBeanAttributeInfo> attributeInfoList) |
| | | { |
| | | |
| | | |
| | | if (isMultiValued()) |
| | | { |
| | | attributeInfoList.add(new MBeanAttributeInfo(getName(), |
| | |
| | | */ |
| | | public MBeanParameterInfo toJMXParameterInfo() |
| | | { |
| | | |
| | | if (isMultiValued()) |
| | | { |
| | | return new MBeanParameterInfo(getName(), JMX_TYPE_LONG_ARRAY, |
| | |
| | | public void setValue(javax.management.Attribute jmxAttribute) |
| | | throws ConfigException |
| | | { |
| | | |
| | | Object value = jmxAttribute.getValue(); |
| | | if (value instanceof Long) |
| | | { |
| | |
| | | */ |
| | | public ConfigAttribute duplicate() |
| | | { |
| | | |
| | | return new IntegerConfigAttribute(getName(), getDescription(), isRequired(), |
| | | isMultiValued(), requiresAdminAction(), |
| | | hasLowerBound, lowerBound, hasUpperBound, |