/** * Strategy to determine an execution time (schedule) for an operation. * * @since 5.0 */ @Contract(threading = ThreadingBehavior.STATELESS) public interface SchedulingStrategy { /** * Schedules execution time for an operation. */ TimeValue schedule(int attemptNumber); }
/** * {@link AuthSchemeProvider} implementation that creates and initializes * {@link WindowsNegotiateScheme} using JNA to implement NTLM * * @since 4.4 */ @Contract(threading = ThreadingBehavior.STATELESS) @Experimental public class WindowsNTLMSchemeFactory implements AuthSchemeProvider { private final String servicePrincipalName; public WindowsNTLMSchemeFactory(final String servicePrincipalName) { super(); this.servicePrincipalName = servicePrincipalName; } @Override public AuthScheme create(final HttpContext context) { return new WindowsNegotiateScheme(AuthSchemes.NTLM.ident, servicePrincipalName); } }
@Internal public interface HttpAsyncCacheInvalidator {
/** * Immediately schedules any operation. * * @since 5.0 */ @Contract(threading = ThreadingBehavior.STATELESS) public class ImmediateSchedulingStrategy implements SchedulingStrategy { public final static ImmediateSchedulingStrategy INSTANCE = new ImmediateSchedulingStrategy(); @Override public TimeValue schedule(final int attemptNumber) { return TimeValue.ZERO_MILLISECONDS; } }
/** * {@link AuthSchemeProvider} implementation that creates and initializes * {@link WindowsNegotiateScheme} using JNA to Negotiate credentials * * @since 4.4 */ @Contract(threading = ThreadingBehavior.STATELESS) @Experimental public class WindowsNegotiateSchemeFactory implements AuthSchemeProvider { private final String servicePrincipalName; public WindowsNegotiateSchemeFactory(final String servicePrincipalName) { super(); this.servicePrincipalName = servicePrincipalName; } @Override public AuthScheme create(final HttpContext context) { return new WindowsNegotiateScheme(AuthSchemes.SPNEGO.ident, servicePrincipalName); } }
/** * Atomic Compare-And-Swap (CAS) cache operation. * * @since 5.0 */ @Contract(threading = ThreadingBehavior.STATELESS) public interface HttpCacheCASOperation { /** * Returns the new cache entry that should replace an existing one. * * @param existing * the cache entry currently in-place in the cache, possibly * {@code null} if nonexistent * @return the cache entry that should replace it, again, * possibly {@code null} if the entry should be deleted */ HttpCacheEntry execute(HttpCacheEntry existing) throws ResourceIOException; }
/** * {@link HttpCacheEntrySerializer} that uses {@link HttpCacheStorageEntry} * as its cache content representation. * * @since 5.0 */ @Contract(threading = ThreadingBehavior.STATELESS) public class NoopCacheEntrySerializer implements HttpCacheEntrySerializer<HttpCacheStorageEntry> { public static final NoopCacheEntrySerializer INSTANCE = new NoopCacheEntrySerializer(); @Override public HttpCacheStorageEntry serialize(final HttpCacheStorageEntry cacheEntry) throws ResourceIOException { return cacheEntry; } @Override public HttpCacheStorageEntry deserialize(final HttpCacheStorageEntry cacheEntry) throws ResourceIOException { return cacheEntry; } }
/** * Serializer / deserializer for {@link HttpCacheStorageEntry} entries. * * @since 5.0 */ @Contract(threading = ThreadingBehavior.STATELESS) public interface HttpCacheEntrySerializer<T> { /** * Serializes the given entry. * * @param entry cache entry * @return serialized representation of the cache entry * @throws ResourceIOException */ T serialize(HttpCacheStorageEntry entry) throws ResourceIOException; /** * Deserializes a cache entry from its serialized representation. * @param serializedObject serialized representation of the cache entry * @return cache entry * @throws ResourceIOException */ HttpCacheStorageEntry deserialize(T serializedObject) throws ResourceIOException; }
@Contract(threading = ThreadingBehavior.IMMUTABLE) public final class HttpCacheStorageEntry implements Serializable {
@Contract(threading = ThreadingBehavior.STATELESS) public class HeapResourceFactory implements ResourceFactory {
@Contract(threading = ThreadingBehavior.SAFE) public final class ConcurrentCountMap<T> {
@Contract(threading = ThreadingBehavior.STATELESS) public final class ByteArrayCacheEntrySerializer implements HttpCacheEntrySerializer<byte[]> {
@Contract(threading = ThreadingBehavior.IMMUTABLE) public class HeapResource extends Resource {
@Contract(threading = ThreadingBehavior.SAFE) public abstract class Resource implements Serializable {
@Contract(threading = ThreadingBehavior.STATELESS) public interface ResourceFactory {
@Contract(threading = ThreadingBehavior.SAFE) public interface HttpCacheStorage {
@Contract(threading = ThreadingBehavior.SAFE) public class FileResource extends Resource {
@Contract(threading = ThreadingBehavior.SAFE) public interface HttpAsyncCacheStorage {
@Contract(threading = ThreadingBehavior.STATELESS) public class ExponentialBackOffSchedulingStrategy implements SchedulingStrategy {