Package overit.geocall.cxf.trace
Class AbstractTraceInterceptor
java.lang.Object
org.apache.cxf.phase.AbstractPhaseInterceptor<Message>
overit.geocall.cxf.trace.AbstractTraceInterceptor
- All Implemented Interfaces:
Interceptor<Message>,PhaseInterceptor<Message>
- Direct Known Subclasses:
TraceInEndingInterceptor,TraceInInterceptor,TraceOutInterceptor
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected IOLogFilterstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ObjectconvertContent(CachedOutputStream cos, String encoding, String contentType) Convert the message content into the Element/JsonElement/byte[]/String based on the contentTypeprotected IOLogTracerRetrive theIOLogTracerassigned to this message.voidhandleFault(Message message) voidhandleMessage(Message message) protected booleanCheck if the message has been marked as an error messageprotected booleanisWSDLRequest(Message message) protected voidLog the content of a messageprotected voidLog the content of an error messageprotected voidlogRequest(Message m, Object content) Log the content of a requestprotected voidlogResponse(Message m, Object content) Log the content of a response messagevoidsetFilter(IOLogFilter filter) protected voidsetupTracer(Message message) Register aIOLogTracerfor this message.Methods inherited from class org.apache.cxf.phase.AbstractPhaseInterceptor
addAfter, addAfter, addBefore, addBefore, getAdditionalInterceptors, getAfter, getBefore, getId, getPhase, isGET, isRequestor, setAfter, setBefore
-
Field Details
-
CLIENT_KEY
- See Also:
-
TRACER_KEY
- See Also:
-
TRACE_FILE_REFERENCE
- See Also:
-
TRACE_DB_REFERENCE
- See Also:
-
_filter
-
-
Constructor Details
-
AbstractTraceInterceptor
-
-
Method Details
-
setFilter
-
handleMessage
- Throws:
Fault
-
handleFault
- Specified by:
handleFaultin interfaceInterceptor<Message>- Overrides:
handleFaultin classAbstractPhaseInterceptor<Message>
-
setupTracer
Register aIOLogTracerfor this message. Inbound and outbound interceptor must share the very same Tracer in order to log both input and output/error message otherwise it's impossible to log anything.- Parameters:
message- To associate anIOLogTracer
-
getTracer
Retrive theIOLogTracerassigned to this message. If this method is called beforesetupTracer(Message)probabily no tracer has been registered yet and this method will return null value.- Parameters:
message- where the tracer has been registered- Returns:
- the tracer linked to this message
-
hasFault
Check if the message has been marked as an error message- Parameters:
m- Message to check- Returns:
trueif the code assigned to the message correspond to an error's one, or the message contains an exception
-
log
Log the content of a message- Parameters:
m- Message used to retrive some contextual informationcontent- message payloaderror-trueif some error has been occurred and the log must be saved as and "Error Log".falseotherwise
-
logRequest
Log the content of a request- Parameters:
m- Message used to retrive some contextual informationcontent- message payload
-
logResponse
Log the content of a response message- Parameters:
m- Message used to retrive some contextual informationcontent- message payload
-
logError
Log the content of an error message- Parameters:
m- Message used to retrive some contextual informationcontent- message payload
-
convertContent
protected Object convertContent(CachedOutputStream cos, String encoding, String contentType) throws Exception Convert the message content into the Element/JsonElement/byte[]/String based on the contentType- Parameters:
cos- The chached output streamencoding- The encodingcontentType- String defining the content type, it can be Element or JsonElement or byte[] or String- Returns:
- The object converted
- Throws:
ParserConfigurationException- If a serious configuration error occursIOException- If an I/O exception occursSAXException- If a XML parser error occursException
-
isWSDLRequest
-