public final class XmlConfigFile extends Object
Modifier and Type | Class and Description |
---|---|
static class |
XmlConfigFile.Type
Specify the type of configuration.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
delete(XmlConfigFile.Type type,
String key)
Delete the configuration file for the specified configuration.
|
static boolean |
deleteAll(XmlConfigFile.Type type,
Set<String> retain)
Delete all the configuration files for the specified configuration.
|
static List<String> |
getKeys(XmlConfigFile.Type type)
Return a list of valid map keys saved in the configuration directory.
|
static void |
init()
Initialize the configuration directory for the VTN Manager.
|
static <T> T |
load(XmlConfigFile.Type type,
String key,
Class<T> cls)
Load a map entry from the file.
|
static boolean |
save(XmlConfigFile.Type type,
String key,
Object value)
Write a map entry to the XML file.
|
public static void init()
public static boolean save(XmlConfigFile.Type type, String key, Object value)
type
- The type of the configuration.key
- A key associated with the map entry.value
- A value to be saved into XML file.
An object bound to XML root element needs to be specified.true
on success. false
on failure.public static <T> T load(XmlConfigFile.Type type, String key, Class<T> cls)
T
- The type of object to be bound to XML element.type
- The type of the configuration.key
- A key associated with the map entry.cls
- The type of object to be bound to XML element.null
is returned on failure.
The specified file will be deleted if this method returns
null
.public static boolean delete(XmlConfigFile.Type type, String key)
type
- The type of the configuration.key
- A key associated with the map entry.true
if the specified configuration file was deleted
successfully. Otherwise false
.public static boolean deleteAll(XmlConfigFile.Type type, Set<String> retain)
type
- The type of the configuration.retain
- A set of map keys to be retained.true
if the operation was successfully completed.
false
if at least one error occurred.public static List<String> getKeys(XmlConfigFile.Type type)
type
- The type of the configuration.Copyright © 2018 OpenDaylight. All rights reserved.