Package org.snmp4j.agent.io
Interface MOPersistenceProvider
- All Known Implementing Classes:
DefaultMOPersistenceProvider
public interface MOPersistenceProvider
The
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.- Version:
- 1.2
- Author:
- Frank Fock
-
Method Summary
Modifier and TypeMethodDescriptionGets the URI of the default persistent storage for this provider.Returns an unique ID of the persistence provider which should identify the format and type of the persistence provider.boolean
Checks whether the supplied URI string is valid for this persistence provider.void
Restore (load) agent state from the specified URI (can be as simple as a file path).void
Stores the current agent state to persistent storage specified by the supplied URI.
-
Method Details
-
restore
Restore (load) agent state from the specified URI (can be as simple as a file path).- Parameters:
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. Anull
value can be specified to let the persistence provider use its default URI. If that default URI isnull
too, aNullPointerException
will be thrown.importMode
- specifies how the agent's current state should be update while restoring a previous state.- Throws:
IOException
- if the restore operation fails.- Since:
- 1.2
-
store
Stores the current agent state to persistent storage specified by the supplied URI.- Parameters:
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. Anull
value can be specified to let the persistence provider use its default URI. If that default URI isnull
too, aNullPointerException
will be thrown.- Throws:
IOException
- if the store operation fails.- Since:
- 1.2
-
isValidPersistenceURI
Checks whether the supplied URI string is valid for this persistence provider.- Parameters:
uri
- a string identifying a persistent storage location for this storage provider.- Returns:
true
if theuri
is valid,false
otherwise.- Since:
- 1.2
-
getPersistenceProviderID
String getPersistenceProviderID()Returns an unique ID of the persistence provider which should identify the format and type of the persistence provider.- Returns:
- an 1-32 character long string that identifies the persistence provider.
- Since:
- 1.2
-
getDefaultURI
String getDefaultURI()Gets the URI of the default persistent storage for this provider.- Returns:
- the URI (e.g. file path) for the default persistent storage location of
this provider. A provider may use a different one. A
null
value indicates that there is no default location.
-