package com.bocloud.ims.interfaces.resource;

import com.bocloud.common.model.BocloudResult;
import com.bocloud.common.model.GridBean;
import com.bocloud.common.model.Pager;
import com.bocloud.common.model.RequestContext;
import com.bocloud.ims.entity.resource.FlashCopy;

import java.util.List;
import java.util.Map;

/**
 * @author luyanchao
 */
public interface FlashCopyService {

    /**
     * 列表展示
     *
     * @param pager
     * @param volumeId
     * @return
     */
    BocloudResult<GridBean<FlashCopy>> list(Pager pager, Long volumeId);

    /**
     * 根据原卷查询可以和该原卷做FlashCopy的目标卷
     *
     * @param volumeId
     * @return
     */
    BocloudResult listTargetVolumeFromDriver(long volumeId);

    /**
     * 根据原卷查询可以和该原卷做FlashCopy的目标卷
     *
     * @param page
     * @param rows
     * @param volumeId
     * @param params
     * @return
     */
    BocloudResult<GridBean> listTargetVolumeFromDB(int page, int rows, long volumeId, Map<String, Object> params,
                                                   Map<String, String> sorter);

    /**
     * 创建
     *
     * @param flashCopy
     * @param context
     * @return
     */
    BocloudResult create(FlashCopy flashCopy, RequestContext context);

    /**
     * 修改
     *
     * @param flashCopy
     * @param context
     * @return
     */
    BocloudResult modify(FlashCopy flashCopy, RequestContext context);

    /**
     * 删除
     *
     * @param id
     * @param context
     * @return
     */
    BocloudResult remove(long id, boolean force, RequestContext context);

    /**
     * 启动
     *
     * @param id
     * @param context
     * @return
     */
    BocloudResult start(long id, RequestContext context);

    /**
     * 停止
     *
     * @param id
     * @param context
     * @return
     */
    BocloudResult stop(long id, RequestContext context);

    /**
     * 详情
     *
     * @param id
     * @return
     */
    BocloudResult<FlashCopy> detail(long id);

    /**
     * flashcopy移入一致性组
     *
     * @param id
     * @param groupId
     * @param context
     * @return
     */
    BocloudResult moveIn(long id, long groupId, RequestContext context);

    /**
     * flashcopy移出一致性组
     *
     * @param id
     * @param context
     * @return
     */
    BocloudResult moveOut(long id, RequestContext context);
}
