public abstract class LogQuerySupport extends Object implements LogQuerySupportMBean
io.fabric8.insight.log.service.LogQueryMBean implementation| Modifier 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, waitgetLogResults, queryLogResultsprotected static String loadString(URL url) throws IOException
IOExceptionpublic void start()
public void stop()
public LogResults allLogResults() throws IOException
LogQuerySupportMBeanLogResults object which is then serializedallLogResults in interface LogQuerySupportMBeanIOExceptionpublic LogResults logResultsSince(long time) throws IOException
LogQuerySupportMBeanlogResultsSince in interface LogQuerySupportMBeanIOExceptionpublic String getLogEvents(int maxCount) throws IOException
LogQuerySupportMBeangetLogEvents in interface LogQuerySupportMBeanmaxCount - maximum number to return o <0 for all of themLogEventIOExceptionpublic String filterLogEvents(String jsonFilter) throws IOException
LogQuerySupportMBeanLogFilterfilterLogEvents in interface LogQuerySupportMBeanLogEventIOExceptionpublic LogResults jsonQueryLogResults(String jsonFilter) throws IOException
LogQuerySupportMBeanjsonQueryLogResults in interface LogQuerySupportMBeanIOExceptionpublic ObjectName getMbeanName() throws MalformedObjectNameException
MalformedObjectNameExceptionpublic 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
IOExceptionprotected LogFilter jsonToLogFilter(String json) throws IOException
IOExceptionpublic String getSource(String mavenCoords, String className, String filePath) throws IOException
LogQuerySupportMBeangetSource in interface LogQuerySupportMBeanmavenCoords - is a string of the form "groupId:artifactId:version".
For some uber bundles this can be a space separated list.IOExceptionpublic String getJavaDoc(String mavenCoordinates, String filePath) throws IOException
LogQuerySupportMBeangetJavaDoc in interface LogQuerySupportMBeanmavenCoordinates - is a string of the form "groupId:artifactId:version".
For some uber bundles this can be a space separated list.IOExceptionprotected String getArtifactFile(String mavenCoords, String filePath, String classifier) throws IOException
IOExceptionprotected String loadCoords(String coords, String filePath, String classifier) throws IOException
IOExceptionprotected String jarIndex(URL url) throws IOException
IOExceptionprotected String jarIndex(File file) throws IOException
IOExceptionprotected void addJarEntryToIndex(JarEntry entry, StringBuilder buffer)
protected boolean isRoot(String filePath)
Copyright © 2011–2014 Red Hat. All rights reserved.