org.ow2.petals.binding.soap.listener.incoming
Class RESTProcessor

java.lang.Object
  extended by org.ow2.petals.binding.soap.listener.incoming.RequestProcessor
      extended by org.ow2.petals.binding.soap.listener.incoming.RESTProcessor

public class RESTProcessor
extends RequestProcessor

REST service processor.

Since:
3.1
Author:
Christophe HAMERLING - eBM WebSourcing

Field Summary
 
Fields inherited from class org.ow2.petals.binding.soap.listener.incoming.RequestProcessor
channel, component, exchangeFactory, logger
 
Constructor Summary
RESTProcessor(org.ow2.petals.component.framework.AbstractComponent component, javax.jbi.messaging.DeliveryChannel channel, java.util.logging.Logger log)
           
 
Method Summary
protected  org.apache.axiom.soap.SOAPEnvelope createEnvelopeFromGet(org.apache.axis2.context.MessageContext inContext, javax.xml.namespace.QName operation, java.lang.String nsUri, java.lang.String nsPrefix, org.apache.axiom.soap.SOAPFactory factory)
          Create a SOAPEnvelope from the REST URI.
protected  org.apache.axiom.soap.SOAPEnvelope createEnvelopeFromPost(org.apache.axis2.context.MessageContext inContext, java.lang.String nsUri, java.lang.String nsPrefix, org.apache.axiom.soap.SOAPFactory factory)
          Create the SOAP Envelope from the incoming one.
protected  javax.xml.namespace.QName getJBIOperationFromURL(org.apache.axis2.context.MessageContext inContext)
          Get an operation from the REST URI.
protected  java.lang.String getProcessorName()
          Get the processor name.
protected  org.apache.axis2.context.MessageContext process(org.apache.axis2.context.MessageContext inContext, org.apache.axiom.soap.SOAPFactory factory)
          Process the request
protected  org.apache.axis2.context.MessageContext processJBIResponse(javax.jbi.messaging.MessageExchange exchange, org.apache.axis2.context.MessageContext inMessage, org.apache.axiom.soap.SOAPFactory factory)
          Process the JBI response.
 
Methods inherited from class org.ow2.petals.binding.soap.listener.incoming.RequestProcessor
closeMessageExchange, createMessageExchange, createMessageExchange, createSecuritySubject, handleFault, handleResponseAttachments, isSecuredService, retrieveOperationFromSOAPBody
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RESTProcessor

public RESTProcessor(org.ow2.petals.component.framework.AbstractComponent component,
                     javax.jbi.messaging.DeliveryChannel channel,
                     java.util.logging.Logger log)
Parameters:
component -
channel -
log -
Method Detail

process

protected org.apache.axis2.context.MessageContext process(org.apache.axis2.context.MessageContext inContext,
                                                          org.apache.axiom.soap.SOAPFactory factory)
                                                   throws org.apache.axis2.AxisFault
Description copied from class: RequestProcessor
Process the request

Specified by:
process in class RequestProcessor
Returns:
the out message context
Throws:
org.apache.axis2.AxisFault

processJBIResponse

protected org.apache.axis2.context.MessageContext processJBIResponse(javax.jbi.messaging.MessageExchange exchange,
                                                                     org.apache.axis2.context.MessageContext inMessage,
                                                                     org.apache.axiom.soap.SOAPFactory factory)
                                                              throws org.apache.axis2.AxisFault
Description copied from class: RequestProcessor
Process the JBI response.
According to the response status :

Overrides:
processJBIResponse in class RequestProcessor
Parameters:
exchange - JBI response
factory - soap factory used to create body response
Returns:
a FAULT or OUT JBI response or null if no response
Throws:
org.apache.axis2.AxisFault - with ERROR JBI status, or problem while creating response

getJBIOperationFromURL

protected javax.xml.namespace.QName getJBIOperationFromURL(org.apache.axis2.context.MessageContext inContext)
Get an operation from the REST URI. The operation is the part just after the Service Name.

Parameters:
inContext -
Returns:

createEnvelopeFromPost

protected org.apache.axiom.soap.SOAPEnvelope createEnvelopeFromPost(org.apache.axis2.context.MessageContext inContext,
                                                                    java.lang.String nsUri,
                                                                    java.lang.String nsPrefix,
                                                                    org.apache.axiom.soap.SOAPFactory factory)
Create the SOAP Envelope from the incoming one. Just add namespace if defined in the Service Unit.

Parameters:
inContext -
operation -
nsUri -
nsPrefix -
factory -
Returns:

createEnvelopeFromGet

protected org.apache.axiom.soap.SOAPEnvelope createEnvelopeFromGet(org.apache.axis2.context.MessageContext inContext,
                                                                   javax.xml.namespace.QName operation,
                                                                   java.lang.String nsUri,
                                                                   java.lang.String nsPrefix,
                                                                   org.apache.axiom.soap.SOAPFactory factory)
Create a SOAPEnvelope from the REST URI.

Parameters:
factory -
inContext -
operation -
Returns:

getProcessorName

protected java.lang.String getProcessorName()
Description copied from class: RequestProcessor
Get the processor name. This name MUST be unique ie two processors can not have the same name !

Specified by:
getProcessorName in class RequestProcessor
Returns:


Copyright © 2005-2010 OW2 Consortium. All Rights Reserved.