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

public abstract class AbstractTraceInterceptor extends AbstractPhaseInterceptor<Message>
  • Field Details

  • Constructor Details

    • AbstractTraceInterceptor

      public AbstractTraceInterceptor(String phase)
  • Method Details

    • setFilter

      public void setFilter(IOLogFilter filter)
    • handleMessage

      public void handleMessage(Message message) throws Fault
      Throws:
      Fault
    • handleFault

      public void handleFault(Message message)
      Specified by:
      handleFault in interface Interceptor<Message>
      Overrides:
      handleFault in class AbstractPhaseInterceptor<Message>
    • setupTracer

      protected void setupTracer(Message message)
      Register a IOLogTracer for 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 an IOLogTracer
    • getTracer

      protected IOLogTracer getTracer(Message message)
      Retrive the IOLogTracer assigned to this message. If this method is called before setupTracer(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

      protected boolean hasFault(Message m)
      Check if the message has been marked as an error message
      Parameters:
      m - Message to check
      Returns:
      true if the code assigned to the message correspond to an error's one, or the message contains an exception
    • log

      protected void log(Message m, Object content, boolean error)
      Log the content of a message
      Parameters:
      m - Message used to retrive some contextual information
      content - message payload
      error - true if some error has been occurred and the log must be saved as and "Error Log". false otherwise
    • logRequest

      protected void logRequest(Message m, Object content)
      Log the content of a request
      Parameters:
      m - Message used to retrive some contextual information
      content - message payload
    • logResponse

      protected void logResponse(Message m, Object content)
      Log the content of a response message
      Parameters:
      m - Message used to retrive some contextual information
      content - message payload
    • logError

      protected void logError(Message m, Object content)
      Log the content of an error message
      Parameters:
      m - Message used to retrive some contextual information
      content - 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 stream
      encoding - The encoding
      contentType - 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 occurs
      IOException - If an I/O exception occurs
      SAXException - If a XML parser error occurs
      Exception
    • isWSDLRequest

      protected boolean isWSDLRequest(Message message)