org.apache.wsrp4j.consumer.driver
Class ProducerImpl

java.lang.Object
  extended byorg.apache.wsrp4j.util.StateChangedServiceImpl
      extended byorg.apache.wsrp4j.consumer.driver.ProducerImpl
All Implemented Interfaces:
Producer, StateChangedService

public class ProducerImpl
extends StateChangedServiceImpl
implements Producer

A consumer representation of a WSRP-producer providing WSRP-portlets. Generally a producer can expose up to four WSRP-Interfaces. These interfaces are Markup-, Service Description-,Registration- and WSRPPortlet Management Interface. Whereas the Registration- and Portlet Management Interface are optional.

Author:
Stephan Laertz, Richard Jacob
See Also:
Producer

Constructor Summary
ProducerImpl()
          Default Constructor should not be used directly.
ProducerImpl(java.lang.String producerID, java.lang.String markupURL, java.lang.String serviceDescriptionURL)
          This constructor can be used to create a new producer object
ProducerImpl(java.lang.String producerID, java.lang.String markupURL, java.lang.String serviceDescriptionURL, java.lang.String registrationURL, java.lang.String portletManagementURL, RegistrationData registrationData)
          This constructor can be used to create a new producer object
 
Method Summary
 void addPortletDescription(PortletDescription portletDescription)
          Add an portlet description to the producer.
 ReturnAny deregister()
          End an existing consumer producer relationship and remove the registration context
 java.lang.String getDescription()
          Get a description of the producer.
 java.lang.String getID()
          Get the ID of the producer.
 java.lang.String getMarkupInterfaceEndpoint()
          Get the URL of the producers markup interface.
 java.lang.String getName()
          Get the name of the producer.
 PortletDescription getPortletDescription(java.lang.String portletHandle)
          Get the portlet description of the portlet with the given handle from the service description or null if the producer doesn't offer an portlet with this handle in it's service description.
 WSRP_v1_PortletManagement_PortType getPortletManagementInterface()
          Get the producers portlet management interface.
 java.lang.String getPortletManagementInterfaceEndpoint()
          Get the URL of the producers portlet management interface.
 RegistrationContext getRegistrationContext()
          Get the current registration context of the consumer registered at this producer or null if no registration is required or happend so far.
 RegistrationData getRegistrationData()
          Get the registration data the consumer uses to register at this producer.
 WSRP_v1_Registration_PortType getRegistrationInterface()
          Get the producers registration interface.
 java.lang.String getRegistrationInterfaceEndpoint()
          Get the URL of the producers registration interface.
 ServiceDescription getServiceDescription()
          Same as getServiceDescription(false)
 ServiceDescription getServiceDescription(boolean newRequest)
          Get the service description of the producer
 WSRP_v1_ServiceDescription_PortType getServiceDescriptionInterface()
          Get the producers service description interface.
 java.lang.String getServiceDescriptionInterfaceEndpoint()
          Get the URL of the producers service description interface.
 void initPortletManagementInterface(java.lang.String portletManagementURL)
           
 void initRegistrationInterface(java.lang.String registrationURL)
          Initialize the registration interface of the producer.
 void initServiceDescInterface(java.lang.String serviceDescriptionURL)
          Initialize the service description interface of the producer.
 boolean isPortletManagementInferfaceSupported()
          Check wether the optional portlet management interface is supported
 boolean isRegistrationInterfaceSupported()
          Check wether the optional registration interface is supported
 boolean isRegistrationRequired()
          Indicates wether or not the producer requires consumer registration.
 RegistrationState modifyRegistration(RegistrationData registrationData)
          Can be used to modify the relationship between consumer and producer.
 RegistrationContext register(RegistrationData registrationData)
          Method establishes a relationship between consumer and producer.
 void setDescription(java.lang.String description)
          Set a description of the producer.
 void setID(java.lang.String id)
          Set the ID of the producer to he given value.
 void setIsRegistrationRequired(boolean registrationRequired)
          Define if the producer requires in-band registration or not.
 void setMarkupInterfaceEndpoint(java.lang.String url)
          Set the URL of the producers markup interface.
 void setName(java.lang.String name)
          Set the name of the producer.
 void setPortletManagementInterfaceEndpoint(java.lang.String url)
          Set the URL of the producers portlet management interface.
 void setRegistrationContext(RegistrationContext registrationContext)
          Set the registration context.
 void setRegistrationData(RegistrationData regData)
          Set the registration the consumer uses the register at this producer.
 void setRegistrationInterfaceEndpoint(java.lang.String url)
          Set the URL of the producers registration interface.
 void setServiceDescription(ServiceDescription serviceDescription)
          Set the consumer environment this producer is used.
 void setServiceDescriptionInterfaceEndpoint(java.lang.String url)
          Set the URL of the producers service description interface.
 
Methods inherited from class org.apache.wsrp4j.util.StateChangedServiceImpl
addListener, stateChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProducerImpl

public ProducerImpl()
Default Constructor should not be used directly. But is required for persistence support by castor.


ProducerImpl

public ProducerImpl(java.lang.String producerID,
                    java.lang.String markupURL,
                    java.lang.String serviceDescriptionURL)
             throws WSRPException
This constructor can be used to create a new producer object


ProducerImpl

public ProducerImpl(java.lang.String producerID,
                    java.lang.String markupURL,
                    java.lang.String serviceDescriptionURL,
                    java.lang.String registrationURL,
                    java.lang.String portletManagementURL,
                    RegistrationData registrationData)
             throws WSRPException
This constructor can be used to create a new producer object

Method Detail

initServiceDescInterface

public void initServiceDescInterface(java.lang.String serviceDescriptionURL)
                              throws WSRPException
Initialize the service description interface of the producer.

Parameters:
serviceDescriptionURL - The URL of the producers service description interface
Throws:
WSRPException

initRegistrationInterface

public void initRegistrationInterface(java.lang.String registrationURL)
                               throws WSRPException
Initialize the registration interface of the producer.

Parameters:
registrationURL - The URL of the producers registration interface
Throws:
WSRPException

getServiceDescriptionInterfaceEndpoint

public java.lang.String getServiceDescriptionInterfaceEndpoint()
Get the URL of the producers service description interface.

Specified by:
getServiceDescriptionInterfaceEndpoint in interface Producer
Returns:
URL of the service description interface.

setServiceDescriptionInterfaceEndpoint

public void setServiceDescriptionInterfaceEndpoint(java.lang.String url)
Set the URL of the producers service description interface.

Specified by:
setServiceDescriptionInterfaceEndpoint in interface Producer
Parameters:
url - URL of the service description interface.

getRegistrationInterfaceEndpoint

public java.lang.String getRegistrationInterfaceEndpoint()
Get the URL of the producers registration interface.

Specified by:
getRegistrationInterfaceEndpoint in interface Producer
Returns:
URL of the registration interface.

setRegistrationInterfaceEndpoint

public void setRegistrationInterfaceEndpoint(java.lang.String url)
Set the URL of the producers registration interface.

Specified by:
setRegistrationInterfaceEndpoint in interface Producer
Parameters:
url - URL of the registration interface.

getID

public java.lang.String getID()
Get the ID of the producer.

Specified by:
getID in interface Producer
Returns:
The ID of the producer

setID

public void setID(java.lang.String id)
Set the ID of the producer to he given value.

Specified by:
setID in interface Producer
Parameters:
id - ID of the producer.

getName

public java.lang.String getName()
Get the name of the producer.

Specified by:
getName in interface Producer
Returns:
The name of the producer

setName

public void setName(java.lang.String name)
Set the name of the producer.

Specified by:
setName in interface Producer
Parameters:
name - The name of the producer

getDescription

public java.lang.String getDescription()
Get a description of the producer.

Specified by:
getDescription in interface Producer
Returns:
A description of the producer

setDescription

public void setDescription(java.lang.String description)
Set a description of the producer.

Specified by:
setDescription in interface Producer
Parameters:
description - Some descriptive information about the producer

isRegistrationRequired

public boolean isRegistrationRequired()
Indicates wether or not the producer requires consumer registration.

Specified by:
isRegistrationRequired in interface Producer
Returns:
True if consumer registration is required.

setIsRegistrationRequired

public void setIsRegistrationRequired(boolean registrationRequired)
Define if the producer requires in-band registration or not.

Specified by:
setIsRegistrationRequired in interface Producer
Parameters:
registrationRequired - True if the producer requires in-band registration

getRegistrationData

public RegistrationData getRegistrationData()
Get the registration data the consumer uses to register at this producer.

Specified by:
getRegistrationData in interface Producer
Returns:
The consumer registration data

setRegistrationData

public void setRegistrationData(RegistrationData regData)
Set the registration the consumer uses the register at this producer.

Specified by:
setRegistrationData in interface Producer
Parameters:
regData - The registration data which is used to register at this producer

getRegistrationContext

public RegistrationContext getRegistrationContext()
Get the current registration context of the consumer registered at this producer or null if no registration is required or happend so far.

Specified by:
getRegistrationContext in interface Producer
Returns:
The current registration context of the consumer at this producer or null.

setRegistrationContext

public void setRegistrationContext(RegistrationContext registrationContext)
Set the registration context.

Specified by:
setRegistrationContext in interface Producer
Parameters:
registrationContext - The registration context of a consumer registered at the producer.

getServiceDescription

public ServiceDescription getServiceDescription()
                                         throws WSRPException
Same as getServiceDescription(false)

Specified by:
getServiceDescription in interface Producer
Throws:
WSRPException

getServiceDescription

public ServiceDescription getServiceDescription(boolean newRequest)
                                         throws WSRPException
Get the service description of the producer

Specified by:
getServiceDescription in interface Producer
Parameters:
newRequest - If set to true a new request is send to the producer otherwise a cached service description is used if available
Returns:
Service description of the producer
Throws:
WSRPException

getPortletDescription

public PortletDescription getPortletDescription(java.lang.String portletHandle)
                                         throws WSRPException
Get the portlet description of the portlet with the given handle from the service description or null if the producer doesn't offer an portlet with this handle in it's service description.

Specified by:
getPortletDescription in interface Producer
Parameters:
portletHandle - The portlet handle of the portlet
Returns:
The portlet description of the portlet with the given handle
Throws:
WSRPException

setServiceDescription

public void setServiceDescription(ServiceDescription serviceDescription)
Set the consumer environment this producer is used.


addPortletDescription

public void addPortletDescription(PortletDescription portletDescription)
Add an portlet description to the producer. This portlet description is accessable through the portlet handle in the portlet description. If the producer has already an portlet description with this portlet handle than the old description will be overwritten.

Specified by:
addPortletDescription in interface Producer
Parameters:
portletDescription - New portlet description

register

public RegistrationContext register(RegistrationData registrationData)
                             throws WSRPException
Method establishes a relationship between consumer and producer. Note: A additional call of setRegistrationContext() is not neccesary

Specified by:
register in interface Producer
Parameters:
registrationData - Data which is used to register the consumer
Returns:
The registration context received by the producer
Throws:
WSRPException

modifyRegistration

public RegistrationState modifyRegistration(RegistrationData registrationData)
                                     throws WSRPException
Can be used to modify the relationship between consumer and producer. Note: A additional call of setRegistrationContext() is not neccesary

Specified by:
modifyRegistration in interface Producer
Parameters:
registrationData - The new registration data
Returns:
New registration context
Throws:
WSRPException

deregister

public ReturnAny deregister()
                     throws WSRPException
End an existing consumer producer relationship and remove the registration context

Specified by:
deregister in interface Producer
Returns:
Can be anything
Throws:
WSRPException

getMarkupInterfaceEndpoint

public java.lang.String getMarkupInterfaceEndpoint()
Description copied from interface: Producer
Get the URL of the producers markup interface.

Specified by:
getMarkupInterfaceEndpoint in interface Producer
Returns:
URL of the markup interface.
See Also:
Producer.getMarkupInterfaceEndpoint()

setMarkupInterfaceEndpoint

public void setMarkupInterfaceEndpoint(java.lang.String url)
Description copied from interface: Producer
Set the URL of the producers markup interface.

Specified by:
setMarkupInterfaceEndpoint in interface Producer
Parameters:
url - of the markup interface.
See Also:
Producer.setMarkupInterfaceEndpoint(java.lang.String)

getPortletManagementInterfaceEndpoint

public java.lang.String getPortletManagementInterfaceEndpoint()
Description copied from interface: Producer
Get the URL of the producers portlet management interface.

Specified by:
getPortletManagementInterfaceEndpoint in interface Producer
Returns:
URL of the portlet management interface.
See Also:
Producer.getPortletManagementInterfaceEndpoint()

setPortletManagementInterfaceEndpoint

public void setPortletManagementInterfaceEndpoint(java.lang.String url)
Description copied from interface: Producer
Set the URL of the producers portlet management interface.

Specified by:
setPortletManagementInterfaceEndpoint in interface Producer
Parameters:
url - of the portlet management interface.
See Also:
Producer.setPortletManagementInterfaceEndpoint(java.lang.String)

initPortletManagementInterface

public void initPortletManagementInterface(java.lang.String portletManagementURL)
                                    throws WSRPException
Throws:
WSRPException

getPortletManagementInterface

public WSRP_v1_PortletManagement_PortType getPortletManagementInterface()
Description copied from interface: Producer
Get the producers portlet management interface.

Specified by:
getPortletManagementInterface in interface Producer
Returns:
portlet management interface.

getRegistrationInterface

public WSRP_v1_Registration_PortType getRegistrationInterface()
Description copied from interface: Producer
Get the producers registration interface.

Specified by:
getRegistrationInterface in interface Producer
Returns:
registration interface.

getServiceDescriptionInterface

public WSRP_v1_ServiceDescription_PortType getServiceDescriptionInterface()
Description copied from interface: Producer
Get the producers service description interface.

Specified by:
getServiceDescriptionInterface in interface Producer
Returns:
service description interface.

isPortletManagementInferfaceSupported

public boolean isPortletManagementInferfaceSupported()
Description copied from interface: Producer
Check wether the optional portlet management interface is supported

Specified by:
isPortletManagementInferfaceSupported in interface Producer
Returns:
true if a portlet management interface endpoint URL is set

isRegistrationInterfaceSupported

public boolean isRegistrationInterfaceSupported()
Description copied from interface: Producer
Check wether the optional registration interface is supported

Specified by:
isRegistrationInterfaceSupported in interface Producer
Returns:
true if a registration interface endpoint URL is set