GoldenGateBindings / com.fitbit.goldengate.bindings.coap / Endpoint

Endpoint

interface Endpoint

This class is the Client/Server API of that will be exposed to users of this library.

Example:

fun sendMegadump(megadump: ByteArray): Single<IncomingResponse> {
    val request = OutgoingRequestBuilder("/sync/response", Method.PUT).body(megadump).build()
    return endpoint.responseFor(request)
}

Functions

addResourceHandler

abstract fun addResourceHandler(path: String, handler: ResourceHandler, configuration: CoapEndpointHandlerConfiguration = CoapEndpointHandlerConfiguration()): Completable

Registers a coap handler for a certain path.

removeResourceHandler

abstract fun removeResourceHandler(path: String): Completable

Unregisters the coap handler for a certain path

resource

open fun <T> resource(path: String, parser: ByteArrayParser<T>): Single<T>

Convenience method for making a GET request to path and parsing it into a T

responseFor

abstract fun responseFor(request: OutgoingRequest): Single<IncomingResponse>

Call this to send a request and get a response (i.e. be a client).

open fun <T> responseFor(request: OutgoingRequest, parser: ByteArrayParser<T>): Single<T>

Convenience method for parsing a Response into a T

Inheritors

CoapEndpoint

class CoapEndpoint : NativeReference, StackService, Endpoint, DataSinkDataSource

Coap Client/Server API.