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

Constructor Summary
RESTProcessor(org.ow2.petals.component.framework.AbstractComponent component, javax.jbi.messaging.DeliveryChannel channel, org.ow2.petals.probes.KeyedCounterProbeWithExecutionStatus<IncomingServiceKey> probeWebServiceInvocations, org.ow2.petals.probes.KeyedResponseTimeProbe<IncomingServiceKey> probeHttpRequestsInvocationsResponseTime, Logger log)
           
 
Method Summary
protected  org.apache.axiom.soap.SOAPEnvelope createEnvelopeFromGet(org.apache.axis2.context.MessageContext inContext, QName operation, String nsUri, 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, String nsUri, String nsPrefix, org.apache.axiom.soap.SOAPFactory factory)
          Create the SOAP Envelope from the incoming one.
protected  QName getJBIOperationFromURL(org.apache.axis2.context.MessageContext inContext)
          Get an operation from the REST URI.
protected  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, getChannel, getLogger, 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,
                     org.ow2.petals.probes.KeyedCounterProbeWithExecutionStatus<IncomingServiceKey> probeWebServiceInvocations,
                     org.ow2.petals.probes.KeyedResponseTimeProbe<IncomingServiceKey> probeHttpRequestsInvocationsResponseTime,
                     Logger log)
Parameters:
component -
channel -
probeWebServiceInvocations - The probe counting service invocations
log -
Method Detail

createEnvelopeFromGet

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

Parameters:
factory -
inContext -
operation -
Returns:

createEnvelopeFromPost

protected org.apache.axiom.soap.SOAPEnvelope createEnvelopeFromPost(org.apache.axis2.context.MessageContext inContext,
                                                                    String nsUri,
                                                                    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:

getJBIOperationFromURL

protected 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:

getProcessorName

protected 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:
the processor name

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,
                                                          UnsupportedEncodingException
Description copied from class: RequestProcessor
Process the request.

Specified by:
process in class RequestProcessor
Parameters:
inContext - the SOAP context
factory - the SOAP factory
Returns:
the out message context
Throws:
org.apache.axis2.AxisFault - the axis fault
UnsupportedEncodingException - the unsupported encoding exception

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,
                                                                     UnsupportedEncodingException
Description copied from class: RequestProcessor
Process the JBI response.
According to the response status :

Overrides:
processJBIResponse in class RequestProcessor
Parameters:
exchange - JBI response
inMessage - the SOAP message
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
UnsupportedEncodingException - the unsupported encoding exception


Copyright © 2005-2012 Petals Link (EBM Websourcing). All Rights Reserved.