package com.xisc.pm.app.service.strategy.pdrule;

import java.util.concurrent.TimeUnit;

import org.springframework.beans.factory.InitializingBean;

import com.github.benmanes.caffeine.cache.Cache;
import com.github.benmanes.caffeine.cache.Caffeine;
import com.xisc.pm.api.dto.RuleParamDTO;

/**
 * 规则库执行接口
 * 
 * @author jun.zeng
 *
 */
public interface RuleExecStrategy extends InitializingBean {
    
    // 创建缓存，最大容量200，过期时间5分钟
    public final static Cache<String, String> CACHE = Caffeine.newBuilder()
            .maximumSize(200)
            .expireAfterWrite(1, TimeUnit.MINUTES)
            .build();

    /**
     * 执行规则库
     * 
     * @param tenantId
     * @param request
     */
    boolean execRule(RuleParamDTO ruleParam);
    
}
