org.apache.wsrp4j.producer.provider
Interface PortletPool


public interface PortletPool

This class provides the interface to the portlet pool. All portlets (producer offered as well as consumer configured portlets) should be kept within the portlet pool. It is recommended that this interface is implemented by a container associating portlet handles with portlet-objects.

Author:
Stefan Behl

Method Summary
 Portlet clone(java.lang.String portletHandle)
          Clones an portlet (Producer Offered or Consumer Configured Portlet) associated by portlet-handle.
 boolean destroy(java.lang.String portletHandle)
          Deletes the portlet identified by portletHandle from the PortletPool.
 java.util.Iterator destroySeveral(java.util.Iterator portletHandles)
          Deletes several portlets from the PortletPool.
 Portlet get(java.lang.String portletHandle)
          Returns a certain portlet identified by portletHandle.
 java.util.Iterator getAllConsumerConfiguredPortlets()
          Returns all portlets that are currently stored within the PortletPool.
 java.util.Iterator getAllProducerOfferedPortlets()
          Returns all portlets that are currently stored within the PortletPool.
 

Method Detail

clone

public Portlet clone(java.lang.String portletHandle)
              throws WSRPException

Clones an portlet (Producer Offered or Consumer Configured Portlet) associated by portlet-handle. Only the portlet-object should be cloned, not the portlet-description the portlet references.

Adds the new Consumer Configured Portlet (after assigning a new portletHandle)to the hashmap after cloning.

Creates a new portlet state corresponding to the portlet state of the portlet to be cloned by calling the PortletStateManager.

Throws CommonException if portlet to be cloned could not be found

Parameters:
portletHandle - String identifying the portlet to be cloned.
Returns:
ConsumerConfiguredPortlet The portlet-clone.
Throws:
WSRPException

getAllProducerOfferedPortlets

public java.util.Iterator getAllProducerOfferedPortlets()
Returns all portlets that are currently stored within the PortletPool.

Returns:
Iterator of an portlet collection containing all portlets.

getAllConsumerConfiguredPortlets

public java.util.Iterator getAllConsumerConfiguredPortlets()
Returns all portlets that are currently stored within the PortletPool.

Returns:
Iterator of an portlet collection containing all portlets.

get

public Portlet get(java.lang.String portletHandle)
            throws WSRPException
Returns a certain portlet identified by portletHandle. Throws CommonException if there is no portlet corresponding to portletHandle.

Parameters:
portletHandle - String representing the portletHandle.
Returns:
ProducerOfferedPortlet portlet-object identified by portletHandle.
Throws:
WSRPException

destroy

public boolean destroy(java.lang.String portletHandle)
                throws WSRPException

Deletes the portlet identified by portletHandle from the PortletPool. Only consumer configured portlets can be deleted, NOT producer offered ones. After update, the persistent file store is refreshed.

Deletes all existing portlet sessions (SessionHandler) and portlet states (PortletStateManager) as well.

Throws CommonException if portlet corresponding to portletHandle could not be found.

Parameters:
portletHandle - String representing the portletHandle.
Returns:
Boolean indicating if deletion was successful. Returns false, if portletHandle refers to a producer offered portlet.
Throws:
WSRPException

destroySeveral

public java.util.Iterator destroySeveral(java.util.Iterator portletHandles)
Deletes several portlets from the PortletPool.

Parameters:
portletHandles - Iterator of portletHandles.
Returns:
Iterator containing those portletHandles refering to portlets that could not be deleted (e.g. producer offered portlets).