- java.lang.Object
-
- org.snmp4j.agent.io.MOServerPersistence
-
public class MOServerPersistence extends Object
TheMOServerPersistence
provides persistence operations to load and save serialized MIB data.- Version:
- 1.4
- Author:
- Frank Fock
-
-
Constructor Summary
Constructors Constructor Description MOServerPersistence(MOServer server)
MOServerPersistence(MOServer[] moServers)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
loadData(MOInput input)
void
saveData(MOOutput output)
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
.
-
-
-
Method Detail
-
loadData
public void loadData(MOInput input) throws IOException
- Throws:
IOException
-
saveData
public void saveData(MOOutput output) throws IOException
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
public void saveData(MOOutput output, MOPriorityProvider priorityProvider) throws IOException
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.
-
-