Class XMLLoggingInInterceptor
- java.lang.Object
-
- org.apache.cxf.phase.AbstractPhaseInterceptor<org.apache.cxf.message.Message>
-
- adams.flow.webservice.interceptor.incoming.AbstractInInterceptor
-
- adams.flow.webservice.interceptor.incoming.XMLLoggingInInterceptor
-
- 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 XMLLoggingInInterceptor extends AbstractInInterceptor
Default XML Logging interceptor.- Author:
- greenbird Integration Technology, FracPete (fracpete at waikato dot ac dot nz) - simplified, pretty printing
-
-
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.incoming.AbstractInInterceptor
m_Logger, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description XMLLoggingInInterceptor()
XMLLoggingInInterceptor(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.protected StringBuilder[]
splitMessage(StringBuilder msg)
Splits the message into (if possible): header, actual message and footer.-
Methods inherited from class adams.flow.webservice.interceptor.incoming.AbstractInInterceptor
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
-
XMLLoggingInInterceptor
public XMLLoggingInInterceptor()
-
XMLLoggingInInterceptor
public XMLLoggingInInterceptor(adams.core.logging.Logger logger, boolean prettyPrint, File outputFile)
-
-
Method Detail
-
splitMessage
protected StringBuilder[] splitMessage(StringBuilder msg)
Splits the message into (if possible): header, actual message and footer.- Parameters:
msg
- the message to split- Returns:
- the split message
-
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
-
getIdHeader
protected String getIdHeader(org.apache.cxf.message.Message message)
Gets theMessageID header in the list of headers.
-
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
-
-