GoldenGateBindings / com.fitbit.goldengate.bindings.coap.data / OutgoingRequestBuilder

OutgoingRequestBuilder

class OutgoingRequestBuilder : BaseOutgoingMessageBuilder<OutgoingRequest>

Concrete class of MessageBuilder for building OutgoingRequest

Constructors

<init>

OutgoingRequestBuilder(path: String, method: Method)

Concrete class of MessageBuilder for building OutgoingRequest

Properties

method

val method: Method

The CoAP Method to use for this request (GET/PUT/POST/DELETE)

path

val path: String

The path to send this request to. (e.g. /foo/bar)

Functions

ackTimeout

fun ackTimeout(value: Int): OutgoingRequestBuilder

Config the timeout after which a resend will happen, in milliseconds. When set to 0, to use a default value according to the CoAP specification and the endpoint.

build

fun build(): OutgoingRequest

Build Coap Message

expectSuccess

fun expectSuccess(expect: Boolean): OutgoingRequestBuilder

Tweaks Observable behavior and allows for custom error handling. If true, a non-2.xx response will error the response() Observable. If false (default), a non-2.xx response will be reported as a next event.

forceNonBlockwise

fun forceNonBlockwise(value: Boolean): OutgoingRequestBuilder

Flag to treat the request as non-blockwise. In a blockwise request data is sent in chuncks(blocks) of fixed size. In GG we use 1024 bytes. On the tracker some Coap resources accept larger data payloads in a single block. In this case we need to force a non-blockwise request.

maxResendCount

fun maxResendCount(value: Int): OutgoingRequestBuilder

Config the maximum number of times the client will resend the request if there is a response timeout. When set to 0, a request will only be sent once and not re-sent. When set to a negative number(e.g. -1), the max resend count will set to GG_COAP_DEFAULT_MAX_RETRANSMIT from GG XP lib

Inherited Functions

body

open fun body(data: Data): OutgoingMessageBuilder<T>
open fun body(stream: InputStream): OutgoingMessageBuilder<T>

Body of the coap message

option

open fun option(option: Option): OutgoingMessageBuilder<T>

Add an option to coap message

progressObserver

open fun progressObserver(progressObserver: Observer<Int>): OutgoingMessageBuilder<T>

Progress Observer of the coap message