org.apache.synapse.format.hessian

## Class HessianMessageFormatter

- java.lang.Object
- - org.apache.synapse.format.hessian.HessianMessageFormatter

- All Implemented Interfaces:
    org.apache.axis2.transport.MessageFormatter

      public class HessianMessageFormatter
      extends Object
      implements org.apache.axis2.transport.MessageFormatter

  Enables a message encoded using the Hessian binary protocol to be written to transport by axis2/synapse and this formats the HessianDataSource to a Hessian message.
  See Also:
    `MessageFormatter`, `SynapseBinaryDataSource`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `HessianMessageFormatter()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `formatSOAPAction(org.apache.axis2.context.MessageContext messageContext, org.apache.axiom.om.OMOutputFormat format, String soapAction)` Simply returns the soapAction unchanged.
    `byte[]` | `getBytes(org.apache.axis2.context.MessageContext msgCtxt, org.apache.axiom.om.OMOutputFormat format)` This method is not supported because of large file handling limitations
    `String` | `getContentType(org.apache.axis2.context.MessageContext msgCtxt, org.apache.axiom.om.OMOutputFormat format, String soapActionString)` Formats the content type to be written in to the transport
    `URL` | `getTargetAddress(org.apache.axis2.context.MessageContext messageContext, org.apache.axiom.om.OMOutputFormat format, URL targetURL)`
    `void` | `writeTo(org.apache.axis2.context.MessageContext msgCtx, org.apache.axiom.om.OMOutputFormat format, OutputStream out, boolean preserve)` Extract Hessian bytes from the received SOAP message and write it onto the wire

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### HessianMessageFormatter

          public HessianMessageFormatter()

  - ### Method Detail

    - #### getContentType

          public String getContentType(org.apache.axis2.context.MessageContext msgCtxt,
                                       org.apache.axiom.om.OMOutputFormat format,
                                       String soapActionString)

      Formats the content type to be written in to the transport
      Specified by:
        `getContentType` in interface `org.apache.axis2.transport.MessageFormatter`
      Parameters:
        `msgCtxt` - message of which the content type has to be formatted
        `format` - fomat of the expected formatted message
        `soapActionString` - soap action of the message
      Returns:
        contentType formatted content type as a String

    - #### writeTo

          public void writeTo(org.apache.axis2.context.MessageContext msgCtx,
                              org.apache.axiom.om.OMOutputFormat format,
                              OutputStream out,
                              boolean preserve)
                       throws org.apache.axis2.AxisFault

      Extract Hessian bytes from the received SOAP message and write it onto the wire
      Specified by:
        `writeTo` in interface `org.apache.axis2.transport.MessageFormatter`
      Parameters:
        `msgCtx` - message from which the Hessian message has to be extracted
        `format` - message format to be written
        `out` - stream to which the message is written
        `preserve` - whether to preserve the indentations
      Throws:
        `org.apache.axis2.AxisFault` - in case of a failure in writing the message to the provided stream

    - #### getBytes

          public byte[] getBytes(org.apache.axis2.context.MessageContext msgCtxt,
                                 org.apache.axiom.om.OMOutputFormat format)
                          throws org.apache.axis2.AxisFault

      This method is not supported because of large file handling limitations
      Specified by:
        `getBytes` in interface `org.apache.axis2.transport.MessageFormatter`
      Parameters:
        `msgCtxt` - message which contains the Hessian message inside the HessianDataSource
        `format` - message format to be written
      Returns:
        Hessian binary bytes of the message
      Throws:
        `org.apache.axis2.AxisFault` - for any invocation

    - #### formatSOAPAction

          public String formatSOAPAction(org.apache.axis2.context.MessageContext messageContext,
                                         org.apache.axiom.om.OMOutputFormat format,
                                         String soapAction)

      Simply returns the soapAction unchanged.
      Specified by:
        `formatSOAPAction` in interface `org.apache.axis2.transport.MessageFormatter`

    - #### getTargetAddress

          public URL getTargetAddress(org.apache.axis2.context.MessageContext messageContext,
                                      org.apache.axiom.om.OMOutputFormat format,
                                      URL targetURL)
                               throws org.apache.axis2.AxisFault

      Specified by:
        `getTargetAddress` in interface `org.apache.axis2.transport.MessageFormatter`
      Returns:
        A templated URL based on the given target URL.
      Throws:
        `org.apache.axis2.AxisFault`

Copyright © 2005–2017 Apache Software Foundation. All rights reserved.