Class XMLLoggingOutInterceptor
- java.lang.Object
-
- org.apache.cxf.phase.AbstractPhaseInterceptor<org.apache.cxf.message.Message>
-
- adams.flow.webservice.interceptor.outgoing.AbstractOutInterceptor
-
- adams.flow.webservice.interceptor.outgoing.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
XMLLoggingOutInterceptor.SimpleLoggingCallback
-
Field Summary
Fields Modifier and Type Field Description protected adams.data.conversion.PrettyPrintXML
convert
the conversion for pretty printing the XML.protected adams.core.DateFormat
formatter
for outputting timestamps in the output file.protected adams.core.logging.Logger
logger
protected File
outputFile
the file to output the XML messages to - disabled if null.protected boolean
prettyPrint
whether to use pretty printing.-
Fields inherited from class adams.flow.webservice.interceptor.outgoing.AbstractOutInterceptor
m_Logger, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description XMLLoggingOutInterceptor()
XMLLoggingOutInterceptor(adams.core.logging.Logger logger, boolean prettyPrint, File outputFile)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
getHeader(org.apache.cxf.message.Message message, String name)
protected String
getIdHeader(org.apache.cxf.message.Message message)
Gets theMessageID header in the list of headers.void
handleMessage(org.apache.cxf.message.Message message)
protected void
logProperties(StringBuilder buffer, org.apache.cxf.message.Message message)
Method intended for use within subclasses.protected StringBuilder
prettyPrint(StringBuilder buffer)
Pretty prints the buffer, if enabled.-
Methods inherited from class adams.flow.webservice.interceptor.outgoing.AbstractOutInterceptor
configureLogger, getLogger, getLoggingLevel, initialize, initializeLogging, isInfoLoggingEnabled, isLoggingEnabled, setLoggingLevel
-
-
-
-
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.
-
-