GenericStreamingCollectionEndpointImpl

Endpoint for a collection of TEntitys observable as an append-only stream.

Use the more constrained StreamingCollectionEndpointImpl when possible.

Parameters

referrer

The endpoint used to navigate to this one.

relativeUri

The URI of this endpoint relative to the referrer's.

entityType

The type of individual elements in the collection.

elementEndpointFactory

The factory for constructing TElementEndpoints to provide for individual elements.

Type Parameters

TEntity

The type of individual elements in the collection.

TElementEndpoint

The type of ElementEndpoint to provide for individual TEntitys.

Inheritors

Constructors

Link copied to clipboard
constructor(referrer: Endpoint, relativeUri: URI, entityType: Class<TEntity>, elementEndpointFactory: (referrer: Endpoint, relativeUri: URI) -> TElementEndpoint)
constructor(referrer: Endpoint, relativeUri: String, entityType: Class<TEntity>, elementEndpointFactory: (referrer: Endpoint, relativeUri: URI) -> TElementEndpoint)

Creates a new streaming collection endpoint.

Properties

Link copied to clipboard
open override val createAllAllowed: Boolean?
Link copied to clipboard
open override val createAllowed: Boolean?
Link copied to clipboard
open override val errorHandler: ErrorHandler
Link copied to clipboard
open override val httpClient: OkHttpClient
Link copied to clipboard
open override val linkExtractor: LinkExtractor
Link copied to clipboard
open override var pollingInterval: Duration

Interval in which requests are sent to the server. The server may update this interval via the Retry-After response header.

Link copied to clipboard
Link copied to clipboard
open override val readAllAllowed: Boolean?
Link copied to clipboard
open override var readRangeAllowed: Boolean?
Link copied to clipboard
open override var responseCache: ResponseCache?
Link copied to clipboard
open override val serializers: List<Serializer>
Link copied to clipboard
open override val setAllAllowed: Boolean?
Link copied to clipboard
open override val uri: URI

Functions

Link copied to clipboard
open override fun create(entity: TEntity): TElementEndpoint?
Link copied to clipboard
open override fun createAll(entities: Iterable<TEntity>)
Link copied to clipboard
fun <T> deserialize(body: ResponseBody, type: Class<T>): T?
Link copied to clipboard
fun <T> deserializeList(body: ResponseBody, type: Class<T>): List<T>?
Link copied to clipboard
open operator override fun get(entity: TEntity): TElementEndpoint
operator fun get(id: String): TElementEndpoint
Link copied to clipboard
open override fun getLinks(rel: String): List<Pair<URI, String?>>
Link copied to clipboard
fun getLinkTemplate(rel: String): com/damnhandy/uri/template/UriTemplate
Link copied to clipboard
open override fun getObservable(startIndex: Long = 0): Observable<TEntity>

Provides an observable stream of elements.

Link copied to clipboard
open override fun link(rel: String): URI
Link copied to clipboard
open override fun linkTemplate(rel: String, variables: Map<String, Any>): URI
Link copied to clipboard
open override fun readAll(): List<TEntity>
Link copied to clipboard
open override fun readRange(from: Long?, to: Long?): PartialResponse<TEntity>
Link copied to clipboard
fun <T> serialize(entity: T, type: Class<T>): RequestBody
Link copied to clipboard
fun <T> serializeList(entities: Iterable<T>, type: Class<T>): RequestBody
Link copied to clipboard
open override fun setAll(entities: Iterable<TEntity>)
Link copied to clipboard
fun setDefaultLink(rel: String, href: String?)
Link copied to clipboard