Class LoggingStreamInterceptor
- java.lang.Object
-
- org.apache.synapse.transport.passthru.DefaultStreamInterceptor
-
- org.apache.synapse.transport.passthru.LoggingStreamInterceptor
-
- All Implemented Interfaces:
StreamInterceptor
public class LoggingStreamInterceptor extends DefaultStreamInterceptor
Sample stream interceptor, which intercepts source and target request to print the stream passing via the engine.<interceptors xmlns:svns="http://org.wso2.securevault/configuration"> <interceptor class="org.apache.synapse.transport.passthru.LoggingStreamInterceptor"> <parameter name="charset" value="ISO-8859-1"/> <parameter name="enableInterception" value="true"/> </interceptor> </interceptors>
-
-
Constructor Summary
Constructors Constructor Description LoggingStreamInterceptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
interceptSourceRequest(org.apache.axis2.context.MessageContext axisCtx)
Logic to determine whether to intercept the source requestboolean
interceptSourceResponse(org.apache.axis2.context.MessageContext axisCtx)
Logic to determine whether to intercept the source responseboolean
interceptTargetRequest(org.apache.axis2.context.MessageContext axisCtx)
Logic to determine whether to intercept the target requestboolean
interceptTargetResponse(org.apache.axis2.context.MessageContext axisCtx)
Logic to determine whether to intercept the target responsevoid
setCharset(String charset)
void
setEnableInterception(boolean enableInterception)
boolean
sourceRequest(ByteBuffer buffer, org.apache.axis2.context.MessageContext ctx)
Handles the request data coming in to the engine from the clientvoid
sourceResponse(ByteBuffer buffer, org.apache.axis2.context.MessageContext ctx)
Handles the response data leaving out of the enginevoid
targetRequest(ByteBuffer buffer, org.apache.axis2.context.MessageContext ctx)
Handles the request data leaving out of the engineboolean
targetResponse(ByteBuffer buffer, org.apache.axis2.context.MessageContext ctx)
Handles the response data coming in to the engine from the back end-
Methods inherited from class org.apache.synapse.transport.passthru.DefaultStreamInterceptor
addProperty, getProperties
-
-
-
-
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 interfaceStreamInterceptor
- Overrides:
interceptSourceRequest
in classDefaultStreamInterceptor
- Parameters:
axisCtx
- associated axis2MsgCtx of the request- Returns:
- intercept source request or not
-
sourceRequest
public boolean sourceRequest(ByteBuffer buffer, org.apache.axis2.context.MessageContext ctx)
Description copied from interface:StreamInterceptor
Handles the request data coming in to the engine from the client- Specified by:
sourceRequest
in interfaceStreamInterceptor
- Overrides:
sourceRequest
in classDefaultStreamInterceptor
- Parameters:
buffer
- copy of data entering inctx
- 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 interfaceStreamInterceptor
- Overrides:
interceptTargetRequest
in classDefaultStreamInterceptor
- Parameters:
axisCtx
- associated axis2MsgCtx of the request- Returns:
- intercept target request or not
-
targetRequest
public void targetRequest(ByteBuffer buffer, org.apache.axis2.context.MessageContext ctx)
Description copied from interface:StreamInterceptor
Handles the request data leaving out of the engine- Specified by:
targetRequest
in interfaceStreamInterceptor
- Overrides:
targetRequest
in classDefaultStreamInterceptor
- Parameters:
buffer
- copy of data being send outctx
- 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 interfaceStreamInterceptor
- Overrides:
interceptTargetResponse
in classDefaultStreamInterceptor
- Parameters:
axisCtx
- associated axis2MsgCtx of the response- Returns:
- intercept target response or not
-
targetResponse
public boolean targetResponse(ByteBuffer buffer, org.apache.axis2.context.MessageContext ctx)
Description copied from interface:StreamInterceptor
Handles the response data coming in to the engine from the back end- Specified by:
targetResponse
in interfaceStreamInterceptor
- Overrides:
targetResponse
in classDefaultStreamInterceptor
- Parameters:
buffer
- copy of data entering inctx
- 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 interfaceStreamInterceptor
- Overrides:
interceptSourceResponse
in classDefaultStreamInterceptor
- Parameters:
axisCtx
- associated axis2MsgCtx of the response- Returns:
- intercept source response or not
-
sourceResponse
public void sourceResponse(ByteBuffer buffer, org.apache.axis2.context.MessageContext ctx)
Description copied from interface:StreamInterceptor
Handles the response data leaving out of the engine- Specified by:
sourceResponse
in interfaceStreamInterceptor
- Overrides:
sourceResponse
in classDefaultStreamInterceptor
- Parameters:
buffer
- copy of data leavingctx
- associated axis2MsgCtx
-
setCharset
public void setCharset(String charset)
-
setEnableInterception
public void setEnableInterception(boolean enableInterception)
-
-