|
Portlet API 2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The DynamicData is a collection of attributes (name-value pairs) that the portlet can use to tempoarily or persistently store information. Dynamic data can be attached from a various objects: the request, the session, the configuration.
Actually, we want to put this up for discussion. Copying the Servlet API, the request and the session already have attribute manipulation. However, to introduce named section of attributes for configuration and personalized data, the dynamic data object was created which turned to be quite a good fit for request and session. It adds a uniform interface to attribute manipulation, plus it provides functionality for multi-value attributes an en-bloc copying.
The question is whether the similarity to the Servlet API or consistent APIs within the Portlet API has higher priority.
Method Summary | |
void |
addAllFrom(DynamicData aData)
Adds all attributes from the given data to this data. |
void |
addAttribute(String name,
Object value)
Adds the given attribute. |
Object |
getAttribute(String name)
Returns the value of the attribute with the given name. |
Enumeration |
getAttributeNames()
Returns an enumeration of all available attributes names. |
Vector |
getAttributes(String name)
Returns a vector of attribute values for the given name. |
void |
removeAll()
Removes all attributes. |
void |
removeAttribute(String name)
Removes the attribute with the given name. |
void |
removeAttributes(String name)
Removes all attributes with the given name. |
void |
setAttribute(String name,
Object value)
Sets the attribute with the given name and value. |
void |
setAttributes(String name,
Vector values)
Sets a vector of attributes with the given name and values. |
Method Detail |
public void setAttribute(String name, Object value) throws AccessDeniedException
name
- the attribute namevalue
- the attribute valueAccessDeniedException
- if the caller isn't authorized to access
this data objectpublic void setAttributes(String name, Vector values) throws AccessDeniedException
If one ore more attributes with the given name already exist, they will be replaced with the given vector of attributes.
aName
- the attribute namevalues
- a vector of attribute valuesAccessDeniedException
- if the caller isn't authorized to access
this data objectpublic void addAttribute(String name, Object value) throws AccessDeniedException
aName
- the attribute namevalues
- a vector of attribute valuesAccessDeniedException
- if the caller isn't authorized to access
this data objectpublic Object getAttribute(String name) throws AccessDeniedException
null
is returned.
If more than one attribute exists with the given name, this
method returns the first attribute value in order.name
- the attribute nameAccessDeniedException
- if the caller isn't authorized to access
this data objectpublic Vector getAttributes(String name) throws AccessDeniedException
name
- the attribute nameAccessDeniedException
- if the caller isn't authorized to access
this data objectpublic Enumeration getAttributeNames() throws AccessDeniedException
AccessDeniedException
- if the caller isn't authorized to access
this data objectgetAttribute(String)
public void removeAttribute(String name) throws AccessDeniedException
name
- the attribute nameAccessDeniedException
- if the caller isn't authorized to access
this data objectremoveAttributes(String)
public void removeAttributes(String name) throws AccessDeniedException
name
- the attribute nameAccessDeniedException
- if the caller isn't authorized to access
this data objectpublic void removeAll() throws AccessDeniedException
AccessDeniedException
- if the caller isn't authorized to access
this data objectpublic void addAllFrom(DynamicData aData) throws AccessDeniedException
aData
- the data which is to be copied into this dataAccessDeniedException
- if the caller isn't authorized to access
either of the data objects
|
Portlet API 2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |