|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mtgi.analytics.XmlBehaviorEventPersisterImpl
@ManagedResource(objectName="com.mtgi:group=analytics,name=BehaviorTrackingLog", description="Perform maintenance on BehaviorTracking XML logfiles") public class XmlBehaviorEventPersisterImpl
Behavior Tracking persister which writes events to an XML log file,
either as plain text or FastInfoset binary XML. Which format is
selected by setBinary(boolean)
. Log rotation can be accomplished
by rotateLog()
.
Nested Class Summary | |
---|---|
protected static class |
XmlBehaviorEventPersisterImpl.FileOrder
|
Constructor Summary | |
---|---|
XmlBehaviorEventPersisterImpl()
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
|
void |
destroy()
|
RelocatableFile |
downloadLogFile(String name)
|
String |
getFile()
|
long |
getFileSize()
|
File |
getLogFile(File file)
get the active log file, modifying the supplied base name to reflect compressed / binary options. |
boolean |
isBinary()
|
boolean |
isCompress()
|
StringBuffer |
listLogFiles()
JMX operation to list archived xml data files available for download. |
int |
persist(Queue<BehaviorEvent> events)
Drain the given event queue, persisting all instances to the database. |
String |
rotateLog()
Force a rotation of the log. |
void |
setBinary(boolean binary)
Set to true to log in FastInfoset binary XML format. |
void |
setCompress(boolean compress)
Set to true to log in ZLIB compressed format. |
void |
setDateFormat(String dateFormat)
override the default log name date format |
void |
setFile(String path)
set the destination log file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XmlBehaviorEventPersisterImpl()
Method Detail |
---|
@ManagedAttribute(description="Can be used to switch between binary and text XML. Changes take affect after the next log rotation.") public void setBinary(boolean binary)
@ManagedAttribute(description="Can be used to switch between binary and text XML. Changes take affect after the next log rotation.") public boolean isBinary()
@ManagedAttribute(description="Can be used to turn on/off log file compression. Changes take affect after the next log rotation.") public boolean isCompress()
@ManagedAttribute(description="Can be used to turn on/off log file compression. Changes take affect after the next log rotation.") public void setCompress(boolean compress)
public void setDateFormat(String dateFormat)
@ManagedOperation(description="List all archived performance data log files available for download") public StringBuffer listLogFiles()
@ManagedOperation(description="directly access a performance log file by name; use listLogFiles to determine valid file names") public RelocatableFile downloadLogFile(String name) throws IOException
IOException
public void setFile(String path)
public String getFile()
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
public void destroy() throws Exception
destroy
in interface org.springframework.beans.factory.DisposableBean
Exception
@ManagedAttribute(description="Report the current size of the XML log, in bytes") public long getFileSize()
public int persist(Queue<BehaviorEvent> events)
BehaviorEventPersister
persist
in interface BehaviorEventPersister
@ManagedOperation(description="Force a rotation of the behavior tracking log") public String rotateLog() throws IOException, javax.xml.stream.XMLStreamException
[logfile].yyyyMMddHHmmss
.
If a file of that name already exists, an extra _N will be appended to it, where N is an
integer sufficiently large to make the name unique. This method can be called
externally by the Quartz scheduler for periodic rotation, or by an administrator
via JMX.
IOException
javax.xml.stream.XMLStreamException
public File getLogFile(File file)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |