All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.continual.jsonHttpClient.ResponseCache Maven / Gradle / Ivy

There is a newer version: 0.3.16
Show newest version
package io.continual.jsonHttpClient;

import io.continual.jsonHttpClient.JsonOverHttpClient.HttpResponse;

/**
 * An abstracted cache for HTTP response data
 */
public interface ResponseCache
{
	/**
	 * Close this cache
	 */
	default void close () {}

	/**
	 * Return a cached response if it exists, or null
	 * @param path
	 * @return a response or null
	 */
	HttpResponse get ( String path );

	/**
	 * Put the given request into the cache at the given path.
	 * @param path
	 * @param response
	 */
	void put ( String path, HttpResponse response );

	/**
	 * Remove a cached response with the given path if it exists
	 * @param path
	 */
	void remove ( String path );
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy