Class XMLLoggingOutInterceptor

  • All Implemented Interfaces:
    adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, org.apache.cxf.interceptor.Interceptor<org.apache.cxf.message.Message>, org.apache.cxf.phase.PhaseInterceptor<org.apache.cxf.message.Message>

    public class XMLLoggingOutInterceptor
    extends AbstractOutInterceptor
    Default XML Logging interceptor.
    Author:
    greenbird Integration Technology, FracPete (fracpete at waikato dot ac dot nz) - simplified
    • Field Detail

      • logger

        protected adams.core.logging.Logger logger
      • prettyPrint

        protected boolean prettyPrint
        whether to use pretty printing.
      • outputFile

        protected File outputFile
        the file to output the XML messages to - disabled if null.
      • convert

        protected adams.data.conversion.PrettyPrintXML convert
        the conversion for pretty printing the XML.
      • formatter

        protected transient adams.core.DateFormat formatter
        for outputting timestamps in the output file.
    • Constructor Detail

      • XMLLoggingOutInterceptor

        public XMLLoggingOutInterceptor()
      • XMLLoggingOutInterceptor

        public XMLLoggingOutInterceptor​(adams.core.logging.Logger logger,
                                        boolean prettyPrint,
                                        File outputFile)
    • Method Detail

      • prettyPrint

        protected StringBuilder prettyPrint​(StringBuilder buffer)
        Pretty prints the buffer, if enabled.
        Parameters:
        buffer - the buffer to turn into "pretty" XML
        Returns:
        the (potentially) new buffer
      • handleMessage

        public void handleMessage​(org.apache.cxf.message.Message message)
                           throws org.apache.cxf.interceptor.Fault
        Throws:
        org.apache.cxf.interceptor.Fault
      • logProperties

        protected void logProperties​(StringBuilder buffer,
                                     org.apache.cxf.message.Message message)
        Method intended for use within subclasses. Log custom field here.
        Parameters:
        message - message
      • getIdHeader

        protected String getIdHeader​(org.apache.cxf.message.Message message)
        Gets theMessageID header in the list of headers.
      • getHeader

        protected String getHeader​(org.apache.cxf.message.Message message,
                                   String name)