DefaultMOPersistenceProvider
public interface MOPersistenceProvider
MOPersistenceProvider
interface defines how persistent
storage can be used to save and restore an agents state. The interface
intentionally does not define how the persistence provider gets access
to the agent's state.Modifier and Type | Method | Description |
---|---|---|
java.lang.String |
getDefaultURI() |
Gets the URI of the default persistent storage for this provider.
|
java.lang.String |
getPersistenceProviderID() |
Returns an unique ID of the persistence provider which should identify the
format and type of the persistence provider.
|
boolean |
isValidPersistenceURI(java.lang.String uri) |
Checks whether the supplied URI string is valid for this persistence
provider.
|
void |
restore(java.lang.String uri,
int importMode) |
Restore (load) agent state from the specified URI (can be as simple as
a file path).
|
void |
store(java.lang.String uri) |
Stores the current agent state to persistent storage specified by the
supplied URI.
|
void restore(java.lang.String uri, int importMode) throws java.io.IOException
uri
- a string pointing to the persistent storage from which the agent state
should be restored from. The format of he string is specified by the
persistence provider. A null
value can be specified to
let the persistence provider use its default URI. If that default URI
is null
too, a NullPointerException
will be
thrown.importMode
- specifies how the agent's current state should be update while
restoring a previous state.java.io.IOException
- if the restore operation fails.void store(java.lang.String uri) throws java.io.IOException
uri
- a string pointing to the persistent storage from which the agent state
should be restored from. The format of the string is specified by the
persistence provider. A null
value can be specified to
let the persistence provider use its default URI. If that default URI
is null
too, a NullPointerException
will be
thrown.java.io.IOException
- if the store operation fails.boolean isValidPersistenceURI(java.lang.String uri)
uri
- a string identifying a persistent storage location for this storage
provider.true
if the uri
is valid, false
otherwise.java.lang.String getPersistenceProviderID()
java.lang.String getDefaultURI()
null
value indicates that there is no default location.Copyright © 2018 SNMP4J.org. All rights reserved.