org.zodiac.sentinel.base.datasource.model.DataSourceInfo Maven / Gradle / Ivy
package org.zodiac.sentinel.base.datasource.model;
import org.springframework.core.Ordered;
import org.springframework.core.env.Environment;
import org.zodiac.sentinel.base.datasource.DataSourceType;
import org.zodiac.sentinel.base.model.SentinelRule;
import com.alibaba.csp.sentinel.datasource.AbstractDataSource;
public interface DataSourceInfo extends Comparable, Ordered {
DataSourceType getDataSourceType();
String getDataType();
SentinelRule getRule();
String getConverterClass();
String getFactoryBeanName();
Environment getEnvironment();
DataSourceInfo setEnvironment(Environment environment);
DataSourceInfo preCheck(String dataSourceName);
DataSourceInfo postRegister(AbstractDataSource dataSource);
@Override
default int compareTo(DataSourceInfo o) {
return this.getOrder() - o.getOrder();
}
@Override
default int getOrder() {
return Ordered.LOWEST_PRECEDENCE;
}
int hashCode();
boolean equals(Object obj);
String toString();
}