public class GelfTCPSSLSender extends GelfTCPSender
GelfSender
.CONNECTION_TIMEOUT, KEEPALIVE, MAX_WRITE_BACKOFF_TIME, READ_TIMEOUT, RETRIES, WRITE_BACKOFF_THRESHOLD, WRITE_BACKOFF_TIME
INITIAL_BUFFER_SIZE, PROPERTY_BUFFER_SIZE
Constructor and Description |
---|
GelfTCPSSLSender(String host,
int port,
int connectTimeoutMs,
int readTimeoutMs,
int deliveryAttempts,
boolean keepAlive,
biz.paluch.logging.gelf.intern.sender.BackOff backoff,
int writeBackoffThreshold,
ErrorReporter errorReporter,
SSLContext sslContext) |
GelfTCPSSLSender(String host,
int port,
int connectTimeoutMs,
int readTimeoutMs,
int deliveryAttempts,
boolean keepAlive,
ErrorReporter errorReporter,
SSLContext sslContext) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the sender and free resources.
|
protected boolean |
connect() |
protected boolean |
isConnected() |
protected boolean |
isConnected(SocketChannel channel) |
protected void |
write(ByteBuffer gelfBuffer) |
createSocketChannel, sendMessage
channel, getHost, getPort, isShutdown, reportError, setChannel
public GelfTCPSSLSender(String host, int port, int connectTimeoutMs, int readTimeoutMs, int deliveryAttempts, boolean keepAlive, ErrorReporter errorReporter, SSLContext sslContext) throws IOException
host
- the host, must not be null.port
- the port.connectTimeoutMs
- connection timeout, in TimeUnit.MILLISECONDS
.readTimeoutMs
- read timeout, in TimeUnit.MILLISECONDS
.deliveryAttempts
- number of delivery attempts.keepAlive
- true to enable TCP keep-alive.errorReporter
- the error reporter, must not be null.sslContext
- the SSL context, must not be null.IOException
- in case of I/O errorspublic GelfTCPSSLSender(String host, int port, int connectTimeoutMs, int readTimeoutMs, int deliveryAttempts, boolean keepAlive, biz.paluch.logging.gelf.intern.sender.BackOff backoff, int writeBackoffThreshold, ErrorReporter errorReporter, SSLContext sslContext) throws IOException
host
- the host, must not be null.port
- the port.connectTimeoutMs
- connection timeout, in TimeUnit.MILLISECONDS
.readTimeoutMs
- read timeout, in TimeUnit.MILLISECONDS
.deliveryAttempts
- number of delivery attempts.keepAlive
- true to enable TCP keep-alive.backoff
- Backoff strategy to activate if a socket sender buffer is full and several attempts to write to the socket
are unsuccessful due to it.writeBackoffThreshold
- attempts to write to a socket before a backoff will be activated.errorReporter
- the error reporter, must not be null.sslContext
- the SSL context, must not be null.IOException
- in case of I/O errorsprotected boolean connect() throws IOException
connect
in class GelfTCPSender
IOException
protected boolean isConnected() throws IOException
isConnected
in class AbstractNioSender<SocketChannel>
IOException
protected void write(ByteBuffer gelfBuffer) throws IOException
write
in class GelfTCPSender
IOException
public void close()
GelfSender
close
in interface GelfSender
close
in interface Closeable
close
in interface AutoCloseable
close
in class AbstractNioSender<SocketChannel>
protected boolean isConnected(SocketChannel channel)
isConnected
in class GelfTCPSender
Copyright © 2013–2023. All rights reserved.