|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Variable
An interface to variables supporting dynamic attributes, operations and notifications exposed through the DynamicMBean interface.
Note that internal attributes of implemented interfaces have higher precedence than dynamic attributes in operations of the DynamicMBean interface, but typically they are not available in operations of the Variable interface.
Field Summary | |
---|---|
static String |
ADD_ATTRIBUTE_ELEMENT
Add attribute element method. |
static String |
ADD_ATTRIBUTE_INFO
Add attribute info method. |
static String |
ADD_VALIDATED_ELEMENT
Add validated element method. |
static char |
ATTRIBUTE_ELEMENT_SEPARATOR
The attribute element separator char. |
static String |
ATTRIBUTE_INFO
Attribute info method. |
static String |
ATTRIBUTE_LENGTH
Attribute length method. |
static String |
ATTRIBUTE_LIST
Attribute list method. |
static String |
ATTRIBUTE_POSITION
Attribute position method. |
static String |
ATTRIBUTE_VALUES
Attribute values attribute. |
static String |
CLEAR_ATTRIBUTE_INFO
Clear attribute info method. |
static String |
CLEAR_ATTRIBUTE_VALUES
Clear attribute values method. |
static String |
CONTAINS_ATTRIBUTE
Contains attribute method. |
static String |
CONTAINS_TRAIT
Contains trait method. |
static String |
EXPORT_ATTRIBUTES
Export attributes method. |
static String |
GET_ATTRIBUTE_ELEMENT
Get attribute element method. |
static String |
GET_ATTRIBUTE_VALUE
Get attribute value method. |
static String |
GET_RECURSIVE_ELEMENT
Get recursive element method. |
static String |
GET_RECURSIVE_VALUE
Get recursive value method. |
static String |
GET_VALIDATED_ELEMENT
Get validated element method. |
static String |
GET_VALIDATED_VALUE
Get validated value method. |
static String |
ID
Id attribute. |
static String |
ID_ATTRIBUTE_LIST
Id attribute list method. |
static String |
IMPORT_ATTRIBUTES
Import attributes method. |
static String |
REMOVE_ATTRIBUTE_ELEMENT
Remove attribute element method. |
static String |
REMOVE_VALIDATED_ELEMENT
Remove validated element method. |
static String |
REPLACE_ATTRIBUTE_INFO
Replace attribute info method. |
static String |
RESET_VALIDATED_VALUES
Reset validated values method. |
static String |
SET_ATTRIBUTE_ELEMENT
Set attribute element method. |
static String |
SET_ATTRIBUTE_VALUE
Set attribute value method. |
static String |
SET_ATTRIBUTE_VALUES
Set attribute values method. |
static String |
SET_VALIDATED_ELEMENT
Set validated element method. |
static String |
SET_VALIDATED_VALUE
Set validated value method. |
static String |
TYPE
Type attribute. |
static String |
VALIDATE_ATTRIBUTE_VALUES
Validate attribute values method. |
static String |
VALIDATED_VALUES
Validated values method. |
static String |
VARIABLE_INFO
Variable info method. |
Fields inherited from interface org.norther.tammi.core.base.ReferableMBean |
---|
MBEAN, NS |
Method Summary | |
---|---|
void |
addAttributeElement(String name,
int index,
Object value)
Adds an indexed element to an array attribute without validation. |
void |
addAttributeElement(String name,
Object value)
Adds an element to an array attribute without validation. |
boolean |
addAttributeInfo(Collection<? extends MBeanFeatureInfo> attrs,
int... position)
Adds attribute info of new attributes to this variable if they're not already present. |
void |
addValidatedElement(String name,
int index,
Object value,
Object... localization)
Adds an indexed element to a dynamic array attribute with validation. |
void |
addValidatedElement(String name,
Object... localizedValue)
Adds an element to a dynamic array attribute with validation. |
Collection<VariableAttributeInfo> |
attributeInfo()
Returns attribute info of dynamic attributes of this variable. |
VariableAttributeInfo |
attributeInfo(String name,
boolean... modifiable)
Returns optionally modifiable or recursive attribute info of a named attribute. |
int |
attributeLength(String name)
Returns the length of an array attribute. |
List<VariableAttributeInfo> |
attributeList(boolean... modifiable)
Returns optionally modifiable attribute info of all attributes in the definition order without internal attributes. |
int |
attributePosition(String name)
Returns the position of the named attribute. |
void |
clearAttributeInfo()
Clears attribute info of dynamic attributes of this variable. |
void |
clearAttributeValues()
Clears attribute values of the current attributes. |
Object |
clone()
Clones this variable. |
boolean |
containsAttribute(String name)
Checks whether the named attribute exists. |
boolean |
containsTrait(VariableAttributeInfo.Trait trait)
Checks whether the specified trait is permanently on in any of the attributes. |
AttributeList |
exportAttributes(Object target,
AttributeFilter... filter)
Exports filtered attribute values to another object. |
Object |
getAttribute(String name)
Gets the value of the named internal or dynamic attribute without access checks and any variable specific validation. |
Object |
getAttributeElement(String name,
int index)
Gets the indexed element of an array attribute without validation. |
AttributeList |
getAttributes(String[] names)
Gets the values of the named internal or dynamic attributes without access checks and any variable specific validation. |
Object |
getAttributeValue(String name)
Gets the value of the named dynamic attribute without access checks and any variable specific validation. |
Map<String,Object> |
getAttributeValues()
Gets attribute values as a map of name value bindings without validation. |
Object |
getId()
Gets the id of this variable corresponding to its primary attributes. |
Object |
getRecursiveElement(String name,
int index,
String... pattern)
Gets the first non-recursive indexed element of an recursive dynamic array attribute with validation. |
Object |
getRecursiveValue(String name,
String... pattern)
Gets the first non-recursive value of a named recursive dynamic attribute with validation. |
String |
getType()
Gets the type of this variable. |
Object |
getValidatedElement(String name,
int index)
Gets the indexed element of a dynamic array attribute with validation. |
Object |
getValidatedValue(String name)
Gets the value of a named dynamic attribute with validation. |
List<VariableAttributeInfo> |
idAttributeList()
Returns attribute info of id attributes in the definition order. |
AttributeList |
importAttributes(Object source,
AttributeFilter... filter)
Imports filtered attribute values from another object. |
Object |
removeAttributeElement(String name,
int index)
Removes the indexed element from an array attribute without validation. |
boolean |
removeAttributeElement(String name,
Object value)
Removes an element from an array attribute without validation. |
Object |
removeValidatedElement(String name,
int index,
Object... localization)
Removes the indexed element from a dynamic array attribute with validation. |
boolean |
removeValidatedElement(String name,
Object... localizedValue)
Removes an element from a dynamic array attribute with validation. |
void |
replaceAttributeInfo(Collection<? extends MBeanFeatureInfo> attrs)
Replaces attribute info of dynamic attributes of this variable. |
SortedMap<String,Exception> |
resetValidatedValues(Map<?,?> attributes,
Object... localization)
Resets attribute values in a map of name value bindings with validation. |
void |
setAttribute(Attribute attr)
Sets the value of the given internal or dynamic attribute without access checks and any variable specific validation. |
void |
setAttributeElement(String name,
int index,
Object value)
Sets the indexed element of an array attribute without validation. |
AttributeList |
setAttributes(AttributeList attrs)
Sets the values of the listed internal or dynamic attributes without access checks and any variable specific validation. |
void |
setAttributeValue(String name,
Object value)
Sets the value of the named dynamic attribute without access checks and any variable specific validation. |
void |
setAttributeValues(Map<?,?> attributes)
Sets attribute values in a map of name value bindings without validation. |
void |
setAttributeValues(Map<?,?> attributes,
Object... localization)
Sets attribute values in a map of name value bindings without validation. |
void |
setId(Object id)
Sets the id of this variable corresponding to its primary attributes. |
void |
setValidatedElement(String name,
int index,
Object value,
Object... localization)
Sets the indexed element of a dynamic array attribute with validation. |
void |
setValidatedValue(String name,
Object value,
Object... localization)
Sets the value of an attribute as a name value pair with validation. |
SortedMap<String,Exception> |
validateAttributeValues()
Validates attribute values of the current attributes. |
SortedMap<String,Exception> |
validateAttributeValues(Map<?,?> attributes,
Object... localization)
Validates attribute values in a map of name value bindings. |
Map<String,Object> |
validatedValues(AttributeFilter... filter)
Returns validated attribute values as a map of name value bindings. |
VariableInfo |
variableInfo(boolean... modifiable)
Returns optionally modifiable variable info of this variable. |
Methods inherited from interface org.norther.tammi.core.base.ReferableMBean |
---|
getMBean |
Methods inherited from interface javax.management.DynamicMBean |
---|
getMBeanInfo, invoke |
Field Detail |
---|
static final String ID
static final String TYPE
static final String ATTRIBUTE_VALUES
static final String SET_ATTRIBUTE_VALUES
static final String GET_ATTRIBUTE_VALUE
static final String SET_ATTRIBUTE_VALUE
static final String GET_ATTRIBUTE_ELEMENT
static final String SET_ATTRIBUTE_ELEMENT
static final String ADD_ATTRIBUTE_ELEMENT
static final String REMOVE_ATTRIBUTE_ELEMENT
static final String VALIDATED_VALUES
static final String RESET_VALIDATED_VALUES
static final String VALIDATE_ATTRIBUTE_VALUES
static final String CLEAR_ATTRIBUTE_VALUES
static final String GET_VALIDATED_VALUE
static final String SET_VALIDATED_VALUE
static final String GET_VALIDATED_ELEMENT
static final String SET_VALIDATED_ELEMENT
static final String ADD_VALIDATED_ELEMENT
static final String REMOVE_VALIDATED_ELEMENT
static final String GET_RECURSIVE_VALUE
static final String GET_RECURSIVE_ELEMENT
static final String ATTRIBUTE_LENGTH
static final String VARIABLE_INFO
static final String ATTRIBUTE_INFO
static final String ADD_ATTRIBUTE_INFO
static final String REPLACE_ATTRIBUTE_INFO
static final String CLEAR_ATTRIBUTE_INFO
static final String ATTRIBUTE_LIST
static final String CONTAINS_ATTRIBUTE
static final String CONTAINS_TRAIT
static final String ID_ATTRIBUTE_LIST
static final String ATTRIBUTE_POSITION
static final String IMPORT_ATTRIBUTES
static final String EXPORT_ATTRIBUTES
static final char ATTRIBUTE_ELEMENT_SEPARATOR
Method Detail |
---|
Object clone()
Object getAttribute(String name) throws AttributeNotFoundException, ReflectionException, MBeanException
getAttribute
in interface DynamicMBean
name
- the attribute name.
AttributeNotFoundException
- if the name is unknown.
ReflectionException
- if a getter is not found.
MBeanException
- if getting of the value fails.void setAttribute(Attribute attr) throws AttributeNotFoundException, InvalidAttributeValueException, ReflectionException, MBeanException
setAttribute
in interface DynamicMBean
attr
- the attribute to set.
AttributeNotFoundException
- if the name is unknown.
InvalidAttributeValueException
- if the value is invalid.
ReflectionException
- if a getter is not found.
MBeanException
- if getting of the value fails.AttributeList getAttributes(String[] names)
getAttributes
in interface DynamicMBean
names
- an array of attribute names.
AttributeList setAttributes(AttributeList attrs)
setAttributes
in interface DynamicMBean
attrs
- the attributes to set.
Map<String,Object> getAttributeValues()
void setAttributeValues(Map<?,?> attributes) throws InvalidAttributeValueException
This method provides compatibility with bean accessors.
attributes
- the attributes map.
InvalidAttributeValueException
- if values are invalid.void setAttributeValues(Map<?,?> attributes, Object... localization) throws InvalidAttributeValueException
attributes
- the attributes map.localization
- optional base name, resource bundle and locale.
InvalidAttributeValueException
- if values are invalid.Object getAttributeValue(String name) throws AttributeNotFoundException
name
- the attribute name.
AttributeNotFoundException
- if the name is unknown.void setAttributeValue(String name, Object value) throws AttributeNotFoundException, InvalidAttributeValueException
name
- the attribute name.value
- the attribute value.
AttributeNotFoundException
- if the name is unknown.
InvalidAttributeValueException
- if the value is invalid.Object getAttributeElement(String name, int index) throws AttributeNotFoundException
name
- the attribute name.index
- the element index.
AttributeNotFoundException
- if the name is unknown.void setAttributeElement(String name, int index, Object value) throws AttributeNotFoundException, InvalidAttributeValueException
name
- the attribute name.index
- the element index.value
- the value of the element.
AttributeNotFoundException
- if the name is unknown.
InvalidAttributeValueException
- if the value is invalid.void addAttributeElement(String name, Object value) throws AttributeNotFoundException, InvalidAttributeValueException
name
- the attribute name.value
- the value of the element.
AttributeNotFoundException
- if the name is unknown.
InvalidAttributeValueException
- if the value is invalid.void addAttributeElement(String name, int index, Object value) throws AttributeNotFoundException, InvalidAttributeValueException
name
- the attribute name.index
- the element index.value
- the value of the element.
AttributeNotFoundException
- if the name is unknown.
InvalidAttributeValueException
- if the value is invalid.boolean removeAttributeElement(String name, Object value) throws AttributeNotFoundException
name
- the attribute name.value
- the value of the element.
AttributeNotFoundException
- if the name is unknown.Object removeAttributeElement(String name, int index) throws AttributeNotFoundException
name
- the attribute name.index
- the element index.
AttributeNotFoundException
- if the name is unknown.Map<String,Object> validatedValues(AttributeFilter... filter)
filter
- an optional filter.
SortedMap<String,Exception> resetValidatedValues(Map<?,?> attributes, Object... localization)
Invalid attributes are returned in a map binding an invalid attribute name to a validation exception. An empty map indicates that all attributes were valid.
Note that if the attributes map does not contain any settable values, null is returned.
attributes
- the attributes map.localization
- optional base name, resource bundle and locale.
SortedMap<String,Exception> validateAttributeValues(Map<?,?> attributes, Object... localization)
Invalid attributes are returned in a map binding an invalid attribute name to a validation exception. An empty map indicates that all attributes were valid.
Note that if the attributes map does not contain any settable values, null is returned.
attributes
- the attributes map.localization
- optional base name, resource bundle and locale.
SortedMap<String,Exception> validateAttributeValues()
Invalid attributes are returned in a map binding an invalid attribute name to a validation exception. An empty map indicates that all attributes were valid.
void clearAttributeValues()
Object getValidatedValue(String name) throws AttributeNotFoundException
name
- the attribute name.
AttributeNotFoundException
- if the name is unknown.void setValidatedValue(String name, Object value, Object... localization) throws AttributeNotFoundException, InvalidAttributeValueException
name
- the attribute name.value
- the attribute value.localization
- optional base name, resource bundle and locale.
AttributeNotFoundException
- if the name is unknown.
InvalidAttributeValueException
- if the value is invalid.Object getValidatedElement(String name, int index) throws AttributeNotFoundException
name
- the attribute name.index
- the element index.
AttributeNotFoundException
- if the name is unknown.void setValidatedElement(String name, int index, Object value, Object... localization) throws AttributeNotFoundException, InvalidAttributeValueException
name
- the attribute name.index
- the element index.value
- the value of the element.localization
- optional base name, resource bundle and locale.
AttributeNotFoundException
- if the name is unknown.
InvalidAttributeValueException
- if the value is invalid.void addValidatedElement(String name, Object... localizedValue) throws AttributeNotFoundException, InvalidAttributeValueException
name
- the attribute name.localizedValue
- the value of the element and optional base name,
resource bundle and locale.
AttributeNotFoundException
- if the name is unknown.
InvalidAttributeValueException
- if the value is invalid.void addValidatedElement(String name, int index, Object value, Object... localization) throws AttributeNotFoundException, InvalidAttributeValueException
name
- the attribute name.index
- the element index.value
- the value of the element.localization
- optional base name, resource bundle and locale.
AttributeNotFoundException
- if the name is unknown.
InvalidAttributeValueException
- if the value is invalid.boolean removeValidatedElement(String name, Object... localizedValue) throws AttributeNotFoundException
Nota that Java things that separate localization would be ambiguous with the indexed alternative to remove elements.
name
- the attribute name.localizedValue
- the value of the element and optional base name,
resource bundle and locale.
AttributeNotFoundException
- if the name is unknown.Object removeValidatedElement(String name, int index, Object... localization) throws AttributeNotFoundException
name
- the attribute name.index
- the element index.localization
- optional base name, resource bundle and locale.
AttributeNotFoundException
- if the name is unknown.Object getRecursiveValue(String name, String... pattern) throws AttributeNotFoundException
name
- the attribute name.pattern
- an optional pattern
AttributeNotFoundException
- if the name is unknown.Object getRecursiveElement(String name, int index, String... pattern) throws AttributeNotFoundException
name
- the attribute name.index
- the element index.pattern
- an optional pattern
AttributeNotFoundException
- if the name is unknown.int attributeLength(String name) throws AttributeNotFoundException
name
- the attribute name.
AttributeNotFoundException
- if the name is unknown.VariableInfo variableInfo(boolean... modifiable)
modifiable
- true to get modifiable info, false otherwise.
Collection<VariableAttributeInfo> attributeInfo()
boolean addAttributeInfo(Collection<? extends MBeanFeatureInfo> attrs, int... position)
attrs
- a collection of MBeanFeatureInfo instances.position
- the attribute position (-1 = at the end).
UnsupportedOperationException
- if immutable.void replaceAttributeInfo(Collection<? extends MBeanFeatureInfo> attrs)
attrs
- a collection of MBeanFeatureInfo instances.
UnsupportedOperationException
- if immutable.void clearAttributeInfo()
UnsupportedOperationException
- if immutable.List<VariableAttributeInfo> attributeList(boolean... modifiable)
modifiable
- true for modifiable, false otherwise.
VariableAttributeInfo attributeInfo(String name, boolean... modifiable)
name
- the name of the attribute.modifiable
- true for modifiable and recursive, false otherwise.
List<VariableAttributeInfo> idAttributeList()
boolean containsAttribute(String name)
name
- the name of the attribute.
boolean containsTrait(VariableAttributeInfo.Trait trait)
Note that attributs of recursive elements are scanned, too.
trait
- the trait to check.
int attributePosition(String name)
name
- the attribute name.
String getType()
Object getId()
void setId(Object id) throws AttributeNotFoundException, InvalidAttributeValueException
Note that ids of recursive elements are nullified, too.
id
- the id or null if not defined.
AttributeNotFoundException
- if the id is unknown.
InvalidAttributeValueException
- if the id is invalid.AttributeList importAttributes(Object source, AttributeFilter... filter)
Note that attributes of compatible types are accepted directly without validation.
source
- the source object.filter
- an optional attribute filter to apply.
AttributeList exportAttributes(Object target, AttributeFilter... filter)
target
- the target object.filter
- an optional attribute filter to apply.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |