com.oracle.producer.spi
Interface IProducerDataStore


public interface IProducerDataStore

Interface for a consumer registration and portlet instance store. The portal framework does not synchronize calls to the SPI. Depending on the datastore used to manage instances and preferences, the SPI must synchronize the implementation.

Implementations MUST have a no-argument constructor. Only a single instance will be created per producer (per webapp).

Implementations are responsible ONLY for consumer-cloned portlet (CCP) instances; producer-offered portlet (POP) instances are handled by the producer.


Method Summary
 IPortletDataContext createPortletInstance(String popHandle, IConfigurationContext configContext, IRequestContext requestContext)
          Creates a child instance of a POP portlet.
 void deletePortletInstance(IPortletDataContext portletDataContext, IConfigurationContext configContext, IRequestContext requestContext)
          Deletes a portlet instance, and all descendent portlet instances if applicable.
 void deregister(IRegistrationDataContext registrationContext, IConfigurationContext configContext, IRequestContext requestContext)
          De-registers the consumer from this producer.
 void destroy()
          Destroys this IProducerDataStore instance.
 IPortletDataContext getPortletInstance(String handle, byte[] state, IPortletDataContext.StateChangeFlag stateChange, IConfigurationContext configContext, IRequestContext requestContext)
          Gets the portlet instance referred to by the specified portlet handle and portlet state.
 IRegistrationDataContext getRegistrationDataContext(String registrationHandle, byte[] registrationState, IConfigurationContext configContext, IRequestContext requestContext)
          Gets the IRegistrationDataContext object for the specified consumer registration, or throws an exception if the consumer registration is invalid.
 Set<IPropertyDescription> getRegistrationPropertyDescriptions(IRequestContext requestContext)
          Gets the set of registration property descriptions for all supported registration properties.
 void init(Map<String,String[]> initParams, IConfigurationContext configContext)
          Initializes this IProducerDataStore instance with the specified initialization parameters.
 IRegistrationDataContext register(IRegistrationData registrationData, IConfigurationContext configContext, IRequestContext requestContext)
          Registers a consumer with the producer.
 

Method Detail

init

void init(Map<String,String[]> initParams,
          IConfigurationContext configContext)
          throws Exception
Initializes this IProducerDataStore instance with the specified initialization parameters. This method MUST be called only once, before any other methods on the class. If an exception is thrown, the ProducerDataStore implementation MUST NOT be used. The initialization parameters come from the producer and are configured along with the ProducerDataStore configuration.

Throws
Exception

destroy

void destroy()
Destroys this IProducerDataStore instance. After this method is called, the producer MUST NOT call any other methods on the class. While the producer will make every effort to call this method when shutting down, it is NOT guaranteed to be called.


register

IRegistrationDataContext register(IRegistrationData registrationData,
                                  IConfigurationContext configContext,
                                  IRequestContext requestContext)
                                  throws WSRPFaultException
Registers a consumer with the producer. Note that the IRequestContext.getRegistrationDataContext() method will return null when this method is called.

Throws
WSRPFaultException - if the operation failed for any reason. The exception can be created using the IConfigurationContext.createWsrpFaultException() method.

getRegistrationDataContext

IRegistrationDataContext getRegistrationDataContext(String registrationHandle,
                                                    byte[] registrationState,
                                                    IConfigurationContext configContext,
                                                    IRequestContext requestContext)
                                                    throws WSRPFaultException
Gets the IRegistrationDataContext object for the specified consumer registration, or throws an exception if the consumer registration is invalid. Note that the IRequestContext.getRegistrationDataContext() method will return null when this method is called.

Throws
WSRPFaultException - if the operation failed for any reason. The exception can be created using the IConfigurationContext.createWsrpFaultException() method.

deregister

void deregister(IRegistrationDataContext registrationContext,
                IConfigurationContext configContext,
                IRequestContext requestContext)
                throws WSRPFaultException
De-registers the consumer from this producer.

Throws
WSRPFaultException - if the operation failed for any reason. The exception can be created using the IConfigurationContext.createWsrpFaultException() method.

getRegistrationPropertyDescriptions

Set<IPropertyDescription> getRegistrationPropertyDescriptions(IRequestContext requestContext)
                                                              throws WSRPFaultException
Gets the set of registration property descriptions for all supported registration properties. The returned set may never be null but may be empty if no registration properties are supported.

Throws
WSRPFaultException - if the operation failed for any reason. The exception can be created using the IConfigurationContext.createWsrpFaultException() method.

createPortletInstance

IPortletDataContext createPortletInstance(String popHandle,
                                          IConfigurationContext configContext,
                                          IRequestContext requestContext)
                                          throws WSRPFaultException
Creates a child instance of a POP portlet. The implementation is responsible for creating preference information for the portlet instance. The returned PortletDataContext's handle MUST NOT be the POP handle or any other POP handle, though it does not need to be globally unique.

Parameters
popHandle - the portlet POP handle to make a new portlet instance from.
configContext -
requestContext -
Returns
a newly cloned portlet instance.
Throws
WSRPFaultException - if the operation failed for any reason. The exception can be created using the IConfigurationContext.createWsrpFaultException() method.

getPortletInstance

IPortletDataContext getPortletInstance(String handle,
                                       byte[] state,
                                       IPortletDataContext.StateChangeFlag stateChange,
                                       IConfigurationContext configContext,
                                       IRequestContext requestContext)
                                       throws WSRPFaultException
Gets the portlet instance referred to by the specified portlet handle and portlet state. If the instance is not valid for this request, an exception should be thrown. Things that may be checked by the implementation include whether the instance actually exists, whether the instance is associated with the consumer, whether the instance has a valid POP handle, etc.

Parameters
handle - the portlet instance handle.
state - the portlet instance binary state buffer, if any.
stateChange - the state change flag the consumer sent to indicate whether the portlet is clonable and whether or not an implicit clone should occur when setting preferences.
Throws
WSRPFaultException - if the operation failed for any reason. The exception can be created using the IConfigurationContext.createWsrpFaultException() method.

deletePortletInstance

void deletePortletInstance(IPortletDataContext portletDataContext,
                           IConfigurationContext configContext,
                           IRequestContext requestContext)
                           throws WSRPFaultException
Deletes a portlet instance, and all descendent portlet instances if applicable. The implementation is responsible for deleting any associated portlet preferences.

Parameters
portletDataContext -
configContext -
requestContext -
Throws
WSRPFaultException - if the operation failed for any reason. The exception can be created using the IConfigurationContext.createWsrpFaultException() method.


Copyright © 2011, Oracle. All rights reserved.