org.snmp4j.agent.cfg.EngineBootsProvider
, org.snmp4j.agent.cfg.EngineIdProvider
, org.snmp4j.agent.io.MOPersistenceProvider
public class MOXodusPersistenceProvider extends Object implements org.snmp4j.agent.io.MOPersistenceProvider, org.snmp4j.agent.cfg.EngineBootsProvider, org.snmp4j.agent.cfg.EngineIdProvider
MOXodusPersistenceProvider
implements a MOPersistenceProvider
that uses a JetBrains Xodus
database for persistent storage of RandomAccessManagedObject
s.
Using RandomAccessManagedObject
peristence with this MOXodusPersistenceProvider
has
the following advantages:
DefaultMOPersistenceProvider
MOChangeListener
and
MOTableRowListener
persistently into the database immediately.Constructor | Description |
---|---|
MOXodusPersistenceProvider(MOXodusPersistence defaultPersistence) |
Creates a
MOXodusPersistenceProvider based with a provided default MOXodusPersistence handler
that provides the default storage access operations and listens for
RandomAccessManagedObject update events
(see MOXodusPersistence.registerChangeListenersWithServer(MOServer) for details). |
Modifier and Type | Method | Description |
---|---|---|
String |
getDefaultURI() |
Gets the URI of the default persistent storage for this provider.
|
int |
getEngineBoots() |
Returns current engine boot counter value.
|
org.snmp4j.smi.OctetString |
getEngineId(org.snmp4j.smi.OctetString defaultEngineID) |
|
String |
getPersistenceProviderID() |
Returns an unique ID of the persistence provider which should identify the
format and type of the persistence provider.
|
boolean |
isValidPersistenceURI(String uriString) |
Checks whether the supplied URI string is valid for this persistence
provider.
|
void |
resetEngineId(org.snmp4j.smi.OctetString engineId) |
|
void |
restore(String uri,
int importMode) |
Restore (load) agent state from the specified URI (can be as simple as
a file path).
|
void |
store(String uri) |
Stores the current agent state to persistent storage specified by the
supplied URI.
|
int |
updateEngineBoots() |
Returns the current engine boot counter value incremented by one.
|
public MOXodusPersistenceProvider(MOXodusPersistence defaultPersistence)
MOXodusPersistenceProvider
based with a provided default MOXodusPersistence
handler
that provides the default storage access operations and listens for
RandomAccessManagedObject
update events
(see MOXodusPersistence.registerChangeListenersWithServer(MOServer)
for details).
Additional MOXodusPersistence
can be created on the fly, with store(String)
.defaultPersistence
- the default persistence handler.public void restore(String uri, int importMode) throws IOException
restore
in interface org.snmp4j.agent.io.MOPersistenceProvider
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.IOException
- if the restore operation fails.public void store(String uri) throws IOException
store
in interface org.snmp4j.agent.io.MOPersistenceProvider
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.IOException
- if the store operation fails.public boolean isValidPersistenceURI(String uriString)
isValidPersistenceURI
in interface org.snmp4j.agent.io.MOPersistenceProvider
uriString
- a string identifying a persistent storage location for this storage
provider.true
if the uri
is valid, false
otherwise.public String getPersistenceProviderID()
getPersistenceProviderID
in interface org.snmp4j.agent.io.MOPersistenceProvider
public String getDefaultURI()
getDefaultURI
in interface org.snmp4j.agent.io.MOPersistenceProvider
null
value indicates that there is no default location.public int updateEngineBoots()
updateEngineBoots
in interface org.snmp4j.agent.cfg.EngineBootsProvider
public int getEngineBoots()
getEngineBoots
in interface org.snmp4j.agent.cfg.EngineBootsProvider
public org.snmp4j.smi.OctetString getEngineId(org.snmp4j.smi.OctetString defaultEngineID)
getEngineId
in interface org.snmp4j.agent.cfg.EngineIdProvider
public void resetEngineId(org.snmp4j.smi.OctetString engineId)
resetEngineId
in interface org.snmp4j.agent.cfg.EngineIdProvider
Copyright © 2018 SNMP4J.org. All rights reserved.