Class DefaultStreamInterceptor
java.lang.Object
org.apache.synapse.transport.passthru.DefaultStreamInterceptor
- All Implemented Interfaces:
StreamInterceptor
- Direct Known Subclasses:
LoggingStreamInterceptor
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 seeLoggingStreamInterceptor-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddProperty(String name, Object value) Add an interceptor propertyGet all interceptor propertiesbooleaninterceptSourceRequest(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 responsebooleansourceRequest(ByteBuffer buffer, org.apache.axis2.context.MessageContext axisCtx) Handles the request data coming in to the engine from the clientvoidsourceResponse(ByteBuffer buffer, org.apache.axis2.context.MessageContext axisCtx) Handles the response data leaving out of the enginevoidtargetRequest(ByteBuffer buffer, org.apache.axis2.context.MessageContext axisCtx) Handles the request data leaving out of the enginebooleantargetResponse(ByteBuffer buffer, org.apache.axis2.context.MessageContext axisCtx) Handles the response data coming in to the engine from the back end
-
Constructor Details
-
DefaultStreamInterceptor
public DefaultStreamInterceptor()
-
-
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- 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- Parameters:
buffer- copy of data entering inaxisCtx- 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- 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- Parameters:
buffer- copy of data being send outaxisCtx- 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- 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- Parameters:
buffer- copy of data entering inaxisCtx- 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- 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- Parameters:
buffer- copy of data leavingaxisCtx- associated axis2MsgCtx
-
addProperty
Description copied from interface:StreamInterceptorAdd an interceptor property- Specified by:
addPropertyin interfaceStreamInterceptor- Parameters:
name- property namevalue- property value
-
getProperties
Description copied from interface:StreamInterceptorGet all interceptor properties- Specified by:
getPropertiesin interfaceStreamInterceptor- Returns:
- Map of handler properties
-