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

com.github.dreamhead.moco.handler.failover.FailoverExecutor Maven / Gradle / Ivy

Go to download

Moco is an easy setup stub framework, mainly focusing on testing and integration.

There is a newer version: 1.5.0
Show newest version
package com.github.dreamhead.moco.handler.failover;

import com.github.dreamhead.moco.HttpRequest;
import com.github.dreamhead.moco.HttpResponse;
import com.github.dreamhead.moco.MocoException;

public interface FailoverExecutor {
    void onCompleteResponse(HttpRequest request, HttpResponse response);
    HttpResponse failover(HttpRequest request);

    FailoverExecutor EMPTY_FAILOVER = new FailoverExecutor() {
        @Override
        public void onCompleteResponse(final HttpRequest request, final HttpResponse response) {
        }

        @Override
        public HttpResponse failover(final HttpRequest request) {
            throw new MocoException("no failover response found");
        }
    };
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy