java.lang.Object
org.snmp4j.agent.io.MOServerPersistence
The
MOServerPersistence
provides persistence operations
to load and save serialized MIB data.
SerializableManagedObject
s that are SerializableManagedObject.isVolatile()
are not loaded and saved- Version:
- 1.4
- Author:
- Frank Fock
-
Constructor Summary
ConstructorDescriptionMOServerPersistence
(MOServer server) MOServerPersistence
(MOServer[] moServers) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
Load the persistent data into allSerializableManagedObject
s that are available in theMOServer
provided during construction and that are notSerializableManagedObject.isVolatile()
.void
Saves the serializable data of the associated servers to the givenMOOutput
.void
saveData
(MOOutput output, MOPriorityProvider priorityProvider) Saves the serializable data of the associated servers to the givenMOOutput
in the order defined byMOPriorityProvider
.
-
Constructor Details
-
MOServerPersistence
-
MOServerPersistence
-
-
Method Details
-
loadData
- Throws:
IOException
-
loadData
Load the persistent data into allSerializableManagedObject
s that are available in theMOServer
provided during construction and that are notSerializableManagedObject.isVolatile()
. However, if the parameterconfigureOnly
istrue
andSerializableManagedObject.isConfigurable()
istrue
, then these objects are changed too if present ininput
.- Parameters:
input
- the data to load.configureOnly
- specifies the kind of data to be loaded. Iftrue
thenSerializableManagedObject.isConfigurable()
objects are loaded even if they areSerializableManagedObject.isVolatile()
.- Throws:
IOException
- if the input cannot be read.
-
saveData
Saves the serializable data of the associated servers to the givenMOOutput
. This method can be called while the registrations of theMOServer
s are changed, becauseMOServer.iterator()
is synchronized and returns a copy tree of the registered objects.- Parameters:
output
- aMOOutput
instance to store the data.- Throws:
IOException
- if the output stream cannot be written.
-
saveData
Saves the serializable data of the associated servers to the givenMOOutput
in the order defined byMOPriorityProvider
. This method can be called while the registrations of theMOServer
s are changed, becauseMOServer.iterator()
is synchronized and returns a copy tree of the registered objects.- Parameters:
output
- aMOOutput
instance to store the data.priorityProvider
- if notnull
, the objects of the servers are stored in order defined by this priority provider. Objects with lowest priority value, will be saved first.- Throws:
IOException
- if the output stream cannot be written.
-