public abstract class WallProvider extends Object
| 限定符和类型 | 类和说明 |
|---|---|
static class |
WallProvider.WallCommentHandler |
| 限定符和类型 | 字段和说明 |
|---|---|
private Map<String,Object> |
attributes |
private LRUCache<String,WallSqlStat> |
blackList |
private boolean |
blackListEnable |
protected AtomicLong |
blackListHitCount |
private LRUCache<String,WallSqlStat> |
blackMergedList |
private int |
blackSqlMaxSize |
protected AtomicLong |
checkCount |
WallDenyStat |
commentDeniedStat |
protected WallConfig |
config |
protected String |
dbType |
private ConcurrentMap<String,WallFunctionStat> |
functionStats |
protected AtomicLong |
hardCheckCount |
private ReentrantReadWriteLock |
lock |
private int |
MAX_SQL_LENGTH |
private String |
name |
private static ThreadLocal<Boolean> |
privileged |
protected AtomicLong |
syntaxErrorCount |
private ConcurrentMap<String,WallTableStat> |
tableStats |
private static ThreadLocal<Object> |
tenantValueLocal |
protected AtomicLong |
violationCount |
protected AtomicLong |
violationEffectRowCount |
private LRUCache<String,WallSqlStat> |
whiteList |
private boolean |
whiteListEnable |
protected AtomicLong |
whiteListHitCount |
private int |
whiteSqlMaxSize |
| 构造器和说明 |
|---|
WallProvider(WallConfig config) |
WallProvider(WallConfig config,
String dbType) |
private String name
private boolean whiteListEnable
private LRUCache<String,WallSqlStat> whiteList
private int MAX_SQL_LENGTH
private int whiteSqlMaxSize
private boolean blackListEnable
private LRUCache<String,WallSqlStat> blackList
private LRUCache<String,WallSqlStat> blackMergedList
private int blackSqlMaxSize
protected final WallConfig config
private final ReentrantReadWriteLock lock
private static final ThreadLocal<Boolean> privileged
private final ConcurrentMap<String,WallFunctionStat> functionStats
private final ConcurrentMap<String,WallTableStat> tableStats
public final WallDenyStat commentDeniedStat
protected String dbType
protected final AtomicLong checkCount
protected final AtomicLong hardCheckCount
protected final AtomicLong whiteListHitCount
protected final AtomicLong blackListHitCount
protected final AtomicLong syntaxErrorCount
protected final AtomicLong violationCount
protected final AtomicLong violationEffectRowCount
private static final ThreadLocal<Object> tenantValueLocal
public WallProvider(WallConfig config)
public WallProvider(WallConfig config, String dbType)
public String getName()
public void setName(String name)
public void reset()
public ConcurrentMap<String,WallTableStat> getTableStats()
public ConcurrentMap<String,WallFunctionStat> getFunctionStats()
public WallSqlStat getSqlStat(String sql)
public WallTableStat getTableStat(String tableName)
public void addUpdateCount(WallSqlStat sqlStat, long updateCount)
public void addFetchRowCount(WallSqlStat sqlStat, long fetchRowCount)
public WallTableStat getTableStatWithLowerName(String lowerCaseName)
public WallFunctionStat getFunctionStat(String functionName)
public WallFunctionStat getFunctionStatWithLowerName(String lowerCaseName)
public WallConfig getConfig()
public WallSqlStat addWhiteSql(String sql, Map<String,WallSqlTableStat> tableStats, Map<String,WallSqlFunctionStat> functionStats, boolean syntaxError)
public WallSqlStat addBlackSql(String sql, Map<String,WallSqlTableStat> tableStats, Map<String,WallSqlFunctionStat> functionStats, List<Violation> violations, boolean syntaxError)
public void clearCache()
public void clearWhiteList()
public void clearBlackList()
public WallSqlStat getWhiteSql(String sql)
public WallSqlStat getBlackSql(String sql)
public boolean whiteContains(String sql)
public abstract SQLStatementParser createParser(String sql)
public abstract WallVisitor createWallVisitor()
public abstract ExportParameterVisitor createExportParameterVisitor()
public boolean checkValid(String sql)
public void incrementCommentDeniedCount()
public boolean checkDenyFunction(String functionName)
public boolean checkDenySchema(String schemaName)
public boolean checkDenyTable(String tableName)
public boolean checkReadOnlyTable(String tableName)
public WallDenyStat getCommentDenyStat()
public WallCheckResult check(String sql)
private WallCheckResult checkInternal(String sql)
private WallCheckResult checkWhiteAndBlackList(String sql)
void recordStats(Map<String,WallSqlTableStat> tableStats, Map<String,WallSqlFunctionStat> functionStats)
public static boolean ispPrivileged()
public static <T> T doPrivileged(PrivilegedAction<T> action)
public static void setTenantValue(Object value)
public static Object getTenantValue()
public long getWhiteListHitCount()
public long getBlackListHitCount()
public long getSyntaxErrorCount()
public long getCheckCount()
public long getViolationCount()
public long getHardCheckCount()
public long getViolationEffectRowCount()
public void addViolationEffectRowCount(long rowCount)
public WallProviderStatValue getStatValue(boolean reset)
public boolean isWhiteListEnable()
public void setWhiteListEnable(boolean whiteListEnable)
public boolean isBlackListEnable()
public void setBlackListEnable(boolean blackListEnable)
Copyright © 2013–2019 Alibaba Group. All rights reserved.