Package org.yamcs.memento
Class MementoDb
java.lang.Object
org.yamcs.memento.MementoDb
- All Implemented Interfaces:
ManagementListener
General purpose facility for persisting state information.
-
Method Summary
Modifier and TypeMethodDescriptiongetBoolean
(String key) Returns the boolean value of the given key.static MementoDb
getInstance
(String yamcsInstance) Retrieve aMementoDb
for the given Yamcs instance.Optional<com.google.gson.JsonArray>
getJsonArray
(String key) Returns the JsonArray value of the given key.Optional<com.google.gson.JsonObject>
getJsonObject
(String key) Returns the JsonObject value of the given key.Returns the number value of the given key.<T> Optional<T>
Retrieves an object saved as memento.Returns the string value of the given key.void
putBoolean
(String key, Boolean value) Sets the value of the given key to the given boolean value.void
putJsonArray
(String key, com.google.gson.JsonArray value) Sets the value of the given key to the given JsonArray value.void
putJsonObject
(String key, com.google.gson.JsonObject value) Sets the value of the given key to the given JsonObject value.void
Sets the value of the given key to the given number value.<T> void
Sets the value of the given key by serializing the provided object using GSON.void
Sets the value of the given key to the given string value.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.yamcs.management.ManagementListener
instanceStateChanged, processorAdded, processorClosed, processorStateChanged, serviceRegistered, serviceUnregistered, statisticsUpdated
-
Method Details
-
getInstance
Retrieve aMementoDb
for the given Yamcs instance. -
getBoolean
Returns the boolean value of the given key.An empty optional is returned if the key is missing, or the value cannot be read as a boolean.
-
putBoolean
Sets the value of the given key to the given boolean value. -
getNumber
Returns the number value of the given key.An empty optional is returned if the key is missing, or the value cannot be read as a number.
-
putNumber
Sets the value of the given key to the given number value. -
getString
Returns the string value of the given key.An empty optional is returned if the key is missing, or the value cannot be read as a string.
-
putString
Sets the value of the given key to the given string value. -
getJsonObject
Returns the JsonObject value of the given key.An empty optional is returned if the key is missing, or the value cannot be read as a JsonObject.
-
putJsonObject
Sets the value of the given key to the given JsonObject value. -
getJsonArray
Returns the JsonArray value of the given key.An empty optional is returned if the key is missing, or the value cannot be read as a JsonArray.
-
putJsonArray
Sets the value of the given key to the given JsonArray value. -
getObject
Retrieves an object saved as memento. The object is deserialized using GSON. -
putObject
Sets the value of the given key by serializing the provided object using GSON.
-