T
- the base type of XML objects being managedpublic interface XMLObjectLoadSaveManager<T extends XMLObject>
XMLObject
,
based on a string key.
The index key strategy used is determined by the caller.
Modifier and Type | Method and Description |
---|---|
boolean |
exists(String key)
Evaluate whether an object already exists indexed by the supplied key.
|
Iterable<Pair<String,T>> |
listAll()
Return an iterable of all objects under management, along with their associated index key.
|
Set<String> |
listKeys()
Return a set of the index keys of all objects under management.
|
T |
load(String key)
Load a particular object based on the supplied key.
|
boolean |
remove(String key)
Remove the object indexed by the specified key.
|
void |
save(String key,
T xmlObject)
Save a particular object, indexed by the supplied key.
|
void |
save(String key,
T xmlObject,
boolean overwrite)
Save a particular object, indexed by the supplied key.
|
boolean |
updateKey(String currentKey,
String newKey)
Update the key under which a particular object is stored.
|
@Nonnull @NonnullElements @NotLive @Unmodifiable Set<String> listKeys() throws IOException
IOException
- if there is a fatal error obtaining the keys@Nonnull @NonnullElements Iterable<Pair<String,T>> listAll() throws IOException
IOException
- if there is a fatal error loading the managed objectsboolean exists(@Nonnull @NotEmpty String key) throws IOException
key
- the key of the desired objectIOException
- if there is a fatal error evaluating object existence@Nullable T load(@Nonnull @NotEmpty String key) throws IOException
key
- the key of the desired objectIOException
- if there is a fatal error loading the objectvoid save(@Nonnull @NotEmpty String key, @Nonnull T xmlObject) throws IOException
An existing object indexed by the supplied key will not be overwritten.
Instead an IOException
will be thrown.
For saving with the overwrite option, see save(String, XMLObject, boolean)
.
key
- the key under which to index the objectxmlObject
- the object to saveIOException
- if there is a fatal error saving the object, or if an object already exists
indexed by the supplied keyvoid save(@Nonnull @NotEmpty String key, @Nonnull T xmlObject, boolean overwrite) throws IOException
key
- the key under which to index the objectxmlObject
- the object to saveoverwrite
- whether or not to overwrite any existing object indexed by the supplied keyIOException
- if there is a fatal error saving the object, or if overwrite=false,
if an object already exists indexed by the supplied keyboolean remove(@Nonnull @NotEmpty String key) throws IOException
key
- the key of the object to removeIOException
- if there was a fatal error removing the objectboolean updateKey(@Nonnull @NotEmpty String currentKey, @Nonnull @NotEmpty String newKey) throws IOException
currentKey
- the current key under which the object is storednewKey
- the new key under which the object should be storedIOException
- if there was a fatal error updating the keyCopyright © 1999–2018 Shibboleth Consortium. All rights reserved.