Interface FileViewerMBean

All Superinterfaces:
AbstractFileViewMBean, SelfEmailingMBean

public interface FileViewerMBean extends AbstractFileViewMBean
Provides a simple MBean representation of a file

Supported API: true

Extendable: true
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    emailFile(String addressesOrEmailList, String subject, boolean compress)
    E-mail entire file as attachment, optionally compressing it

    Supported API: true
    void
    emailTextFile(String addressesOrEmailList, String subject, long maxLines, long maxChars)
    E-mail last portion of text file

    Supported API: true
    long
    Size of file (in bytes)

    Supported API: true
    searchFile(String searchRegexp, boolean numberLines)
    View all lines of this file that match a specified regular expression.
    searchFile(String searchRegexp, String newEntryRegexp, boolean numberLines)
    View all "entries" from this file that match a specified regular expression.
    searchFile(String searchRegexp, String newEntryRegexp, boolean numberLines, int maxLines)
    View all "entries" from this file that match a specified regular expression.
    void
    sendFileToSupport(long callNumber, String description)
    Send file to technical support

    Supported API: true
    View last reasonable portion of this file

    Supported API: true
    viewFile(long maxLines, long maxChars)
    View last portion of this file

    Supported API: true

    Methods inherited from interface wt.jmx.core.mbeans.AbstractFileViewMBean

    getLastModifiedTime, getName, getPath, isExists

    Methods inherited from interface wt.jmx.core.mbeans.SelfEmailingMBean

    emailThisMBean
  • Method Details

    • getSize

      long getSize()
      Size of file (in bytes)

      Supported API: true
    • viewFile

      @MBeanOperationImpact(0) String[] viewFile() throws IOException
      View last reasonable portion of this file

      Supported API: true
      Throws:
      IOException
    • viewFile

      @MBeanOperationImpact(0) String[] viewFile(long maxLines, long maxChars) throws IOException
      View last portion of this file

      Supported API: true
      Parameters:
      maxLines - Maximum number of lines to include; non-positive numbers imply no limit
      maxChars - 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 with
      numberLines - 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 with
      newEntryRegexp - Regular expression which indicate the first line of an "entry"; if null or empty, the value of the Dumper MBean's DefaultNewEntryRegexp is used
      numberLines - 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 with
      newEntryRegexp - Regular expression which indicate the first line of an "entry"; if null or empty, the value of the Dumper MBean's DefaultNewEntryRegexp is used
      numberLines - Whether resulting lines should include original line numbers
      maxLines - 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 to
      subject - Subject to give e-mail
      compress - 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 to
      subject - Subject to give e-mail
      maxLines - Maximum number of lines to include; non-positive numbers imply no limit
      maxChars - 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 with
      description - Description to give data
      Throws:
      Exception