org.apache.olingo.server.api.debug

## Class DefaultDebugSupport

- java.lang.Object
- - org.apache.olingo.server.api.debug.DefaultDebugSupport

- All Implemented Interfaces:
    DebugSupport

      public class DefaultDebugSupport
      extends Object
      implements DebugSupport

  Supports the default debug case. Will always deliver a debug response if requested from the server.

- - ### Field Summary

    - ### Fields inherited from interface org.apache.olingo.server.api.debug.DebugSupport

      `ODATA_DEBUG_DOWNLOAD, ODATA_DEBUG_HTML, ODATA_DEBUG_JSON, ODATA_DEBUG_QUERY_PARAMETER`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultDebugSupport()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `ODataResponse` | `createDebugResponse(String debugFormat, DebugInformation debugInfo)` Creates a debug response and delivers it back to the Olingo library.
    `void` | `init(OData odata)` Initializes the debug support implementation.
    `boolean` | `isUserAuthorized()` Ensures that the user that requested the debug output is authorized to see this output.

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

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

- - ### Constructor Detail

    - #### DefaultDebugSupport

          public DefaultDebugSupport()

  - ### Method Detail

    - #### init

          public void init(OData odata)

      Description copied from interface: `DebugSupport`
      Initializes the debug support implementation. Is called before `DebugSupport.isUserAuthorized()` and `DebugSupport.createDebugResponse(String, DebugInformation)`.
      Specified by:
        `init` in interface `DebugSupport`
      Parameters:
        `odata` - related OData/Olingo service factory

    - #### isUserAuthorized

          public boolean isUserAuthorized()

      Description copied from interface: `DebugSupport`
      Ensures that the user that requested the debug output is authorized to see this output.
      Specified by:
        `isUserAuthorized` in interface `DebugSupport`
      Returns:
        true if the current user is authorized

    - #### createDebugResponse

          public ODataResponse createDebugResponse(String debugFormat,
                                                   DebugInformation debugInfo)

      Description copied from interface: `DebugSupport`
      Creates a debug response and delivers it back to the Olingo library. This method MUST NEVER throw an exception.
      Specified by:
        `createDebugResponse` in interface `DebugSupport`
      Parameters:
        `debugFormat` - the value of the odata-debug query parameter
        `debugInfo` - all necessary information to construct debug output
      Returns:
        a new debug response which will be sent to the client

Copyright © 2013–2022 The Apache Software Foundation. All rights reserved.