[
https://issues.jboss.org/browse/AS7-5112?page=com.atlassian.jira.plugin.s...
]
Tomaz Cerar commented on AS7-5112:
----------------------------------
example for deprecating operations and/or its prameters
{code:java}
private static final SimpleAttributeDefinition MIME_NAME = new
SimpleAttributeDefinitionBuilder(Constants.NAME, ModelType.STRING, true)
.setFlags(AttributeAccess.Flag.RESTART_ALL_SERVICES)
.setValidator(new StringLengthValidator(1, true))
.setDeprecated(ModelVersion.create(1,2,0))
.build();
private static final SimpleAttributeDefinition MIME_VALUE = new
SimpleAttributeDefinitionBuilder(Constants.VALUE, ModelType.STRING, true)
.setFlags(AttributeAccess.Flag.RESTART_ALL_SERVICES)
.setValidator(new StringLengthValidator(1, true))
.build();
private static final OperationDefinition ADD_MIME = new
SimpleOperationDefinitionBuilder("add-mime",
WebExtension.getResourceDescriptionResolver("container.mime-mapping"))
.setDeprecated(ModelVersion.create(1,2))
.setParameters(MIME_NAME, MIME_VALUE)
.build();
{code}
and dmr output
{noformat}
"operations" => {
"add-mime" => {
"operation-name" => "add-mime",
"description" => "Adds mime type",
"request-properties" => {
"name" => {
"type" => STRING,
"description" => "A mime-mapping name.",
"expressions-allowed" => false,
"required" => false,
"nillable" => true,
"min-length" => 1L,
"max-length" => 2147483647L,
"deprecated" => {
"since" => "1.2.0",
"reason" => "this attribute is deprecated"
}
},
"value" => {
"type" => STRING,
"description" => "A mime-mapping value.",
"expressions-allowed" => false,
"required" => false,
"nillable" => true,
"min-length" => 1L,
"max-length" => 2147483647L
}
},
"reply-properties" => {},
"deprecated" => {
"since" => "1.2.0",
"reason" => "operation is deprecated"
}
},
{noformat}
Add deprecation information to management API metadata
------------------------------------------------------
Key: AS7-5112
URL:
https://issues.jboss.org/browse/AS7-5112
Project: Application Server 7
Issue Type: Feature Request
Components: Domain Management
Reporter: Brian Stansberry
Assignee: Tomaz Cerar
Fix For: 7.3.0.Alpha1
Add metadata describing that we have deprecated:
1) Resources
2) Attributes
3) Operations
4) Operation parameters
We'll need to sort out exactly what info to provide. We can declare in what
management API version an item was deprecated, and provide some localized text explaining.
More problematic would be info on what "version" the item will be removed in
(outside of vague wording in the description text). Probably including such info would be
a mistake; prone to error.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:
http://www.atlassian.com/software/jira