Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AbstractHTTP

Abstract implementation of the OnmsHTTP interface meant to be extended by a concrete class.

implements

IOnmsHTTP

Hierarchy

Implements

Index

Constructors

constructor

  • Create a new HTTP instance.

    constructor

    Parameters

    • Optional server: OnmsServer

      A server object for immediate configuration.

    • Optional timeout: number

      How long to wait until timing out requests.

    Returns AbstractHTTP

Accessors

options

server

timeout

  • get timeout(): number
  • set timeout(t: number): void
  • The default amount of time to wait before giving up on a request.

    deprecated

    Set timeout on the OnmsHTTPOptions object instead. This will go away in OpenNMS.js 2.0.

    Returns number

  • The default amount of time to wait before giving up on a request.

    Parameters

    • t: number

    Returns void

Methods

Abstract get

Protected getData

  • getData(response: any): any

Protected getOptions

Protected getServer

Abstract head

Abstract httpDelete

Protected onBasicAuth

  • onBasicAuth(username: string, password: string, newHash: string, oldHash?: string): void
  • Keep the basic auth string in sync when username/password changes.

    Parameters

    • username: string

      The username

    • password: string

      The user's password

    • newHash: string

      The newly-computed hash of username + password

    • Optional oldHash: string

      The previous hash

    Returns void

Protected onSetServer

  • onSetServer(): void
  • Implementers should override this method if they have actions that need to be performed (like clearing a cache) when server settings change.

    Returns void

Abstract post

Abstract put

Protected transformJSON

  • transformJSON(data: any): any
  • A convenience method for implementers to use to turn JSON into a javascript object. Use this to process a JSON response before returning it in an OnmsResult object.

    Parameters

    • data: any

    Returns any

Protected transformXML

  • transformXML(data: any): any
  • A convenience method for implementers to use to turn XML into a javascript object. Use this to process an XML response before returning it in an OnmsResult object.

    Parameters

    • data: any

    Returns any

Protected useBasicAuth

  • useBasicAuth(username?: string, password?: string): void
  • Set or update the basic auth credentials to be used in making connections.

    Parameters

    • Optional username: string

      The username to connect with

    • Optional password: string

      The password to connect with

    Returns void

Generated using TypeDoc