Package co.freeside.betamax.message

Examples of co.freeside.betamax.message.Response


import static org.apache.http.HttpHeaders.VIA;

public class ViaSettingHandler extends ChainedHttpHandler {
    @Override
    public Response handle(Request request) {
        Response response = chain(request);
        response.addHeader(VIA, VIA_HEADER);
        return response;
    }
View Full Code Here


import co.freeside.betamax.message.filtering.HeaderFilteringResponse;

public class HeaderFilter extends ChainedHttpHandler {
    public Response handle(Request request) {
        HeaderFilteringRequest filteredRequest = new HeaderFilteringRequest(request);
        Response response = chain(filteredRequest);
        return new HeaderFilteringResponse(response);
    }
View Full Code Here

    private Optional<? extends FullHttpResponse> onRequestIntercepted() throws IOException {
        if (tape == null) {
            return Optional.of(new DefaultFullHttpResponse(HTTP_1_1, new HttpResponseStatus(403, "No tape")));
        } else if (tape.isReadable() && tape.seek(request)) {
            LOG.warning(String.format("Playing back from tape %s", tape.getName()));
            Response recordedResponse = tape.play(request);
            FullHttpResponse response = playRecordedResponse(recordedResponse);
            setViaHeader(response);
            setBetamaxHeader(response, "PLAY");
            return Optional.of(response);
        } else {
View Full Code Here

TOP

Related Classes of co.freeside.betamax.message.Response

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.