Package io.debezium.relational
Class SystemVariables
- java.lang.Object
-
- io.debezium.relational.SystemVariables
-
public class SystemVariables extends Object
Encapsulates a set of a database's system variables.- Author:
- Randall Hauch
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSystemVariables.DefaultScopestatic interfaceSystemVariables.ScopeInterface that is used for enums defining the customized scope values for specific DBMSs.
-
Field Summary
Fields Modifier and Type Field Description private Map<SystemVariables.Scope,ConcurrentMap<String,String>>systemVariables
-
Constructor Summary
Constructors Constructor Description SystemVariables()Create an instance.SystemVariables(SystemVariables.Scope[] scopes)SystemVariables(List<SystemVariables.Scope> scopes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ConcurrentMap<String,String>forScope(SystemVariables.Scope scope)private List<ConcurrentMap<String,String>>getOrderedSystemVariablesByScopePriority()StringgetVariable(String name)Get the variable with the specified name, from the highest priority scope that contain it.StringgetVariable(String name, SystemVariables.Scope scope)Get the variable with the specified name and scope.SystemVariablessetVariable(SystemVariables.Scope scope, String name, String value)Set the variable with the specified scope.private StringvariableName(String name)
-
-
-
Field Detail
-
systemVariables
private final Map<SystemVariables.Scope,ConcurrentMap<String,String>> systemVariables
-
-
Constructor Detail
-
SystemVariables
public SystemVariables()
Create an instance.
-
SystemVariables
public SystemVariables(SystemVariables.Scope[] scopes)
-
SystemVariables
public SystemVariables(List<SystemVariables.Scope> scopes)
-
-
Method Detail
-
setVariable
public SystemVariables setVariable(SystemVariables.Scope scope, String name, String value)
Set the variable with the specified scope.- Parameters:
scope- the variable scope; may be null if the session scope is to be usedname- the name of the variable; may not be nullvalue- the variable value; may be null if the value for the named variable is to be removed- Returns:
- this object for method chaining purposes; never null
-
getVariable
public String getVariable(String name, SystemVariables.Scope scope)
Get the variable with the specified name and scope.- Parameters:
name- the name of the variable; may not be nullscope- the variable scope; may not be null- Returns:
- the variable value; may be null if the variable is not currently set
-
getVariable
public String getVariable(String name)
Get the variable with the specified name, from the highest priority scope that contain it.- Parameters:
name- the name of the variable; may not be null- Returns:
- the variable value; may be null if the variable is not currently set
-
getOrderedSystemVariablesByScopePriority
private List<ConcurrentMap<String,String>> getOrderedSystemVariablesByScopePriority()
-
forScope
protected ConcurrentMap<String,String> forScope(SystemVariables.Scope scope)
-
-