org.zodiac.sentinel.base.datasource.converter.SentinelDataSourceConverter Maven / Gradle / Ivy
package org.zodiac.sentinel.base.datasource.converter;
import java.io.IOException;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Optional;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.zodiac.commons.util.Colls;
import org.zodiac.commons.util.lang.Strings;
import com.alibaba.csp.sentinel.datasource.Converter;
import com.alibaba.csp.sentinel.slots.block.authority.AuthorityRule;
import com.alibaba.csp.sentinel.slots.block.degrade.DegradeRule;
import com.alibaba.csp.sentinel.slots.block.flow.FlowRule;
import com.alibaba.csp.sentinel.slots.block.flow.param.ParamFlowRule;
import com.alibaba.csp.sentinel.slots.system.SystemRule;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
public abstract class SentinelDataSourceConverter implements Converter> {
private static final Logger LOG = LoggerFactory.getLogger(SentinelDataSourceConverter.class);
private final ObjectMapper objectMapper;
private final Class ruleClass;
public SentinelDataSourceConverter(ObjectMapper objectMapper, Class ruleClass) {
this.objectMapper = objectMapper;
this.ruleClass = ruleClass;
}
@Override
public Collection