/** * Copy constructor * * @param other the options to copy */ public ClientOptionsBase(ClientOptionsBase other) { super(other); this.connectTimeout = other.getConnectTimeout(); this.trustAll = other.isTrustAll(); this.metricsName = other.metricsName; this.proxyOptions = other.proxyOptions != null ? new ProxyOptions(other.proxyOptions) : null; this.localAddress = other.localAddress; }
static void toJson(ClientOptionsBase obj, java.util.Map<String, Object> json) { json.put("connectTimeout", obj.getConnectTimeout()); if (obj.getLocalAddress() != null) { json.put("localAddress", obj.getLocalAddress()); } if (obj.getMetricsName() != null) { json.put("metricsName", obj.getMetricsName()); } if (obj.getProxyOptions() != null) { json.put("proxyOptions", obj.getProxyOptions().toJson()); } json.put("trustAll", obj.isTrustAll()); } }
public void configure(ClientOptionsBase options, boolean domainSocket, Bootstrap bootstrap) { if (!domainSocket) { bootstrap.option(ChannelOption.SO_REUSEADDR, options.isReuseAddress()); bootstrap.option(ChannelOption.TCP_NODELAY, options.isTcpNoDelay()); bootstrap.option(ChannelOption.SO_KEEPALIVE, options.isTcpKeepAlive()); } if (options.getLocalAddress() != null) { bootstrap.localAddress(options.getLocalAddress(), 0); } if (options.getSendBufferSize() != -1) { bootstrap.option(ChannelOption.SO_SNDBUF, options.getSendBufferSize()); } if (options.getReceiveBufferSize() != -1) { bootstrap.option(ChannelOption.SO_RCVBUF, options.getReceiveBufferSize()); bootstrap.option(ChannelOption.RCVBUF_ALLOCATOR, new FixedRecvByteBufAllocator(options.getReceiveBufferSize())); } if (options.getSoLinger() != -1) { bootstrap.option(ChannelOption.SO_LINGER, options.getSoLinger()); } if (options.getTrafficClass() != -1) { bootstrap.option(ChannelOption.IP_TOS, options.getTrafficClass()); } bootstrap.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, options.getConnectTimeout()); bootstrap.option(ChannelOption.ALLOCATOR, PartialPooledByteBufAllocator.INSTANCE); }
/** * Copy constructor * * @param other the options to copy */ public ClientOptionsBase(ClientOptionsBase other) { super(other); this.connectTimeout = other.getConnectTimeout(); this.trustAll = other.isTrustAll(); this.metricsName = other.metricsName; this.proxyOptions = other.proxyOptions != null ? new ProxyOptions(other.proxyOptions) : null; this.localAddress = other.localAddress; }
static void toJson(ClientOptionsBase obj, java.util.Map<String, Object> json) { json.put("connectTimeout", obj.getConnectTimeout()); if (obj.getLocalAddress() != null) { json.put("localAddress", obj.getLocalAddress()); } if (obj.getMetricsName() != null) { json.put("metricsName", obj.getMetricsName()); } if (obj.getProxyOptions() != null) { json.put("proxyOptions", obj.getProxyOptions().toJson()); } json.put("trustAll", obj.isTrustAll()); } }
public void configure(ClientOptionsBase options, boolean domainSocket, Bootstrap bootstrap) { if (!domainSocket) { bootstrap.option(ChannelOption.SO_REUSEADDR, options.isReuseAddress()); bootstrap.option(ChannelOption.TCP_NODELAY, options.isTcpNoDelay()); bootstrap.option(ChannelOption.SO_KEEPALIVE, options.isTcpKeepAlive()); } if (options.getLocalAddress() != null) { bootstrap.localAddress(options.getLocalAddress(), 0); } if (options.getSendBufferSize() != -1) { bootstrap.option(ChannelOption.SO_SNDBUF, options.getSendBufferSize()); } if (options.getReceiveBufferSize() != -1) { bootstrap.option(ChannelOption.SO_RCVBUF, options.getReceiveBufferSize()); bootstrap.option(ChannelOption.RCVBUF_ALLOCATOR, new FixedRecvByteBufAllocator(options.getReceiveBufferSize())); } if (options.getSoLinger() != -1) { bootstrap.option(ChannelOption.SO_LINGER, options.getSoLinger()); } if (options.getTrafficClass() != -1) { bootstrap.option(ChannelOption.IP_TOS, options.getTrafficClass()); } bootstrap.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, options.getConnectTimeout()); bootstrap.option(ChannelOption.ALLOCATOR, PartialPooledByteBufAllocator.INSTANCE); }