com.pubnub.internal.endpoints.DelegatingEndpoint.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pubnub-gson-impl Show documentation
Show all versions of pubnub-gson-impl Show documentation
PubNub is a cross-platform client-to-client (1:1 and 1:many) push service in the cloud, capable of broadcasting real-time messages to millions of web and mobile clients simultaneously, in less than a quarter second!
package com.pubnub.internal.endpoints
import com.pubnub.api.endpoints.Endpoint
import com.pubnub.api.endpoints.remoteaction.ExtendedRemoteAction
import com.pubnub.api.v2.PNConfiguration
import com.pubnub.internal.EndpointInterface
import com.pubnub.internal.PubNubCore
abstract class DelegatingEndpoint(pubnub: PubNubCore) : DelegatingRemoteAction(pubnub), Endpoint {
override val remoteAction: ExtendedRemoteAction by lazy {
val newAction = createAction()
overrideConfiguration?.let { overrideConfigNonNull ->
newAction.overrideConfiguration(overrideConfigNonNull)
}
mapResult(newAction)
}
private var overrideConfiguration: PNConfiguration? = null
override fun overrideConfiguration(configuration: PNConfiguration): Endpoint {
this.overrideConfiguration = configuration
return this
}
abstract override fun createAction(): EndpointInterface
}
abstract class IdentityMappingEndpoint(pubnub: PubNubCore) : DelegatingEndpoint(pubnub) {
final override fun mapResult(action: ExtendedRemoteAction): ExtendedRemoteAction {
return action
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy