Package com.alibaba.druid.wall
Class WallProvider
java.lang.Object
com.alibaba.druid.wall.WallProvider
- Direct Known Subclasses:
ClickhouseWallProvider
,DB2WallProvider
,MySqlWallProvider
,OracleWallProvider
,PGWallProvider
,SQLiteWallProvider
,SQLServerWallProvider
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AtomicLong
protected final AtomicLong
final WallDenyStat
protected final WallConfig
protected DbType
protected final AtomicLong
protected final AtomicLong
protected final AtomicLong
protected final AtomicLong
protected final AtomicLong
-
Constructor Summary
ConstructorsConstructorDescriptionWallProvider
(WallConfig config) WallProvider
(WallConfig config, DbType dbType) WallProvider
(WallConfig config, String dbType) -
Method Summary
Modifier and TypeMethodDescriptionaddBlackSql
(String sql, Map<String, WallSqlTableStat> tableStats, Map<String, WallSqlFunctionStat> functionStats, List<Violation> violations, boolean syntaxError) void
addFetchRowCount
(WallSqlStat sqlStat, long fetchRowCount) void
addUpdateCount
(WallSqlStat sqlStat, long updateCount) void
addViolationEffectRowCount
(long rowCount) addWhiteSql
(String sql, Map<String, WallSqlTableStat> tableStats, Map<String, WallSqlFunctionStat> functionStats, boolean syntaxError) boolean
checkDenyFunction
(String functionName) boolean
checkDenySchema
(String schemaName) boolean
checkDenyTable
(String tableName) boolean
checkReadOnlyTable
(String tableName) boolean
checkValid
(String sql) void
void
void
abstract ExportParameterVisitor
abstract SQLStatementParser
createParser
(String sql) abstract WallVisitor
static <T> T
doPrivileged
(PrivilegedAction<T> action) long
getBlackSql
(String sql) long
getFunctionStat
(String functionName) getFunctionStatWithLowerName
(String lowerCaseName) long
getName()
getSqlStat
(String sql) getStatValue
(boolean reset) long
getTableStat
(String tableName) getTableStatWithLowerName
(String lowerCaseName) static Object
long
long
long
getWhiteSql
(String sql) void
boolean
static boolean
boolean
void
reset()
void
setBlackListEnable
(boolean blackListEnable) void
static void
setTenantValue
(Object value) void
setWhiteListEnable
(boolean whiteListEnable) boolean
whiteContains
(String sql)
-
Field Details
-
config
-
commentDeniedStat
-
dbType
-
checkCount
-
hardCheckCount
-
whiteListHitCount
-
blackListHitCount
-
syntaxErrorCount
-
violationCount
-
violationEffectRowCount
-
-
Constructor Details
-
WallProvider
-
WallProvider
-
WallProvider
-
-
Method Details
-
getName
-
setName
-
getAttributes
-
reset
public void reset() -
getTableStats
-
getFunctionStats
-
getSqlStat
-
getTableStat
-
addUpdateCount
-
addFetchRowCount
-
getTableStatWithLowerName
-
getFunctionStat
-
getFunctionStatWithLowerName
-
getConfig
-
addWhiteSql
public WallSqlStat addWhiteSql(String sql, Map<String, WallSqlTableStat> tableStats, Map<String, WallSqlFunctionStat> functionStats, boolean syntaxError) -
addBlackSql
public WallSqlStat addBlackSql(String sql, Map<String, WallSqlTableStat> tableStats, Map<String, WallSqlFunctionStat> functionStats, List<Violation> violations, boolean syntaxError) -
getWhiteList
-
getSqlList
-
getBlackList
-
clearCache
public void clearCache() -
clearWhiteList
public void clearWhiteList() -
clearBlackList
public void clearBlackList() -
getWhiteSql
-
getBlackSql
-
whiteContains
-
createParser
-
createWallVisitor
-
createExportParameterVisitor
-
checkValid
-
incrementCommentDeniedCount
public void incrementCommentDeniedCount() -
checkDenyFunction
-
checkDenySchema
-
checkDenyTable
-
checkReadOnlyTable
-
getCommentDenyStat
-
check
-
ispPrivileged
public static boolean ispPrivileged() -
doPrivileged
-
setTenantValue
-
getTenantValue
-
getWhiteListHitCount
public long getWhiteListHitCount() -
getBlackListHitCount
public long getBlackListHitCount() -
getSyntaxErrorCount
public long getSyntaxErrorCount() -
getCheckCount
public long getCheckCount() -
getViolationCount
public long getViolationCount() -
getHardCheckCount
public long getHardCheckCount() -
getViolationEffectRowCount
public long getViolationEffectRowCount() -
addViolationEffectRowCount
public void addViolationEffectRowCount(long rowCount) -
getStatValue
-
getStatsMap
-
isWhiteListEnable
public boolean isWhiteListEnable() -
setWhiteListEnable
public void setWhiteListEnable(boolean whiteListEnable) -
isBlackListEnable
public boolean isBlackListEnable() -
setBlackListEnable
public void setBlackListEnable(boolean blackListEnable)
-