org.apache.wsrp4j.producer.provider.driver
Class PortletRegistrationFilterImpl

java.lang.Object
  extended byorg.apache.wsrp4j.producer.provider.driver.PortletRegistrationFilterImpl
All Implemented Interfaces:
PortletRegistrationFilter, PortletRegistrationFilterWriter

public class PortletRegistrationFilterImpl
extends java.lang.Object
implements PortletRegistrationFilter, PortletRegistrationFilterWriter

This class implements the interfaces PortletRegistrationFilter and PortletRegistrationFilterWriter.

Version:
$Id: PortletRegistrationFilterImpl.java,v 1.6 2005/08/12 12:56:53 cziegeler Exp $
Author:
Stefan Behl, Ralf Altrichter

Field Summary
private static java.util.HashMap consumerPortletRegistrationMap
           
private static PortletRegistrationFilterImpl filter
           
private  Logger logger
           
private  PersistentDataObject persistentDataObject
           
private  PersistentHandler persistentHandler
           
 
Constructor Summary
private PortletRegistrationFilterImpl()
          Private constructor
 
Method Summary
static PortletRegistrationFilter createReader()
           
static PortletRegistrationFilterWriter createWriter()
           
private  void delete(PersistentDataObject persistentDataObject)
          Delete the ConsumerPortletRegistration object from persistent store
 java.util.Iterator getAvailable(java.lang.String regHandle)
          Returns all portlet handles of portlets, a certain consumer (identified by regHandle) can utilize.
 boolean isAvailable(java.lang.String regHandle, java.lang.String portletHandle)
          Indicates whether a certain consumer is allowed to utilize the portlet identified by portletHandle or not.
 void makeAvailable(java.lang.String regHandle, java.util.Iterator portletHandles)
          Makes several portlets (identified by portletHandles) available to a certain consumer (identified by regHandle).
 void makeAvailable(java.lang.String regHandle, java.lang.String portletHandle)
          Makes a certain portlet (identified by portletHandle) available to a consumer (identified by regHandle).
 void remove(java.lang.String regHandle)
          Removes an entire entry for a certain consumer (identified by regHandle).
 void remove(java.lang.String regHandle, java.util.Iterator portletHandles)
          Abrogates the availability of several portlets (identified by portletHandles) regarding a certain consumer (identified by regHandle).
 void remove(java.lang.String regHandle, java.lang.String portletHandle)
          Abrogates the availability of a certain portlet (identified by portletHandle) regarding a certain consumer (identified by regHandle).
private  void restore()
          Restores ConsumerPortletRegistration objects from the persistent store.
private  void store(PersistentDataObject persistentDataObject)
          Store the ConsumerPortletRegistration object to persistent store
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

filter

private static PortletRegistrationFilterImpl filter

persistentDataObject

private PersistentDataObject persistentDataObject

persistentHandler

private PersistentHandler persistentHandler

consumerPortletRegistrationMap

private static java.util.HashMap consumerPortletRegistrationMap

logger

private Logger logger
Constructor Detail

PortletRegistrationFilterImpl

private PortletRegistrationFilterImpl()
Private constructor

Method Detail

createWriter

public static PortletRegistrationFilterWriter createWriter()
Returns:
PortletRegistrationFilterWriter

createReader

public static PortletRegistrationFilter createReader()
Returns:
PortletRegistrationFilter

getAvailable

public java.util.Iterator getAvailable(java.lang.String regHandle)
Returns all portlet handles of portlets, a certain consumer (identified by regHandle) can utilize. Returns null if there are no entries for the provided regHandle.

Specified by:
getAvailable in interface PortletRegistrationFilter
Parameters:
regHandle - String representing the registration handle of a consumer
Returns:
Iterator of portlet handles

isAvailable

public boolean isAvailable(java.lang.String regHandle,
                           java.lang.String portletHandle)
Indicates whether a certain consumer is allowed to utilize the portlet identified by portletHandle or not. Returns false if there is no entry for the provided handles.

Specified by:
isAvailable in interface PortletRegistrationFilter
Parameters:
regHandle - String representing the registration handle of a consumer
portletHandle - String representing the portlet handle of an portlet
Returns:
boolean indicating whether the consumer corresponding to regHandle is allowed to use the portlet identified by portletHandle

makeAvailable

public void makeAvailable(java.lang.String regHandle,
                          java.lang.String portletHandle)
                   throws WSRPException
Makes a certain portlet (identified by portletHandle) available to a consumer (identified by regHandle). If there is no portlet in the portlet pool that corresponds to portletHandle, the method performs nothing.

Specified by:
makeAvailable in interface PortletRegistrationFilterWriter
Parameters:
regHandle - String representing the registration handle of a consumer
portletHandle - String representing the portlet handle of a consumer
Throws:
WSRPException

makeAvailable

public void makeAvailable(java.lang.String regHandle,
                          java.util.Iterator portletHandles)
                   throws WSRPException
Makes several portlets (identified by portletHandles) available to a certain consumer (identified by regHandle). For portlet handles that do not correspond to portlets kept within the portlet pool, the method makes no availability-entry.

Specified by:
makeAvailable in interface PortletRegistrationFilterWriter
Parameters:
regHandle - String representing the registration handle of a consumer
portletHandles - Iterator containing some portlet handles of portlets
Throws:
WSRPException

remove

public void remove(java.lang.String regHandle)
Removes an entire entry for a certain consumer (identified by regHandle). If there are no entries for the provided regHandle, the method performs nothing. The method is useful when a consumer deregisters.

Specified by:
remove in interface PortletRegistrationFilterWriter
Parameters:
regHandle - String representing the registration handle of a consumer

remove

public void remove(java.lang.String regHandle,
                   java.lang.String portletHandle)
            throws WSRPException
Abrogates the availability of a certain portlet (identified by portletHandle) regarding a certain consumer (identified by regHandle). If there is no entry for the provided regHandle and portletHandle, the method performs nothing.

Specified by:
remove in interface PortletRegistrationFilterWriter
Parameters:
regHandle - String representing the registration handle of a consumer
portletHandle - String representing the portlet handle of a consumer
Throws:
WSRPException

remove

public void remove(java.lang.String regHandle,
                   java.util.Iterator portletHandles)
            throws WSRPException
Abrogates the availability of several portlets (identified by portletHandles) regarding a certain consumer (identified by regHandle). For portlet handles that do not correspond to portlets kept within the portlet pool, the method performs nothing.

Specified by:
remove in interface PortletRegistrationFilterWriter
Parameters:
regHandle - String representing the registration handle of a consumer
portletHandles - Iterator containing some portlet handles of portlets
Throws:
WSRPException

delete

private void delete(PersistentDataObject persistentDataObject)
Delete the ConsumerPortletRegistration object from persistent store

Parameters:
persistentDataObject -

store

private void store(PersistentDataObject persistentDataObject)
            throws WSRPException
Store the ConsumerPortletRegistration object to persistent store

Parameters:
persistentDataObject -
Throws:
WSRPException

restore

private void restore()
              throws WSRPException
Restores ConsumerPortletRegistration objects from the persistent store.

Throws:
WSRPException


--