| | |
| | | protected ConfigAttribute(String name, String description, boolean isRequired, |
| | | boolean isMultiValued, boolean requiresAdminAction) |
| | | { |
| | | |
| | | |
| | | this.name = name; |
| | | this.description = description; |
| | | this.isRequired = isRequired; |
| | |
| | | boolean isMultiValued, boolean requiresAdminAction, |
| | | LinkedHashSet<AttributeValue> activeValues) |
| | | { |
| | | |
| | | |
| | | this.name = name; |
| | | this.description = description; |
| | | this.isRequired = isRequired; |
| | |
| | | boolean hasPendingValues, |
| | | LinkedHashSet<AttributeValue> pendingValues) |
| | | { |
| | | |
| | | |
| | | this.name = name; |
| | | this.description = description; |
| | | this.isRequired = isRequired; |
| | |
| | | */ |
| | | public String getName() |
| | | { |
| | | |
| | | return name; |
| | | } |
| | | |
| | |
| | | */ |
| | | public String getDescription() |
| | | { |
| | | |
| | | return description; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean isRequired() |
| | | { |
| | | |
| | | return isRequired; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean isMultiValued() |
| | | { |
| | | |
| | | return isMultiValued; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean requiresAdminAction() |
| | | { |
| | | |
| | | return requiresAdminAction; |
| | | } |
| | | |
| | |
| | | */ |
| | | public LinkedHashSet<AttributeValue> getActiveValues() |
| | | { |
| | | |
| | | return activeValues; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean hasPendingValues() |
| | | { |
| | | |
| | | return hasPendingValues; |
| | | } |
| | | |
| | |
| | | */ |
| | | public LinkedHashSet<AttributeValue> getPendingValues() |
| | | { |
| | | |
| | | if (requiresAdminAction) |
| | | { |
| | | return pendingValues; |
| | |
| | | protected void setValues(LinkedHashSet<AttributeValue> values) |
| | | throws ConfigException |
| | | { |
| | | |
| | | |
| | | // If no values are provided, then check to see if this is a required |
| | | // attribute. If it is, then reject the change. |
| | | if ((values == null) || values.isEmpty()) |
| | |
| | | */ |
| | | protected void setActiveValues(LinkedHashSet<AttributeValue> values) |
| | | { |
| | | |
| | | activeValues = values; |
| | | } |
| | | |
| | |
| | | */ |
| | | protected void setPendingValues(LinkedHashSet<AttributeValue> values) |
| | | { |
| | | |
| | | pendingValues = values; |
| | | hasPendingValues = true; |
| | | } |
| | |
| | | protected void addValues(List<AttributeValue> values) |
| | | throws ConfigException |
| | | { |
| | | |
| | | |
| | | // If there are no values provided, then do nothing. |
| | | if (values == null) |
| | | { |
| | |
| | | protected void removeValues(List<AttributeValue> values) |
| | | throws ConfigException |
| | | { |
| | | |
| | | |
| | | // Create a temporary set of values that we will use for this change. It |
| | | // may not actually be applied if an error occurs for some reason. |
| | | LinkedHashSet<AttributeValue> tempValues; |
| | |
| | | protected void removeAllValues() |
| | | throws ConfigException |
| | | { |
| | | |
| | | if (isRequired) |
| | | { |
| | | int msgID = MSGID_CONFIG_ATTR_IS_REQUIRED; |
| | |
| | | */ |
| | | public void setInitialValues(LinkedHashSet<AttributeValue> values) |
| | | { |
| | | |
| | | if (values == null) |
| | | { |
| | | values = new LinkedHashSet<AttributeValue>(); |
| | |
| | | */ |
| | | public void applyPendingValues() |
| | | { |
| | | |
| | | if (hasPendingValues) |
| | | { |
| | | activeValues = pendingValues; |