Package wt.jmx.core.mbeans
Interface FileViewerMBean
- All Superinterfaces:
AbstractFileViewMBean,SelfEmailingMBean
Provides a simple MBean representation of a file
Supported API: true
Extendable: true
Supported API: true
Extendable: true
-
Method Summary
Modifier and TypeMethodDescriptionvoidE-mail entire file as attachment, optionally compressing it
Supported API: truevoidemailTextFile(String addressesOrEmailList, String subject, long maxLines, long maxChars) E-mail last portion of text file
Supported API: truelonggetSize()Size of file (in bytes)
Supported API: trueString[]searchFile(String searchRegexp, boolean numberLines) View all lines of this file that match a specified regular expression.String[]searchFile(String searchRegexp, String newEntryRegexp, boolean numberLines) View all "entries" from this file that match a specified regular expression.String[]searchFile(String searchRegexp, String newEntryRegexp, boolean numberLines, int maxLines) View all "entries" from this file that match a specified regular expression.voidsendFileToSupport(long callNumber, String description) Send file to technical support
Supported API: trueString[]viewFile()View last reasonable portion of this file
Supported API: trueString[]viewFile(long maxLines, long maxChars) View last portion of this file
Supported API: trueMethods inherited from interface wt.jmx.core.mbeans.AbstractFileViewMBean
getLastModifiedTime, getName, getPath, isExistsMethods inherited from interface wt.jmx.core.mbeans.SelfEmailingMBean
emailThisMBean
-
Method Details
-
getSize
long getSize()Size of file (in bytes)
Supported API: true -
viewFile
View last reasonable portion of this file
Supported API: true- Throws:
IOException
-
viewFile
View last portion of this file
Supported API: true- Parameters:
maxLines- Maximum number of lines to include; non-positive numbers imply no limitmaxChars- Maximum number of characters to include; non-positive numbers imply no limit- Throws:
IOException
-
searchFile
@MBeanOperationImpact(0) String[] searchFile(String searchRegexp, boolean numberLines) throws IOException View all lines of this file that match a specified regular expression.
Supported API: true- Parameters:
searchRegexp- Regular expression to search withnumberLines- Whether resulting lines should include original line numbers- Throws:
IOException
-
searchFile
@MBeanOperationImpact(0) String[] searchFile(String searchRegexp, String newEntryRegexp, boolean numberLines) throws IOException View all "entries" from this file that match a specified regular expression.Lines which match 'newEntryRegexp' are interpreted as the beginning of new entries in the file whereas all other lines are interpreted as belonging to the same entry as the last such line. This allows one to specify a semi-heuristic regular expression to keep a log4j log line and its stack trace together, for instance.
Supported API: true- Parameters:
searchRegexp- Regular expression to search withnewEntryRegexp- Regular expression which indicate the first line of an "entry"; if null or empty, the value of the Dumper MBean's DefaultNewEntryRegexp is usednumberLines- Whether resulting lines should include original line numbers- Throws:
IOException
-
searchFile
@MBeanOperationImpact(0) String[] searchFile(String searchRegexp, String newEntryRegexp, boolean numberLines, int maxLines) throws IOException View all "entries" from this file that match a specified regular expression.Lines which match 'newEntryRegexp' are interpreted as the beginning of new entries in the file whereas all other lines are interpreted as belonging to the same entry as the last such line. This allows one to specify a semi-heuristic regular expression to keep a log4j log line and its stack trace together, for instance.
Supported API: true- Parameters:
searchRegexp- Regular expression to search withnewEntryRegexp- Regular expression which indicate the first line of an "entry"; if null or empty, the value of the Dumper MBean's DefaultNewEntryRegexp is usednumberLines- Whether resulting lines should include original line numbersmaxLines- Maximum lines to return from any given file (not including elision line); negative values imply no limit- Throws:
IOException
-
emailFile
@MBeanOperationImpact(0) void emailFile(String addressesOrEmailList, String subject, boolean compress) throws IOException E-mail entire file as attachment, optionally compressing it
Supported API: true- Parameters:
addressesOrEmailList- Comma-delimited list of e-mail addresses or name of e-mail list to send e-mail tosubject- Subject to give e-mailcompress- Whether to compress file attachment- Throws:
IOException
-
emailTextFile
@MBeanOperationImpact(0) void emailTextFile(String addressesOrEmailList, String subject, long maxLines, long maxChars) throws IOException E-mail last portion of text file
Supported API: true- Parameters:
addressesOrEmailList- Comma-delimited list of e-mail addresses or name of e-mail list to send e-mail tosubject- Subject to give e-mailmaxLines- Maximum number of lines to include; non-positive numbers imply no limitmaxChars- Maximum number of characters to include; non-positive numbers imply no limit- Throws:
IOException
-
sendFileToSupport
@MBeanOperationImpact(0) void sendFileToSupport(long callNumber, String description) throws Exception Send file to technical support
Supported API: true- Parameters:
callNumber- Existing technical support call number to associate this data withdescription- Description to give data- Throws:
Exception
-