Package org.jboss.as.controller
Class DeprecationData
- java.lang.Object
-
- org.jboss.as.controller.DeprecationData
-
public final class DeprecationData extends Object
Encapsulates information about the deprecation of a management resource, attribute or operation.Notifying users about deprecated items: Some code that uses this class may choose to proactively notify users (e.g. with a log message) when the deprecated item is used. The
isNotificationUseful()method should be checked before emitting any such notification. Notifying the user should only be done if the user can take some action in response. Advising that something will be removed in a later release is not useful if there is no alternative in the current release. If theisNotificationUseful()method returnstruethe text description of the deprecated item available from the relevantread-XXX-descriptionmanagement operation should provide useful information about how the user can avoid using the deprecated item.- Author:
- Tomaz Cerar (c) 2012 Red Hat Inc.
-
-
Constructor Summary
Constructors Constructor Description DeprecationData(ModelVersion since)Creates a new DeprecationData which will returnfalsefromisNotificationUseful().DeprecationData(ModelVersion since, boolean notificationUseful)Creates a new DeprecationData, with an option to disable notifications to users when the use the deprecated item.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ModelVersiongetSince()Gets the version since which the attribute has been deprecated.booleanisNotificationUseful()Gets whether actively advising the user about the deprecation is useful.
-
-
-
Constructor Detail
-
DeprecationData
public DeprecationData(ModelVersion since)
Creates a new DeprecationData which will returnfalsefromisNotificationUseful().- Parameters:
since- the version since which the attribute has been deprecated. Cannot benull
-
DeprecationData
public DeprecationData(ModelVersion since, boolean notificationUseful)
Creates a new DeprecationData, with an option to disable notifications to users when the use the deprecated item.- Parameters:
since- the version since which the attribute has been deprecated. Cannot benullnotificationUseful- whether actively advising the user about the deprecation is useful
-
-
Method Detail
-
getSince
public ModelVersion getSince()
Gets the version since which the attribute has been deprecated.- Returns:
- the version
-
isNotificationUseful
public boolean isNotificationUseful()
Gets whether actively advising the user about the deprecation is useful. Code that proactively notifies a user (e.g. with a log message) when a deprecated item is used should check this method before producing such a notification.- Returns:
trueif advising the user is useful
-
-