package com.bocloud.ims.interfaces.resource.hmc;

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.hmc.HmcVirtualFibreChannelMapping;

import java.util.List;

/**
 * 虚拟光纤通道service
 * @author luyanchao
 * @since 2018/12/18 17:17
 */
public interface HmcVirtualFibreChannelMappingService {

    /**
     * 增加vmc映射
     * @param viosId 数据库中vios的id
     * @param viosSlot vios插槽号
     * @param partitionId 数据库中逻辑分区id
     * @param partitionSlot 逻辑分区插槽号
     * @param fcId 物理光纤通道id
     */
    public BocloudResult create(long viosId, Integer viosSlot, boolean viosRequired, long partitionId, Integer partitionSlot, long fcId, RequestContext context);
    public BocloudResult create(long viosId, Integer viosSlot, boolean viosRequired, long partitionId, Integer partitionSlot, long fcId, RequestContext context, boolean sendMsgWhenSucceed);

    /**
     * 删除vmc映射
     * @param id 映射id
     * @return
     */
    public BocloudResult remove(long id, RequestContext context);
    public BocloudResult remove(long id, RequestContext context, boolean sendMsgWhenSuccess);

    /**
     * 查询vfc映射列表
     * @param pager
     * @return
     */
    public BocloudResult<GridBean<HmcVirtualFibreChannelMapping>> list(Pager pager);

    /**
     * 按viosId查询所有vfc映射
     *
     * @param viosId viosId
     * @return 查询结果集
     */
    public BocloudResult<List<HmcVirtualFibreChannelMapping>> listByVios(long viosId);


    // 2019-08-15 : 去掉自动获取槽号的相关功能，这个接口不需要了。暂时屏蔽。 详见PBSM-5039
    /**
     * 查询vois中已经配置了但在lpar中尚未配置的vfc映射。</br>
     * 如果不存在就直接返回vios和lpar的空闲的槽号
     *
     * @param viosId      viosId
     * @param partitionId partitionId
     * @return 查询结果集
     */
    //public BocloudResult listByViosAndPartition(long viosId, long partitionId, List<Integer> slots);

}
