public abstract class QueryScope extends Object implements com.fishlib.base.log.LogOutputAppendable
Modifier and Type | Class and Description |
---|---|
static class |
QueryScope.MissingVariableException |
static class |
QueryScope.ScriptSessionImpl |
static class |
QueryScope.StandaloneImpl |
Modifier and Type | Field and Description |
---|---|
static String |
CLIENT_HOST_PARAM_NAME |
static String |
QUERY_NAME_PARAM_NAME |
Constructor and Description |
---|
QueryScope() |
Modifier and Type | Method and Description |
---|---|
static void |
addObjectFields(Object object) |
static <T> void |
addParam(String name,
T value) |
com.fishlib.base.log.LogOutput |
append(com.fishlib.base.log.LogOutput logOutput) |
protected abstract <T> Param<T> |
createParam(String name)
Get a Param by name.
|
String |
getClientHost() |
static QueryScope |
getDefaultInstance() |
abstract Map<String,Object> |
getLocalValuesForRemoteParams()
Get a snapshot of local values for remote parameters, for scopes that support this.
|
abstract Set<String> |
getParamNames()
Get all known scope variable names.
|
Param[] |
getParams(Collection<String> names)
Get an array of Params by name.
|
static <T> T |
getParamValue(String name) |
String |
getQueryName() |
abstract void |
putObjectFields(Object object)
Add an object's public members (referenced reflectively, not a shallow copy!) to this scope if supported.
|
abstract <T> void |
putParam(String name,
T value)
Add a name + value pair to the scope.
|
abstract void |
putRemoteParams(Map<String,Class> remoteParamMetadata)
Add remote parameter metadata, for scopes that support this.
|
abstract <T> T |
readParamValue(String name)
Get the value of a given scope variable by name.
|
abstract <T> T |
readParamValue(String name,
T defaultValue)
Get the value of a given scope variable by name.
|
void |
setClientHost(String clientHost) |
static void |
setDefaultInstance(QueryScope queryScope) |
void |
setQueryName(String queryName) |
public static final String CLIENT_HOST_PARAM_NAME
public static final String QUERY_NAME_PARAM_NAME
public static void setDefaultInstance(@NotNull QueryScope queryScope)
public static QueryScope getDefaultInstance()
public static <T> void addParam(String name, T value)
public static void addObjectFields(Object object)
public static <T> T getParamValue(String name) throws QueryScope.MissingVariableException
public final Param[] getParams(Collection<String> names) throws QueryScope.MissingVariableException
names
- QueryScope.MissingVariableException
- If any of the named scope variables does not exist.public abstract Set<String> getParamNames()
protected abstract <T> Param<T> createParam(String name) throws QueryScope.MissingVariableException
name
- QueryScope.MissingVariableException
- If any of the named scope variables does not exist.public abstract <T> T readParamValue(String name) throws QueryScope.MissingVariableException
name
- QueryScope.MissingVariableException
- If no such scope variable exists.public abstract <T> T readParamValue(String name, T defaultValue)
name
- defaultValue
- public abstract <T> void putParam(String name, T value)
name
- value
- public abstract void putRemoteParams(Map<String,Class> remoteParamMetadata)
remoteParamMetadata
- public abstract Map<String,Object> getLocalValuesForRemoteParams()
public abstract void putObjectFields(Object object)
public final String getClientHost()
public void setClientHost(String clientHost)
public String getQueryName()
public void setQueryName(String queryName)
public com.fishlib.base.log.LogOutput append(@NotNull com.fishlib.base.log.LogOutput logOutput)
append
in interface com.fishlib.base.log.LogOutputAppendable