org.friendlysnmp
Class FValueNode

java.lang.Object
  extended by org.friendlysnmp.FNode
      extended by org.friendlysnmp.FValueNode
Direct Known Subclasses:
FScalar, FTable

public abstract class FValueNode
extends FNode

Abstract base class which represents MIB node with a value (scalar, table).

Version:
$Revision: 1.15 $

Field Summary
protected  boolean persistLoaded
          Flag with indication that scalar was loaded from persistent storage.
 
Fields inherited from class org.friendlysnmp.FNode
agent
 
Constructor Summary
FValueNode(java.lang.String name, org.snmp4j.smi.OID oid)
           
 
Method Summary
 void addRestoreDefaultListener(FRestoreDefaultListener l)
          Registers the given observer to begin receiving "restore default" events when changes are made to the managed object.
 void fireRestoreDefaultEvent()
          Fires RESTORE DEFAULT event.
 boolean isPersistLoaded()
          Returns flag that this node was loaded from persistent storage.
abstract  boolean isVolatile()
          Returns volatile flag.
protected abstract  void loadPersistValue()
          Loads persistent value into the scalar/table.
 void removeRestoreDefaultListener(FRestoreDefaultListener l)
          Unregisters the given observer to stop receiving "restore default" events when changes are made to the managed object.
 void setVolatile(boolean volatileNode)
          Sets the volatile flag for this node.
protected abstract  void setVolatilePrivate(boolean isVolatile)
           
 
Methods inherited from class org.friendlysnmp.FNode
getFID, getFIDtoString, getName, getOID, getOIDSize, getPersistStorage, setAgent, throwFException, throwFException
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

persistLoaded

protected boolean persistLoaded
Flag with indication that scalar was loaded from persistent storage.

Constructor Detail

FValueNode

public FValueNode(java.lang.String name,
                  org.snmp4j.smi.OID oid)
Method Detail

addRestoreDefaultListener

public void addRestoreDefaultListener(FRestoreDefaultListener l)
Registers the given observer to begin receiving "restore default" events when changes are made to the managed object.

Parameters:
l - the observer to register

removeRestoreDefaultListener

public void removeRestoreDefaultListener(FRestoreDefaultListener l)
Unregisters the given observer to stop receiving "restore default" events when changes are made to the managed object.

Parameters:
l - the observer to unregister

isPersistLoaded

public boolean isPersistLoaded()
Returns flag that this node was loaded from persistent storage.

Returns:
flag that scalar was loaded from persistent storage.

loadPersistValue

protected abstract void loadPersistValue()
Loads persistent value into the scalar/table. If for any reason the load fails the persistent entry is removed for clean start in the next application run.


setVolatile

public void setVolatile(boolean volatileNode)
Sets the volatile flag for this node. This method must be called explicitly with parameter false to load persistent value for scalars and tables.

Parameters:
volatileNode - set to true to prevent saving the state of this object in persistency storage by agent when the value is modified from the MIB browser.

setVolatilePrivate

protected abstract void setVolatilePrivate(boolean isVolatile)

fireRestoreDefaultEvent

public void fireRestoreDefaultEvent()
                             throws FException
Fires RESTORE DEFAULT event.

Throws:
FException

isVolatile

public abstract boolean isVolatile()
Returns volatile flag. Volatile objects are not stored in persistency storage after their modification via management protocol.

Returns:
volatile flag