public interface AttributeHolder
Attribute
Modifier and Type | Method and Description |
---|---|
Attribute |
getAttribute(java.lang.String name)
Gets a global scope (Attribute.SCOPE_GLOBAL) attribute with the given name or null if no such attribute exists.
|
Attribute |
getAttribute(java.lang.String name,
java.lang.String scope)
Gets an attribute or null if no such attribute exists.
|
java.util.List<Attribute> |
getAttributes()
Returns all of the attributes for this AttributeHolder.
|
java.util.List<Attribute> |
getAttributes(java.lang.String scope,
int flags)
Returns the list of attributes in the given scope that match the given flags.
|
java.util.Map<java.lang.String,java.util.Map<java.lang.String,Attribute>> |
getAttributesByScope()
Returns all of the attributes on the server.
|
java.lang.Object |
getAttributeValue(java.lang.String name)
Returns the value of the attribute with the given name from the global scope (Attribute.SCOPE_GLOBAL) or null if the attribute
doesn't exist.
|
java.lang.Object |
getAttributeValue(java.lang.String name,
java.lang.String scope)
Returns the value of the attribute with the given name from the given scope or null if the attribute
doesn't exist.
|
void |
onChangeAttribute(Attribute attr)
Callback to attribute holders when an attribute changes.
|
void |
onRemoveAttribute(Attribute attr)
Callback to attribute holders when an attribute is removed.
|
void |
removeAttribute(java.lang.String name)
Removes the global scoped attribute with the given name.
|
void |
removeAttribute(java.lang.String name,
java.lang.String scope)
Removes the attribute with the given name from the given scope.
|
Attribute |
setAttribute(java.lang.String name,
java.lang.Object value,
java.lang.String scope,
int flags)
Sets or updates an attribute on the attribute holder.
|
java.lang.Object getAttributeValue(java.lang.String name)
name
- - the name of the attributejava.lang.Object getAttributeValue(java.lang.String name, java.lang.String scope)
name
- - the name of the attributescope
- - the scope of the attributeAttribute setAttribute(java.lang.String name, java.lang.Object value, java.lang.String scope, int flags) throws AttributeException
name
- - the name of the attributevalue
- - the value of the attributescope
- - the scope of the attributeflags
- - the flags set for the attribute (eg. Attribute.FLAG_SHARED | Attribute.FLAG_IMMUTABLE)AttributeException
Attribute getAttribute(java.lang.String name, java.lang.String scope)
name
- - the name of the attribute to getscope
- - the scope of the attributeAttribute getAttribute(java.lang.String name)
name
- - the name of the attribute to getvoid removeAttribute(java.lang.String name, java.lang.String scope) throws AttributeException
name
- - the name of the attribute to removescope
- - the scope of the attribute being removedAttributeException
void removeAttribute(java.lang.String name) throws AttributeException
name
- - the name of the attribute to removeAttributeException
void onChangeAttribute(Attribute attr)
attr
- - the attribute that was changedvoid onRemoveAttribute(Attribute attr)
attr
- - the attribute that was removedjava.util.List<Attribute> getAttributes(java.lang.String scope, int flags)
scope
- - the scope the attributes must exist inflags
- - the flags the attributes must havejava.util.List<Attribute> getAttributes()
java.util.Map<java.lang.String,java.util.Map<java.lang.String,Attribute>> getAttributesByScope()