public final class TransmissionNetworkOutput extends java.lang.Object implements TransmissionOutput
Transmission
The class uses Apache's HttpClient framework for that.
Created by gupele on 12/18/2014.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_SERVER_URI |
Modifier and Type | Method and Description |
---|---|
static TransmissionNetworkOutput |
create(java.lang.String endpoint,
TransmissionPolicyManager transmissionPolicyManager)
Deprecated.
|
static TransmissionNetworkOutput |
create(TelemetryConfiguration configuration,
TransmissionPolicyManager transmissionPolicyManager) |
static TransmissionNetworkOutput |
create(TransmissionPolicyManager transmissionPolicyManager)
Deprecated.
|
boolean |
send(Transmission transmission)
Tries to send a
Transmission
The thread that calls that method might be suspended if there is a throttling
issues, in any case the thread that enters this method is responsive for
'stop' request that might be issued by the application. |
void |
setTransmissionDispatcher(TransmissionDispatcher transmissionDispatcher)
Used to inject the dispatcher used for this output so it can be injected to the retry logic.
|
void |
stop(long timeout,
java.util.concurrent.TimeUnit timeUnit)
Stops all threads from sending data.
|
public static final java.lang.String DEFAULT_SERVER_URI
@Deprecated public static TransmissionNetworkOutput create(TransmissionPolicyManager transmissionPolicyManager)
create(TelemetryConfiguration, TransmissionPolicyManager)
transmissionPolicyManager
- The transmission policy used to mark this sender active or blocked.@Deprecated public static TransmissionNetworkOutput create(@Nullable java.lang.String endpoint, TransmissionPolicyManager transmissionPolicyManager)
create(TelemetryConfiguration, TransmissionPolicyManager)
endpoint
- The HTTP endpoint to send our telemetry too.transmissionPolicyManager
- The transmission policy used to mark this sender active or blocked.public static TransmissionNetworkOutput create(TelemetryConfiguration configuration, TransmissionPolicyManager transmissionPolicyManager)
public void setTransmissionDispatcher(TransmissionDispatcher transmissionDispatcher)
transmissionDispatcher
- The dispatcher to be injected.public void stop(long timeout, java.util.concurrent.TimeUnit timeUnit)
stop
in interface TransmissionOutput
timeout
- The timeout to wait, which is not relevant here.timeUnit
- The time unit, which is not relevant in this method.public boolean send(Transmission transmission)
Transmission
The thread that calls that method might be suspended if there is a throttling
issues, in any case the thread that enters this method is responsive for
'stop' request that might be issued by the application.send
in interface TransmissionOutput
transmission
- The data to send