[
https://issues.jboss.org/browse/AS7-2142?page=com.atlassian.jira.plugin.s...
]
Brian Stansberry commented on AS7-2142:
---------------------------------------
Correct; any operation like this would just be a shorthand for :write-attribute(name=foo)
with no value attribute, leading to the attribute having an undefined value in the model.
Or failure if undefined was not a legal value. For any attribute with a default value,
undefined should be legal; if not it's a bug in the attribute implementation.
This would actually be trivial to do; TBH the biggest issue is what to call the
operation.
It would not set the value to some "default" in the sense a user might expect:
i.e. that if the metadata says the default for attribute foo is 2, now 2 is stored in the
model. The attribute would be undefined in the model. This would only be noticeable to a
user if they did :read-resource(include-defaults=false) or
:read-attribute(name=foo,include-defaults=false). If they did that they would get
undefined, not 2.
This subtlety is where the name of the operation becomes relevant. I was thinking
"clear-attribute" as that more directly says what the operation really does. The
"reset-attribute" name is ok too. It somewhat begs the question of "reset
to what?" and the answer isn't trivial. Either way though, the metadata
describing the operation would explain what it does, as would its section in
https://docs.jboss.org/author/display/AS7/Global+operations .
If anyone has an opinion on the name, please state it; otherwise I'll pick one at some
point.
Domain model usability: missing :reset-attribute command
--------------------------------------------------------
Key: AS7-2142
URL:
https://issues.jboss.org/browse/AS7-2142
Project: Application Server 7
Issue Type: Bug
Components: Domain Management
Affects Versions: 7.1.0.Alpha1
Reporter: Rostislav Svoboda
Assignee: Brian Stansberry
Fix For: 7.1.0.CR1
We have _:read-attribute_ and _:write-attribute_ commands but we do not have
*:remove-attribute* command. It would be invoked on attributes which have flag required
set to false.
For example when I define socket-binding-port-offset for server-group I can't remove
it and I can't set it to 0 using CLI.
{code}
/server-group=main-server-group:read-resource-description()
"socket-binding-port-offset" => {
"description" => "The default offset to be added to the
port values given by the socket binding group.",
"type" => INT,
"required" => false,
"access-type" => "read-write",
"storage" => "configuration",
"restart-required" => "no-services"
},
{code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira