|
static Context
|
getContext()
|
|
static void
|
setContext(Context context)
|
|
static boolean
|
zcontains(ParsedURI parsedUri)
|
|
static boolean
|
zcontains(String uri)
public static boolean zcontains(java.lang.String uri)
-
- Parameters:
-
uri - A full Global Context key. May include value path.
- Returns:
-
true if the Global Context contains a value at uri; false otherwise.
|
|
static boolean
|
zdelete(String uri)
public static boolean zdelete(java.lang.String uri)
-
This method deletes the name-value pair associated with the given key, and optionally deletes and values whose
keys are an extension of it. For example, if the key to delete were /request/headers,
/request/headers/out would be an extension (child) of that key and may be deleted by setting the
second parameter to 'true'.
-
- Parameters:
-
uri - A global context key (or prefix).
-
deleteChildren - True if the name-value pairs whose keys are children of the given key (prefix) should also
be deleted.
- Returns:
-
boolean true if the delete succeeded
|
|
static boolean
|
zdelete(String uri, boolean deleteChildren)
public static boolean zdelete(java.lang.String uri,
boolean deleteChildren)
|
|
static String
|
zdump(String uri)
public static java.lang.String zdump(java.lang.String uri)
-
This method is similar to a toString() method, except that it allows the user to filter the data and only see
certain parts of the global context in the resulting string. The key (or prefix) provided will be passed to
list(String), and the key-value pairs in that result set will be added to the string output. For example, if the
key is /request/headers, the output will contain all values in
/request/headers/in, /request/headers/out, etc. You can see the entire global
context by using the root URI: "/".
-
- Parameters:
-
uri - A global context key (or prefix) representing the subset of data that should be serialized.
- Returns:
-
A string representation of all the name-value pairs matching the given key (and its children).
|
|
static <T> T
|
zget(ParsedURI parsedUri, T defaultValue)
|
|
static <T> T
|
zget(String uri)
public static <T> T zget(java.lang.String uri)
-
- Parameters:
-
uri - A full global context key, of the form /[zone]/[key-element-1]/[key-element-2]/...
- Returns:
-
The value associated the key, if found; null otherwise. Callers can use either
zget(uri, defaultValue) or containsKey() to distinguish a null value from a
missing uri.
|
|
static <T> T
|
zget(String uri, T defaultValue)
public static <T> T zget(java.lang.String uri,
T defaultValue)
-
- Parameters:
-
uri - A full global context key, of the form /[zone]/[key-element-1]/[key-element-2]/...
-
defaultValue - The value to return if the key does not exist.
- Returns:
-
The value associated the key (may be null). If the zone or the key does not exist, the default value is
returned.
|
|
static List<String>
|
zlist(String uriPrefix)
public static java.util.List<java.lang.String> zlist(java.lang.String uriPrefix)
-
- Parameters:
-
uriPrefix - The prefix of a global context key(s).
- Returns:
-
The list of valid keys that begin with the given prefix. If no keys have the prefix, the list will be
empty.
|
|
static List<String>
|
zlist(String uriPrefix, boolean includePrefix)
public static java.util.List<java.lang.String> zlist(java.lang.String uriPrefix,
boolean includePrefix)
-
- Parameters:
-
uriPrefix - The prefix of a global context key(s).
-
includePrefix - True if the given key (prefix) should be included in the result set.
- Returns:
-
The list of valid keys that begin with the given prefix. If no keys have the prefix, the list will be
empty.
|
|
static List<String>
|
zlistAll(String uriPrefix)
public static java.util.List<java.lang.String> zlistAll(java.lang.String uriPrefix)
|
|
static List<String>
|
zlistAll(String uriPrefix, boolean includePrefix)
public static java.util.List<java.lang.String> zlistAll(java.lang.String uriPrefix,
boolean includePrefix)
|
|
static <V> boolean
|
zpost(ParsedURI uri, V value)
|
|
static <V> boolean
|
zpost(String uri, V value)
public static <V> boolean zpost(java.lang.String uri,
V value)
-
This method is for creating new name-value pairs or appending to existing ones.
-
- Parameters:
-
uri - A full global context key, of the form /[zone]/[key-element-1]/[key-element-2]/...
-
value - The new value to associate with the key; the value will represent the first value for the key (a
'create' operation) or it will be appended to the existing value.
- Returns:
-
true if successfully updated.
- Throws:
-
java.lang.IllegalArgumentException If the global context zone does not exist.
|
|
static <V> boolean
|
zput(ParsedURI uri, V value)
|
|
static <V> boolean
|
zput(String uri, V value)
public static <V> boolean zput(java.lang.String uri,
V value)
-
This method is for creating new name-value pairs or replacing existing ones.
-
- Parameters:
-
uri - A full global context key, of the form /[zone]/[key-element-1]/[key-element-2]/...
-
value - The new value to associate with the key; the value will represent the first value for the key (a
'create' operation) or it will replace the existing value.
- Returns:
-
true if successfully updated.
- Throws:
-
java.lang.IllegalArgumentException If the global context zone does not exist.
|
|
static Map<String,Boolean>
|
zputs(String uriPrefix, Map<String,Object> payload)
public static java.util.Map<java.lang.String,java.lang.Boolean> zputs(java.lang.String uriPrefix,
java.util.Map<java.lang.String,java.lang.Object> payload)
-
Convenience method for loading a family of GC key/value pairs. For each entry in payload,
GlobalContext.zput(uriPrefix + "/" + entry.getKey(), entry.getValue()).
-
- Parameters:
-
uriPrefix -
-
payload -
- Returns:
-
|