org.apache.jetspeed.service
Interface PersistenceService


public interface PersistenceService
extends Service

The PersistenceService class is a instantiated as a portlet-specific object. It provides methods to set and remove attributes from an attribute set that can be stored and reset.

The PersistenceService does not require any specific parameters, although concrete implementations may do so.

A name for the persistence service still has to be agreed on.

See Also:
PersistenceFactory

Inner Class Summary
static interface PersistenceService.Page
           
 
Method Summary
 java.lang.String getAttribute(java.lang.String aName)
          Returns the attribute value of the attribute with the given name.
 java.util.Enumeration getAttributeNames()
          Returns an enumeration of the attribute names of all attributes that the persistence service is aware of.
 java.lang.String[] getAttributes(java.lang.String aName)
          Returns an array of attribute values of attributes with the given name.
 java.util.Enumeration getPages()
          Returns an enumeration of all pages that the persistence service for the portlet manages for this user.
 void removeAttribute(java.lang.String aName)
          Removes the attribute with the given name.
 void reset()
          Resets the persistence service to forget about all attributes previously collected.
 void setAttribute(java.lang.String aName, java.lang.String aValue)
          Sets an attribute with the given name and value
 void setAttributes(java.lang.String aName, java.lang.String[] aValues)
          Sets an array of attributes with the given name and values.
 void store()
          Stores the current set of attributes.
 
Methods inherited from interface org.apache.jetspeed.service.Service
getName, init
 

Method Detail

getAttribute

public java.lang.String getAttribute(java.lang.String aName)
Returns the attribute value of the attribute with the given name. If multiple values exist for the same attribute name, this method returns the first in order.
Parameters:
aName - the attribute name
Returns:
the attribute value

getAttributes

public java.lang.String[] getAttributes(java.lang.String aName)
Returns an array of attribute values of attributes with the given name.
Parameters:
aName - the attribute name
Returns:
an array of attribute values

getAttributeNames

public java.util.Enumeration getAttributeNames()
Returns an enumeration of the attribute names of all attributes that the persistence service is aware of.
Returns:
the enumeration of attribute names

setAttribute

public void setAttribute(java.lang.String aName,
                         java.lang.String aValue)
Sets an attribute with the given name and value
Parameters:
aName - the attribute name
aValue - the attribute value

setAttributes

public void setAttributes(java.lang.String aName,
                          java.lang.String[] aValues)
Sets an array of attributes with the given name and values. The order of attribute values with the identical attribute name space is preserved.
Parameters:
aName - the attribute name
aValues - an array of attribute values

removeAttribute

public void removeAttribute(java.lang.String aName)
Removes the attribute with the given name.
Parameters:
aName - the attribute name

reset

public void reset()
Resets the persistence service to forget about all attributes previously collected.

store

public void store()
Stores the current set of attributes. Any subsequent changes to the set of attributes or the attributes themselves will not be persistent until another call to store the attributes.

getPages

public java.util.Enumeration getPages()
Returns an enumeration of all pages that the persistence service for the portlet manages for this user.
Returns:
an enumeration of pages