public AbstractSerializingAsyncCacheStorage(final int maxUpdateRetries, final HttpCacheEntrySerializer<T> serializer) { this.maxUpdateRetries = Args.notNegative(maxUpdateRetries, "Max retries"); this.serializer = Args.notNull(serializer, "Cache entry serializer"); }
public AbstractSerializingCacheStorage(final int maxUpdateRetries, final HttpCacheEntrySerializer<T> serializer) { this.maxUpdateRetries = Args.notNegative(maxUpdateRetries, "Max retries"); this.serializer = Args.notNull(serializer, "Cache entry serializer"); }
public ExponentialBackOffSchedulingStrategy( final long backOffRate, final TimeValue initialExpiry, final TimeValue maxExpiry) { this.backOffRate = Args.notNegative(backOffRate, "BackOff rate"); this.initialExpiry = Args.notNull(initialExpiry, "Initial expiry"); this.maxExpiry = Args.notNull(maxExpiry, "Max expiry"); }
public LengthDelimitedDecoder( final ReadableByteChannel channel, final SessionInputBuffer buffer, final BasicHttpTransportMetrics metrics, final long contentLength) { super(channel, buffer, metrics); Args.notNegative(contentLength, "Content length"); this.contentLength = contentLength; }
/** * Creates an instance of {@link ByteArrayBuffer} with the given initial * capacity. * * @param capacity the capacity */ public ByteArrayBuffer(final int capacity) { super(); Args.notNegative(capacity, "Buffer capacity"); this.array = new byte[capacity]; }
/** * Creates an instance of {@link CharArrayBuffer} with the given initial * capacity. * * @param capacity the capacity */ public CharArrayBuffer(final int capacity) { super(); Args.notNegative(capacity, "Buffer capacity"); this.array = new char[capacity]; }
/** * Creates an instance of {@link ByteArrayBuffer} with the given initial * capacity. * * @param capacity the capacity */ public ByteArrayBuffer(final int capacity) { super(); Args.notNegative(capacity, "Buffer capacity"); this.array = new byte[capacity]; }
public LengthDelimitedDecoder( final ReadableByteChannel channel, final SessionInputBuffer buffer, final BasicHttpTransportMetrics metrics, final long contentLength) { super(channel, buffer, metrics); Args.notNegative(contentLength, "Content length"); this.contentLength = contentLength; }
/** * Creates an instance of {@link CharArrayBuffer} with the given initial * capacity. * * @param capacity the capacity */ public CharArrayBuffer(final int capacity) { super(); Args.notNegative(capacity, "Buffer capacity"); this.array = new char[capacity]; }
public Builder setHeaderTableSize(final int headerTableSize) { Args.notNegative(headerTableSize, "Header table size"); this.headerTableSize = headerTableSize; return this; }
/** * Create a protocol version designator. * * @param protocol the name of the protocol, for example "HTTP" * @param major the major version number of the protocol * @param minor the minor version number of the protocol */ public ProtocolVersion(final String protocol, final int major, final int minor) { this.protocol = Args.notNull(protocol, "Protocol name"); this.major = Args.notNegative(major, "Protocol minor version"); this.minor = Args.notNegative(minor, "Protocol minor version"); }
/** * Create a protocol version designator. * * @param protocol the name of the protocol, for example "HTTP" * @param major the major version number of the protocol * @param minor the minor version number of the protocol */ public ProtocolVersion(final String protocol, final int major, final int minor) { this.protocol = Args.notNull(protocol, "Protocol name"); this.major = Args.notNegative(major, "Protocol minor version"); this.minor = Args.notNegative(minor, "Protocol minor version"); }
public H2Setting(final H2Param param, final int value) { Args.notNull(param, "Setting parameter"); Args.notNegative(value, "Setting value must be a non-negative value"); this.param = param; this.value = value; }
public void setMaxTableSize(final int maxTableSize) { Args.notNegative(maxTableSize, "Max table size"); this.maxTableSize = maxTableSize; this.dynamicTable.setMaxSize(maxTableSize); }
public void setMaxTableSize(final int maxTableSize) { Args.notNegative(maxTableSize, "Max table size"); this.maxTableSize = maxTableSize; this.dynamicTable.setMaxSize(maxTableSize); }
public AbstractSerializingCacheStorage(final int maxUpdateRetries, final HttpCacheEntrySerializer<T> serializer) { this.maxUpdateRetries = Args.notNegative(maxUpdateRetries, "Max retries"); this.serializer = Args.notNull(serializer, "Cache entry serializer"); }
public RawFrame createGoAway(final int lastStream, final H2Error error, final String message) { Args.notNegative(lastStream, "Last stream id"); final byte[] debugData = message != null ? message.getBytes(StandardCharsets.US_ASCII) : null; final ByteBuffer payload = ByteBuffer.allocate(8 + (debugData != null ? debugData.length : 0)); payload.putInt(lastStream); payload.putInt(error.getCode()); if (debugData != null) { payload.put(debugData); } payload.flip(); return new RawFrame(FrameType.GOAWAY.getValue(), 0, 0, payload); }
@Override public final HttpHost getHopTarget(final int hop) { Args.notNegative(hop, "Hop index"); final int hopcount = getHopCount(); Args.check(hop < hopcount, "Hop index exceeds tracked route length"); if (hop < hopcount - 1) { return this.proxyChain.get(hop); } else { return this.targetHost; } }
public RawFrame createWindowUpdate(final int streamId, final int increment) { Args.notNegative(streamId, "Stream id"); Args.positive(increment, "Increment"); final ByteBuffer payload = ByteBuffer.allocate(4); payload.putInt(increment); payload.flip(); return new RawFrame(FrameType.WINDOW_UPDATE.getValue(), 0, streamId, payload); }
public ExponentialBackOffSchedulingStrategy( final long backOffRate, final TimeValue initialExpiry, final TimeValue maxExpiry) { this.backOffRate = Args.notNegative(backOffRate, "BackOff rate"); this.initialExpiry = Args.notNull(initialExpiry, "Initial expiry"); this.maxExpiry = Args.notNull(maxExpiry, "Max expiry"); }