org.apache.storm.daemon.logviewer.utils

## Class LogviewerResponseBuilder

- java.lang.Object
- - org.apache.storm.daemon.logviewer.utils.LogviewerResponseBuilder

-     public class LogviewerResponseBuilder
      extends Object

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static javax.ws.rs.core.Response` | `buildDownloadFile(String contentDispositionName, File file, com.codahale.metrics.Meter numFileDownloadExceptions)` Build a Response object representing download a file.
    `static javax.ws.rs.core.Response` | `buildExceptionJsonResponse(Exception ex, String callback)` Build a Response object representing exception, with JSON response.
    `static javax.ws.rs.core.Response` | `buildResponsePageNotFound()` Build a Response object representing page not found.
    `static javax.ws.rs.core.Response` | `buildResponseUnauthorizedUser(String user)` Build a Response object representing unauthorized user, with HTML response.
    `static javax.ws.rs.core.Response` | `buildSuccessHtmlResponse(String content)` Build a Response object representing success response with HTML entity.
    `static javax.ws.rs.core.Response` | `buildSuccessJsonResponse(Object entity, String callback, String origin)` Build a Response object representing success response with JSON entity.
    `static javax.ws.rs.core.Response` | `buildUnauthorizedUserJsonResponse(String user, String callback)` Build a Response object representing unauthorized user, with JSON response.

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

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

- - ### Method Detail

    - #### buildSuccessHtmlResponse

          public static javax.ws.rs.core.Response buildSuccessHtmlResponse(String content)

      Build a Response object representing success response with HTML entity.

      Parameters:
        `content` - HTML entity content, String type

    - #### buildSuccessJsonResponse

          public static javax.ws.rs.core.Response buildSuccessJsonResponse(Object entity,
                                                                           String callback,
                                                                           String origin)

      Build a Response object representing success response with JSON entity.

      Parameters:
        `entity` - entity object to represent it as JSON
        `callback` - callbackParameterName for JSONP
        `origin` - origin
      See Also:
        `JsonResponseBuilder}`

    - #### buildDownloadFile

          public static javax.ws.rs.core.Response buildDownloadFile(String contentDispositionName,
                                                                    File file,
                                                                    com.codahale.metrics.Meter numFileDownloadExceptions)
                                                             throws IOException

      Build a Response object representing download a file.

      Parameters:
        `contentDispositionName` - The name to set in the Content-Disposition header
        `file` - file to download
      Throws:
        `IOException`

    - #### buildResponseUnauthorizedUser

          public static javax.ws.rs.core.Response buildResponseUnauthorizedUser(String user)

      Build a Response object representing unauthorized user, with HTML response.

      Parameters:
        `user` - username

    - #### buildResponsePageNotFound

          public static javax.ws.rs.core.Response buildResponsePageNotFound()

      Build a Response object representing page not found.

    - #### buildUnauthorizedUserJsonResponse

          public static javax.ws.rs.core.Response buildUnauthorizedUserJsonResponse(String user,
                                                                                    String callback)

      Build a Response object representing unauthorized user, with JSON response.

      Parameters:
        `user` - username
        `callback` - callbackParameterName for JSONP

    - #### buildExceptionJsonResponse

          public static javax.ws.rs.core.Response buildExceptionJsonResponse(Exception ex,
                                                                             String callback)

      Build a Response object representing exception, with JSON response.

      Parameters:
        `ex` - Exception object
        `callback` - callbackParameterName for JSONP

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