package be.iminds.ilabt.jfed.highlevel.jobs;

import be.iminds.ilabt.jfed.lowlevel.JFedException;
import be.iminds.ilabt.jfed.lowlevel.api.AbstractGeniAggregateManager;
import be.iminds.ilabt.jfed.fedmon.webapi.service.json.*;
import be.iminds.ilabt.jfed.lowlevel.stitching.StitchingDirector;

import javax.annotation.Nullable;
import java.util.List;

/**
 * User: twalcari
 * Date: 1/27/2016
 * Time: 10:59
 */
interface AllocationDirector {

    void reportGiveUp();

    boolean isGaveUp();

    boolean areAnyActionsLeft();

    List<StitchingDirector.StitchAction> getStitchActions();

    StitchingDirector.AllocateVerdict processAllocateResult(StitchingDirector.StitchAction stitchAction,
                                                            AbstractGeniAggregateManager.AggregateManagerReply reply) throws JFedException;

    void processListResourcesResult(Server auth, @Nullable String advertisementRspec);

    void processDeleteResult(Server auth) throws JFedException;

    StitchingDirector.AllocateVerdict reportReadyForRetry(Server auth);
}
