org.apache.synapse.transport.passthru

## Class DefaultStreamInterceptor

- java.lang.Object
- - org.apache.synapse.transport.passthru.DefaultStreamInterceptor

- All Implemented Interfaces:
    StreamInterceptor
  Direct Known Subclasses:
    LoggingStreamInterceptor

      public abstract class DefaultStreamInterceptor
      extends java.lang.Object
      implements StreamInterceptor

  Default class implementing the methods of `StreamInterceptor`. A stream interceptor can be written by extending and overding the necessary methods of this class. For an example see`LoggingStreamInterceptor`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultStreamInterceptor()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addProperty(java.lang.String name, java.lang.Object value)` Add an interceptor property
    `java.util.Map` | `getProperties()` Get all interceptor properties
    `boolean` | `interceptSourceRequest(org.apache.axis2.context.MessageContext axisCtx)` Logic to determine whether to intercept the source request
    `boolean` | `interceptSourceResponse(org.apache.axis2.context.MessageContext axisCtx)` Logic to determine whether to intercept the source response
    `boolean` | `interceptTargetRequest(org.apache.axis2.context.MessageContext axisCtx)` Logic to determine whether to intercept the target request
    `boolean` | `interceptTargetResponse(org.apache.axis2.context.MessageContext axisCtx)` Logic to determine whether to intercept the target response
    `boolean` | `sourceRequest(java.nio.ByteBuffer buffer, org.apache.axis2.context.MessageContext axisCtx)` Handles the request data coming in to the engine from the client
    `void` | `sourceResponse(java.nio.ByteBuffer buffer, org.apache.axis2.context.MessageContext axisCtx)` Handles the response data leaving out of the engine
    `void` | `targetRequest(java.nio.ByteBuffer buffer, org.apache.axis2.context.MessageContext axisCtx)` Handles the request data leaving out of the engine
    `boolean` | `targetResponse(java.nio.ByteBuffer buffer, org.apache.axis2.context.MessageContext axisCtx)` Handles the response data coming in to the engine from the back end

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

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

- - ### Constructor Detail

    - #### DefaultStreamInterceptor

          public DefaultStreamInterceptor()

  - ### Method Detail

    - #### interceptSourceRequest

          public boolean interceptSourceRequest(org.apache.axis2.context.MessageContext axisCtx)

      Description copied from interface: `StreamInterceptor`
      Logic to determine whether to intercept the source request
      Specified by:
        `interceptSourceRequest` in interface `StreamInterceptor`
      Parameters:
        `axisCtx` - associated axis2MsgCtx of the request
      Returns:
        intercept source request or not

    - #### sourceRequest

          public boolean sourceRequest(java.nio.ByteBuffer buffer,
                                       org.apache.axis2.context.MessageContext axisCtx)

      Description copied from interface: `StreamInterceptor`
      Handles the request data coming in to the engine from the client
      Specified by:
        `sourceRequest` in interface `StreamInterceptor`
      Parameters:
        `buffer` - copy of data entering in
        `axisCtx` - associated axis2MsgCtx
      Returns:
        whether to continue reading the data or to close the connection

    - #### interceptTargetRequest

          public boolean interceptTargetRequest(org.apache.axis2.context.MessageContext axisCtx)

      Description copied from interface: `StreamInterceptor`
      Logic to determine whether to intercept the target request
      Specified by:
        `interceptTargetRequest` in interface `StreamInterceptor`
      Parameters:
        `axisCtx` - associated axis2MsgCtx of the request
      Returns:
        intercept target request or not

    - #### targetRequest

          public void targetRequest(java.nio.ByteBuffer buffer,
                                    org.apache.axis2.context.MessageContext axisCtx)

      Description copied from interface: `StreamInterceptor`
      Handles the request data leaving out of the engine
      Specified by:
        `targetRequest` in interface `StreamInterceptor`
      Parameters:
        `buffer` - copy of data being send out
        `axisCtx` - associated axis2MsgCtx

    - #### interceptTargetResponse

          public boolean interceptTargetResponse(org.apache.axis2.context.MessageContext axisCtx)

      Description copied from interface: `StreamInterceptor`
      Logic to determine whether to intercept the target response
      Specified by:
        `interceptTargetResponse` in interface `StreamInterceptor`
      Parameters:
        `axisCtx` - associated axis2MsgCtx of the response
      Returns:
        intercept target response or not

    - #### targetResponse

          public boolean targetResponse(java.nio.ByteBuffer buffer,
                                        org.apache.axis2.context.MessageContext axisCtx)

      Description copied from interface: `StreamInterceptor`
      Handles the response data coming in to the engine from the back end
      Specified by:
        `targetResponse` in interface `StreamInterceptor`
      Parameters:
        `buffer` - copy of data entering in
        `axisCtx` - associated axis2MsgCtx
      Returns:
        whether to continue reading the data or to close the connection

    - #### interceptSourceResponse

          public boolean interceptSourceResponse(org.apache.axis2.context.MessageContext axisCtx)

      Description copied from interface: `StreamInterceptor`
      Logic to determine whether to intercept the source response
      Specified by:
        `interceptSourceResponse` in interface `StreamInterceptor`
      Parameters:
        `axisCtx` - associated axis2MsgCtx of the response
      Returns:
        intercept source response or not

    - #### sourceResponse

          public void sourceResponse(java.nio.ByteBuffer buffer,
                                     org.apache.axis2.context.MessageContext axisCtx)

      Description copied from interface: `StreamInterceptor`
      Handles the response data leaving out of the engine
      Specified by:
        `sourceResponse` in interface `StreamInterceptor`
      Parameters:
        `buffer` - copy of data leaving
        `axisCtx` - associated axis2MsgCtx

    - #### addProperty

          public void addProperty(java.lang.String name,
                                  java.lang.Object value)

      Description copied from interface: `StreamInterceptor`
      Add an interceptor property
      Specified by:
        `addProperty` in interface `StreamInterceptor`
      Parameters:
        `name` - property name
        `value` - property value

    - #### getProperties

          public java.util.Map getProperties()

      Description copied from interface: `StreamInterceptor`
      Get all interceptor properties
      Specified by:
        `getProperties` in interface `StreamInterceptor`
      Returns:
        Map of handler properties

Copyright © 2005-2021 Apache Software Foundation. All Rights Reserved.