Class LoggingStreamInterceptor
java.lang.Object
org.apache.synapse.transport.passthru.DefaultStreamInterceptor
org.apache.synapse.transport.passthru.LoggingStreamInterceptor
- All Implemented Interfaces:
StreamInterceptor
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 -
Method Summary
Modifier and TypeMethodDescriptionbooleaninterceptSourceRequest(org.apache.axis2.context.MessageContext axisCtx) Logic to determine whether to intercept the source requestbooleaninterceptSourceResponse(org.apache.axis2.context.MessageContext axisCtx) Logic to determine whether to intercept the source responsebooleaninterceptTargetRequest(org.apache.axis2.context.MessageContext axisCtx) Logic to determine whether to intercept the target requestbooleaninterceptTargetResponse(org.apache.axis2.context.MessageContext axisCtx) Logic to determine whether to intercept the target responsevoidsetCharset(String charset) voidsetEnableInterception(boolean enableInterception) booleansourceRequest(ByteBuffer buffer, org.apache.axis2.context.MessageContext ctx) Handles the request data coming in to the engine from the clientvoidsourceResponse(ByteBuffer buffer, org.apache.axis2.context.MessageContext ctx) Handles the response data leaving out of the enginevoidtargetRequest(ByteBuffer buffer, org.apache.axis2.context.MessageContext ctx) Handles the request data leaving out of the enginebooleantargetResponse(ByteBuffer buffer, org.apache.axis2.context.MessageContext ctx) Handles the response data coming in to the engine from the back endMethods inherited from class org.apache.synapse.transport.passthru.DefaultStreamInterceptor
addProperty, getProperties
-
Constructor Details
-
LoggingStreamInterceptor
public LoggingStreamInterceptor()
-
-
Method Details
-
interceptSourceRequest
public boolean interceptSourceRequest(org.apache.axis2.context.MessageContext axisCtx) Description copied from interface:StreamInterceptorLogic to determine whether to intercept the source request- Specified by:
interceptSourceRequestin interfaceStreamInterceptor- Overrides:
interceptSourceRequestin classDefaultStreamInterceptor- Parameters:
axisCtx- associated axis2MsgCtx of the request- Returns:
- intercept source request or not
-
sourceRequest
Description copied from interface:StreamInterceptorHandles the request data coming in to the engine from the client- Specified by:
sourceRequestin interfaceStreamInterceptor- Overrides:
sourceRequestin 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:StreamInterceptorLogic to determine whether to intercept the target request- Specified by:
interceptTargetRequestin interfaceStreamInterceptor- Overrides:
interceptTargetRequestin classDefaultStreamInterceptor- Parameters:
axisCtx- associated axis2MsgCtx of the request- Returns:
- intercept target request or not
-
targetRequest
Description copied from interface:StreamInterceptorHandles the request data leaving out of the engine- Specified by:
targetRequestin interfaceStreamInterceptor- Overrides:
targetRequestin 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:StreamInterceptorLogic to determine whether to intercept the target response- Specified by:
interceptTargetResponsein interfaceStreamInterceptor- Overrides:
interceptTargetResponsein classDefaultStreamInterceptor- Parameters:
axisCtx- associated axis2MsgCtx of the response- Returns:
- intercept target response or not
-
targetResponse
Description copied from interface:StreamInterceptorHandles the response data coming in to the engine from the back end- Specified by:
targetResponsein interfaceStreamInterceptor- Overrides:
targetResponsein 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:StreamInterceptorLogic to determine whether to intercept the source response- Specified by:
interceptSourceResponsein interfaceStreamInterceptor- Overrides:
interceptSourceResponsein classDefaultStreamInterceptor- Parameters:
axisCtx- associated axis2MsgCtx of the response- Returns:
- intercept source response or not
-
sourceResponse
Description copied from interface:StreamInterceptorHandles the response data leaving out of the engine- Specified by:
sourceResponsein interfaceStreamInterceptor- Overrides:
sourceResponsein classDefaultStreamInterceptor- Parameters:
buffer- copy of data leavingctx- associated axis2MsgCtx
-
setCharset
-
setEnableInterception
public void setEnableInterception(boolean enableInterception)
-