package ru.yandex.webmaster3.viewer.http.mirrors.generations;

import ru.yandex.autodoc.common.doc.annotation.Description;
import ru.yandex.webmaster3.core.http.Action;
import ru.yandex.webmaster3.core.http.ActionRequest;
import ru.yandex.webmaster3.core.http.ActionStatus;
import ru.yandex.webmaster3.core.http.InternalAction;
import ru.yandex.webmaster3.core.http.WriteAction;
import ru.yandex.webmaster3.core.http.mirrors.SwitchMirrorGenerationsResponse;
import ru.yandex.webmaster3.core.metrics.Category;

/**
 * @author tsyplyaev
 */
@WriteAction
@Category("internal")
@InternalAction
@Description("Обновить поколение")
public class SwitchMirrorGenerationsAction extends Action<SwitchMirrorGenerationsAction.Request, SwitchMirrorGenerationsResponse> {
    @Override
    public SwitchMirrorGenerationsResponse process(Request request) {
        try {
            //mirrorGenerationService.switchGenerations();
        } catch (Exception ex) {
            return new SwitchMirrorGenerationsResponse(ActionStatus.FAIL);
        }
        return new SwitchMirrorGenerationsResponse(ActionStatus.SUCCESS);
    }

    public static class Request implements ActionRequest {
    }
}
