org.apache.wsrp4j.consumer.driver
Class PortletDriverImpl

java.lang.Object
  extended byorg.apache.wsrp4j.consumer.driver.PortletDriverImpl
All Implemented Interfaces:
PortletDriver

public class PortletDriverImpl
extends java.lang.Object
implements PortletDriver

This class implements a portlet driver

Version:
$Id: PortletDriverImpl.java,v 1.11 2005/08/25 19:15:18 dlouzan Exp $

Field Summary
private  ConsumerEnvironment consumerEnv
           
protected  oasis.names.tc.wsrp.v1.types.PortletDescription desc
           
private  oasis.names.tc.wsrp.v1.types.CookieProtocol initCookie
           
private static Logger logger
           
private  oasis.names.tc.wsrp.v1.intf.WSRP_v1_Markup_PortType markupPort
           
private  ParameterChecker parameterChecker
           
private  WSRPPortlet portlet
           
private  oasis.names.tc.wsrp.v1.intf.WSRP_v1_PortletManagement_PortType portletPort
           
private  Producer producer
           
 
Constructor Summary
PortletDriverImpl(WSRPPortlet portlet, ConsumerEnvironment consumerEnv)
           
 
Method Summary
private  void checkInitCookie(java.lang.String userID)
           
 oasis.names.tc.wsrp.v1.types.PortletContext clonePortlet(java.lang.String userID)
          Clone the portlet
protected  boolean contains(java.lang.String[] array, java.lang.String object)
          Helper method for searching a string in a string array.
 oasis.names.tc.wsrp.v1.types.DestroyPortletsResponse destroyPortlets(java.lang.String[] portletHandles, java.lang.String userID)
          Destroy the producer portlets specified in the entiyHandles array.
private  oasis.names.tc.wsrp.v1.types.InteractionParams getInteractionParams(InteractionRequest actionRequest)
           
 oasis.names.tc.wsrp.v1.types.MarkupResponse getMarkup(MarkupRequest markupRequest, java.lang.String userID)
          This method is used to retrieve the markup generated by the portlet instance.
private  oasis.names.tc.wsrp.v1.types.MarkupParams getMarkupParams(WSRPBaseRequest request)
           
 WSRPPortlet getPortlet()
          Get the portlet this driver is bind to.
 oasis.names.tc.wsrp.v1.types.PortletDescriptionResponse getPortletDescription(java.lang.String userID, java.lang.String[] desiredLocales)
          Fetches information about the portlet from the producer.
 oasis.names.tc.wsrp.v1.types.PropertyList getPortletProperties(java.lang.String[] names, java.lang.String userID)
          Get the current values of the properties with the given names.
 oasis.names.tc.wsrp.v1.types.PortletPropertyDescriptionResponse getPortletPropertyDescription(java.lang.String userID)
          Fetches all published properties of an remote portlet.
protected  oasis.names.tc.wsrp.v1.types.RuntimeContext getRuntimeContext(WSRPBaseRequest request)
          Create the runtime context for the current request.
private  oasis.names.tc.wsrp.v1.types.UserContext getUserContext(java.lang.String userID)
           
protected  java.lang.String[] getValidValues(java.lang.String[] supported, java.lang.String[] allowed)
          Calculate the valid values for modes and window states.
 void initCookie()
          Actual WSRP initCookie() call
 oasis.names.tc.wsrp.v1.types.BlockingInteractionResponse performBlockingInteraction(InteractionRequest actionRequest, java.lang.String userID)
          This method is used to perform a blocking interaction on the portlet instance.
 oasis.names.tc.wsrp.v1.types.ReturnAny releaseSessions(java.lang.String[] sessionIDs, java.lang.String userID)
          Inform the producer that the sessions specified in the sessionIDs array will no longer be used by the consumer and can therefor be released.
private  void resetInitCookie(java.lang.String userID)
           
 oasis.names.tc.wsrp.v1.types.PortletContext setPortletProperties(oasis.names.tc.wsrp.v1.types.PropertyList properties, java.lang.String userID)
          Set the portlet properties specified in the property list
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

portlet

private WSRPPortlet portlet

markupPort

private oasis.names.tc.wsrp.v1.intf.WSRP_v1_Markup_PortType markupPort

portletPort

private oasis.names.tc.wsrp.v1.intf.WSRP_v1_PortletManagement_PortType portletPort

consumerEnv

private ConsumerEnvironment consumerEnv

producer

private Producer producer

parameterChecker

private ParameterChecker parameterChecker

initCookie

private oasis.names.tc.wsrp.v1.types.CookieProtocol initCookie

desc

protected oasis.names.tc.wsrp.v1.types.PortletDescription desc

logger

private static final Logger logger
Constructor Detail

PortletDriverImpl

public PortletDriverImpl(WSRPPortlet portlet,
                         ConsumerEnvironment consumerEnv)
                  throws WSRPException
Method Detail

getPortlet

public WSRPPortlet getPortlet()
Get the portlet this driver is bind to.

Specified by:
getPortlet in interface PortletDriver
Returns:
The enity

resetInitCookie

private void resetInitCookie(java.lang.String userID)
                      throws WSRPException
Throws:
WSRPException

checkInitCookie

private void checkInitCookie(java.lang.String userID)
                      throws WSRPException
Throws:
WSRPException

getMarkupParams

private oasis.names.tc.wsrp.v1.types.MarkupParams getMarkupParams(WSRPBaseRequest request)

getValidValues

protected java.lang.String[] getValidValues(java.lang.String[] supported,
                                            java.lang.String[] allowed)
Calculate the valid values for modes and window states.

Parameters:
supported - The values supported by the consumer.
allowed - The values allowed by the producer.
Returns:
The valid values.

contains

protected boolean contains(java.lang.String[] array,
                           java.lang.String object)
Helper method for searching a string in a string array.


getRuntimeContext

protected oasis.names.tc.wsrp.v1.types.RuntimeContext getRuntimeContext(WSRPBaseRequest request)
Create the runtime context for the current request.


getUserContext

private oasis.names.tc.wsrp.v1.types.UserContext getUserContext(java.lang.String userID)

getInteractionParams

private oasis.names.tc.wsrp.v1.types.InteractionParams getInteractionParams(InteractionRequest actionRequest)

getMarkup

public oasis.names.tc.wsrp.v1.types.MarkupResponse getMarkup(MarkupRequest markupRequest,
                                                             java.lang.String userID)
                                                      throws WSRPException
This method is used to retrieve the markup generated by the portlet instance.

Specified by:
getMarkup in interface PortletDriver
Parameters:
markupRequest -
userID -
Returns:
The markup response generated by the portlet
Throws:
WSRPException

performBlockingInteraction

public oasis.names.tc.wsrp.v1.types.BlockingInteractionResponse performBlockingInteraction(InteractionRequest actionRequest,
                                                                                           java.lang.String userID)
                                                                                    throws WSRPException
This method is used to perform a blocking interaction on the portlet instance.

Specified by:
performBlockingInteraction in interface PortletDriver
Parameters:
actionRequest -
Throws:
WSRPException

clonePortlet

public oasis.names.tc.wsrp.v1.types.PortletContext clonePortlet(java.lang.String userID)
                                                         throws WSRPException
Clone the portlet

Specified by:
clonePortlet in interface PortletDriver
Returns:
The new portlet context
Throws:
WSRPException

destroyPortlets

public oasis.names.tc.wsrp.v1.types.DestroyPortletsResponse destroyPortlets(java.lang.String[] portletHandles,
                                                                            java.lang.String userID)
                                                                     throws WSRPException
Destroy the producer portlets specified in the entiyHandles array.

Specified by:
destroyPortlets in interface PortletDriver
Throws:
WSRPException

releaseSessions

public oasis.names.tc.wsrp.v1.types.ReturnAny releaseSessions(java.lang.String[] sessionIDs,
                                                              java.lang.String userID)
                                                       throws WSRPException
Inform the producer that the sessions specified in the sessionIDs array will no longer be used by the consumer and can therefor be released.

Specified by:
releaseSessions in interface PortletDriver
Throws:
WSRPException

initCookie

public void initCookie()
                throws WSRPException
Actual WSRP initCookie() call

Specified by:
initCookie in interface PortletDriver
Throws:
WSRPException

getPortletDescription

public oasis.names.tc.wsrp.v1.types.PortletDescriptionResponse getPortletDescription(java.lang.String userID,
                                                                                     java.lang.String[] desiredLocales)
                                                                              throws WSRPException
Fetches information about the portlet from the producer.

Specified by:
getPortletDescription in interface PortletDriver
Parameters:
userID - is used to get the user context of the user from the user registry
desiredLocales - Array of locales the description should be provided
Returns:
The response to the getPortletDescription call.
Throws:
WSRPException

getPortletPropertyDescription

public oasis.names.tc.wsrp.v1.types.PortletPropertyDescriptionResponse getPortletPropertyDescription(java.lang.String userID)
                                                                                              throws WSRPException
Fetches all published properties of an remote portlet.

Specified by:
getPortletPropertyDescription in interface PortletDriver
Parameters:
userID - The ID of the user this request is done for
Returns:
The portlet property description response from the producer
Throws:
WSRPException

getPortletProperties

public oasis.names.tc.wsrp.v1.types.PropertyList getPortletProperties(java.lang.String[] names,
                                                                      java.lang.String userID)
                                                               throws WSRPException
Get the current values of the properties with the given names.

Specified by:
getPortletProperties in interface PortletDriver
Parameters:
names - The names of the properties
userID - The ID of the user is used to get the user context
Returns:
A list of properties containing the values and names of the properties.
Throws:
WSRPException

setPortletProperties

public oasis.names.tc.wsrp.v1.types.PortletContext setPortletProperties(oasis.names.tc.wsrp.v1.types.PropertyList properties,
                                                                        java.lang.String userID)
                                                                 throws WSRPException
Set the portlet properties specified in the property list

Specified by:
setPortletProperties in interface PortletDriver
Parameters:
properties - List of properties to be set.
userID - The ID of the user is used to get the user context
Throws:
WSRPException


--