|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface AttributeHolder
An AttributeHolder can have attributes. When setting an attribute you can set zero to many flags that will customize how the attribute behaves on the server. You can set more than one flag on an attribute using the bitwise OR (|) operator. Example: setAttribute("name", "Chatter", "chatRoom", Attribute.FLAG_SHARED | Attribute.FLAG_IMMUTABLE)
Attribute
Method Summary | |
---|---|
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. |
Method Detail |
---|
java.lang.Object getAttributeValue(java.lang.String name)
name
- - the name of the attribute
java.lang.Object getAttributeValue(java.lang.String name, java.lang.String scope)
name
- - the name of the attributescope
- - the scope of the attribute
Attribute 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 attribute
Attribute getAttribute(java.lang.String name)
name
- - the name of the attribute to get
void 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 removed
AttributeException
void removeAttribute(java.lang.String name) throws AttributeException
name
- - the name of the attribute to remove
AttributeException
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 have
java.util.List<Attribute> getAttributes()
java.util.Map<java.lang.String,java.util.Map<java.lang.String,Attribute>> getAttributesByScope()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |