org.apache.storm.daemon.logviewer.handler

## Class LogviewerLogPageHandler

- java.lang.Object
- - org.apache.storm.daemon.logviewer.handler.LogviewerLogPageHandler

-     public class LogviewerLogPageHandler
      extends Object

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LogviewerLogPageHandler(String logRoot, String daemonLogRoot, WorkerLogs workerLogs, ResourceAuthorizer resourceAuthorizer, StormMetricsRegistry metricsRegistry)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `javax.ws.rs.core.Response` | `daemonLogPage(String fileName, Integer start, Integer length, String grep, String user)` Provides a daemon log file to view.
    `javax.ws.rs.core.Response` | `listLogFiles(String user, Integer port, String topologyId, String callback, String origin)` Enumerate worker log files for given criteria.
    `javax.ws.rs.core.Response` | `logPage(String fileName, Integer start, Integer length, String grep, String user)` Provides a worker log file to view, starting from the specified position or default starting position of the most recent page.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### LogviewerLogPageHandler

          public LogviewerLogPageHandler(String logRoot,
                                         String daemonLogRoot,
                                         WorkerLogs workerLogs,
                                         ResourceAuthorizer resourceAuthorizer,
                                         StormMetricsRegistry metricsRegistry)

      Constructor.

      Parameters:
        `logRoot` - root worker log directory
        `daemonLogRoot` - root daemon log directory
        `workerLogs` - `WorkerLogs`
        `resourceAuthorizer` - `ResourceAuthorizer`
        `metricsRegistry` - The logviewer metrics registry

  - ### Method Detail

    - #### listLogFiles

          public javax.ws.rs.core.Response listLogFiles(String user,
                                                        Integer port,
                                                        String topologyId,
                                                        String callback,
                                                        String origin)
                                                 throws IOException

      Enumerate worker log files for given criteria.

      Parameters:
        `user` - username
        `port` - worker’s port, null for all workers
        `topologyId` - topology ID, null for all topologies
        `callback` - callbackParameterName for JSONP
        `origin` - origin
      Returns:
        list of worker logs for given criteria
      Throws:
        `IOException`

    - #### logPage

          public javax.ws.rs.core.Response logPage(String fileName,
                                                   Integer start,
                                                   Integer length,
                                                   String grep,
                                                   String user)
                                            throws IOException,
                                                   InvalidRequestException

      Provides a worker log file to view, starting from the specified position or default starting position of the most recent page.

      Parameters:
        `fileName` - file to view
        `start` - start offset, or null if the most recent page is desired
        `length` - length to read in this page, or null if default page length is desired
        `grep` - search string if request is a result of the search, can be null
        `user` - username
      Returns:
        HTML view page of worker log
      Throws:
        `IOException`
        `InvalidRequestException`

    - #### daemonLogPage

          public javax.ws.rs.core.Response daemonLogPage(String fileName,
                                                         Integer start,
                                                         Integer length,
                                                         String grep,
                                                         String user)
                                                  throws IOException,
                                                         InvalidRequestException

      Provides a daemon log file to view.

      Parameters:
        `fileName` - file to view
        `start` - start offset, or null if the most recent page is desired
        `length` - length to read in this page, or null if default page length is desired
        `grep` - search string if request is a result of the search, can be null
        `user` - username
      Returns:
        HTML view page of daemon log
      Throws:
        `IOException`
        `InvalidRequestException`

Copyright © 2021 The Apache Software Foundation. All rights reserved.