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

se.gawell.fakeriak.servlet.FakeRiakServlet Maven / Gradle / Ivy

The newest version!
package se.gawell.fakeriak.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import se.gawell.fakeriak.buckets.Buckets;
import se.gawell.fakeriak.buckets.InMemoryBuckets;
import se.gawell.fakeriak.index.InMemoryIndexes;
import se.gawell.fakeriak.index.Indexes;

public class FakeRiakServlet extends HttpServlet {

	private Buckets buckets = new InMemoryBuckets();
	private Indexes indexes = new InMemoryIndexes();
	private GetHandler getHandler = new InMemoryGetHandler(buckets, indexes);
	private PutHandler putHandler = new inMemoryPutHandler(buckets, indexes);
	private PostHandler postHandler = new InMemoryPostHandler(buckets, indexes);
	private DeleteHandler deleteHandler = new InMemoryDeleteHandler(buckets, indexes);

	@Override
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		getHandler.handle(request, response);
	}

	@Override
	protected void doPut(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		putHandler.handle(request, response);
	}

	@Override
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException,
			IOException {
		postHandler.handle(request, response);
	}

	@Override
	protected void doDelete(HttpServletRequest request, HttpServletResponse response) throws ServletException,
			IOException {
		deleteHandler.handle(request, response);
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy