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.FirewallRule;

import java.util.List;

/**
 * 防火墙规则service接口
 *
 * @author wangyu
 * @version 1.0
 * @since 2017年8月31日
 */
public interface FirewallRuleService {


    /**
     * 查询防火墙规则列表
     *
     * @param pager
     * @param context
     * @return
     */
    BocloudResult<GridBean<FirewallRule>> list(Pager pager, RequestContext context);

    BocloudResult condition(String condition, RequestContext context);

    /**
     * 创建防火墙规则
     *
     * @param rule
     * @param context
     * @return
     */
    BocloudResult<FirewallRule> create(FirewallRule rule, RequestContext context);

    /**
     * 修改防火墙规则
     *
     * @param bean
     * @param userId
     * @return
     */
    BocloudResult<FirewallRule> modify(FirewallRule bean, Long userId);

    /**
     * 查询防火墙规则信息
     *
     * @param id
     * @return
     */
    BocloudResult<FirewallRule> detail(Long id);

    /**
     * 删除防火墙规则
     *
     * @param id
     * @param context
     * @return
     */
    BocloudResult remove(Long id, RequestContext context);

    /**
     * 查询云平台所有未绑定防火墙策略的规则
     *
     * @param vendorId
     * @param context
     * @return
     */
    BocloudResult<List<FirewallRule>> listRuleByNoBoundPolicy(Long vendorId, RequestContext context);

    /**
     * 查询policyId绑定的规则
     *
     * @param policyId
     * @return
     */
    BocloudResult<List<FirewallRule>> listRuleByPolicyId(Long policyId);

    /**
     * 批量删除
     *
     * @param params
     * @param context
     * @return
     */
    BocloudResult batchRemove(List<Long> idArray, RequestContext context);
}
