public abstract class LogQuerySupport extends Object implements LogQuerySupportMBean
LogQuerySupportMBean
implementationModifier and Type | Field and Description |
---|---|
protected com.fasterxml.jackson.databind.ObjectMapper |
mapper |
Modifier | Constructor and Description |
---|---|
protected |
LogQuerySupport() |
Modifier and Type | Method and Description |
---|---|
protected void |
addJarEntryToIndex(JarEntry entry,
StringBuilder buffer) |
LogResults |
allLogResults()
Returns all the available recent log events as a
LogResults object which is then serialized |
static String |
ensureStartsWithSlash(String path) |
String |
filterLogEvents(String jsonFilter)
Filters the list of log events using the JSON encoding of
LogFilter |
protected String |
getArtifactFile(String mavenCoords,
String filePath,
String classifier) |
String |
getHostName() |
String |
getJavaDoc(String mavenCoordinates,
String filePath)
Returns the javadoc file for the given maven coordinates and filePath
|
String |
getLogEvents(int maxCount)
Returns the recent log events as JSON
|
ObjectName |
getMbeanName() |
MBeanServer |
getMbeanServer() |
String |
getSource(String mavenCoords,
String className,
String filePath)
Returns the source file for the given maven coordinates so that we can link log messages
to source code
|
protected boolean |
isRoot(String filePath)
Returns true if the file path is "/" or empty
|
protected String |
jarIndex(File file) |
protected String |
jarIndex(JarFile jarFile) |
protected String |
jarIndex(URL url) |
LogResults |
jsonQueryLogResults(String jsonFilter)
Allows a JSON filter to be specified then returns the log results as a serialised object
|
protected LogFilter |
jsonToLogFilter(String json) |
protected String |
loadCoords(String coords,
String filePath,
String classifier) |
protected static String |
loadString(URL url) |
LogResults |
logResultsSince(long time)
Returns all the available log events since the given timestamp (millis)
|
void |
registerMBeanServer(MBeanServer mbeanServer) |
void |
setHostName(String hostName) |
void |
setMbeanName(ObjectName mbeanName) |
void |
setMbeanServer(MBeanServer mbeanServer) |
void |
start()
Registers the object with JMX
|
void |
stop()
Unregisters the object with JMX
|
protected String |
toJSON(Object answer) |
void |
unregisterMBeanServer(MBeanServer mbeanServer) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getLogResults, queryLogResults
protected static String loadString(URL url) throws IOException
IOException
public void start()
public void stop()
public LogResults allLogResults() throws IOException
LogQuerySupportMBean
LogResults
object which is then serializedallLogResults
in interface LogQuerySupportMBean
IOException
public LogResults logResultsSince(long time) throws IOException
LogQuerySupportMBean
logResultsSince
in interface LogQuerySupportMBean
IOException
public String getLogEvents(int maxCount) throws IOException
LogQuerySupportMBean
getLogEvents
in interface LogQuerySupportMBean
maxCount
- maximum number to return o <0 for all of themLogEvent
IOException
public String filterLogEvents(String jsonFilter) throws IOException
LogQuerySupportMBean
LogFilter
filterLogEvents
in interface LogQuerySupportMBean
LogEvent
IOException
public LogResults jsonQueryLogResults(String jsonFilter) throws IOException
LogQuerySupportMBean
jsonQueryLogResults
in interface LogQuerySupportMBean
IOException
public ObjectName getMbeanName() throws MalformedObjectNameException
MalformedObjectNameException
public void setMbeanName(ObjectName mbeanName)
public MBeanServer getMbeanServer()
public void setMbeanServer(MBeanServer mbeanServer)
public String getHostName()
public void setHostName(String hostName)
public void registerMBeanServer(MBeanServer mbeanServer)
public void unregisterMBeanServer(MBeanServer mbeanServer)
protected String toJSON(Object answer) throws IOException
IOException
protected LogFilter jsonToLogFilter(String json) throws IOException
IOException
public String getSource(String mavenCoords, String className, String filePath) throws IOException
LogQuerySupportMBean
getSource
in interface LogQuerySupportMBean
mavenCoords
- is a string of the form "groupId:artifactId:version".
For some uber bundles this can be a space separated list.IOException
public String getJavaDoc(String mavenCoordinates, String filePath) throws IOException
LogQuerySupportMBean
getJavaDoc
in interface LogQuerySupportMBean
mavenCoordinates
- is a string of the form "groupId:artifactId:version".
For some uber bundles this can be a space separated list.IOException
protected String getArtifactFile(String mavenCoords, String filePath, String classifier) throws IOException
IOException
protected String loadCoords(String coords, String filePath, String classifier) throws IOException
IOException
protected String jarIndex(URL url) throws IOException
IOException
protected String jarIndex(File file) throws IOException
IOException
protected void addJarEntryToIndex(JarEntry entry, StringBuilder buffer)
protected boolean isRoot(String filePath)
Copyright © 2022 JBoss by Red Hat. All rights reserved.