org.friendlysnmp
Class FScalar

java.lang.Object
  extended by org.friendlysnmp.FNode
      extended by org.friendlysnmp.FValueNode
          extended by org.friendlysnmp.FScalar

public class FScalar
extends FValueNode

This class hides access to org.snmp4j.agent.mo.MOScalar
The objects of this class are generated by FriendlyPro tool.

Version:
$Revision: 1.35 $

Field Summary
protected  java.util.Set<FScalarGetListener> hsGetListener
          Scalar GET listeners.
protected  java.util.Set<FScalarSetListener> hsSetListener
          Scalar SET listeners.
protected  java.util.Set<FScalarValidationListener> hsValidationListener
          Scalar VALIDATION listeners.
 
Fields inherited from class org.friendlysnmp.FValueNode
persistLoaded
 
Fields inherited from class org.friendlysnmp.FNode
agent
 
Constructor Summary
FScalar(java.lang.String name, org.snmp4j.agent.mo.MOScalar moScalar, AgentWorker agent)
          Constructor.
 
Method Summary
 void addGetListener(FScalarGetListener l)
           
 void addSetListener(FScalarSetListener l)
          Registers the given observer to begin receiving "changed value" events when changes are made to the managed object.
 void addValidationListener(FScalarValidationListener l)
          Registers the given observer to begin receiving "validation" events when changes are made to the managed object.
 org.snmp4j.agent.mo.MOScalar getMOScalar()
          Returns SNMP4J underlying managed object.
 ValueSyntax getSyntax()
          Returns syntax of the scalar value.
 java.lang.Object getValue()
          Returns value of the scalar managed object.
 boolean isVolatile()
          Returns volatile flag.
protected  void loadPersistValue()
          Loads persistent value into the scalar/table.
 void removeGetListener(FScalarGetListener l)
           
 void removeSetListener(FScalarSetListener l)
          Unregisters the given observer from the notification list so it will no longer receive change updates.
 void removeValidationListener(FScalarValidationListener l)
          Unregisters the given observer to stop receiving "validation" events when changes are made to the managed object.
 void setAgent(AgentWorker agent)
          Sets the agent.
 void setValue(java.lang.Object obj)
          Sets scalar managed object value.
 void setValueEx(java.lang.Object obj)
          Sets scalar managed object value.
protected  void setVolatilePrivate(boolean isVolatile)
          
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class org.friendlysnmp.FValueNode
addRestoreDefaultListener, fireRestoreDefaultEvent, isPersistLoaded, removeRestoreDefaultListener, setVolatile
 
Methods inherited from class org.friendlysnmp.FNode
getFID, getFIDtoString, getName, getOID, getOIDSize, getPersistStorage, throwFException, throwFException
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

hsGetListener

protected java.util.Set<FScalarGetListener> hsGetListener
Scalar GET listeners.


hsSetListener

protected java.util.Set<FScalarSetListener> hsSetListener
Scalar SET listeners.


hsValidationListener

protected java.util.Set<FScalarValidationListener> hsValidationListener
Scalar VALIDATION listeners.

Constructor Detail

FScalar

public FScalar(java.lang.String name,
               org.snmp4j.agent.mo.MOScalar moScalar,
               AgentWorker agent)
Constructor.

Parameters:
name - node name as it is declared in a MIB file.
moScalar - scalar managed object.
agent - agent.
Method Detail

setAgent

public void setAgent(AgentWorker agent)
Description copied from class: FNode
Sets the agent.

Overrides:
setAgent in class FNode
Parameters:
agent - SNMP agent

setVolatilePrivate

protected void setVolatilePrivate(boolean isVolatile)

Specified by:
setVolatilePrivate in class FValueNode
See Also:
FValueNode.setVolatilePrivate(boolean)

isVolatile

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

Specified by:
isVolatile in class FValueNode
Returns:
volatile flag
See Also:
FValueNode.isVolatile()

getMOScalar

public org.snmp4j.agent.mo.MOScalar getMOScalar()
Returns SNMP4J underlying managed object.

Returns:
the org.snmp4j.agent.mo.MOScalar object this class is representing.

loadPersistValue

protected 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.

Specified by:
loadPersistValue in class FValueNode
See Also:
FValueNode.loadPersistValue()

setValue

public void setValue(java.lang.Object obj)
              throws FException
Sets scalar managed object value.

Parameters:
obj - new value to set .
Throws:
FException

setValueEx

public void setValueEx(java.lang.Object obj)
Sets scalar managed object value.

Exception is reported to listeners registered with the agent.

Parameters:
obj - new value to set.
See Also:
FExceptionListener

getValue

public java.lang.Object getValue()
Returns value of the scalar managed object.

Returns:
Java basic object like String, Integer, and so on.
See Also:
FConverter

getSyntax

public ValueSyntax getSyntax()
Returns syntax of the scalar value.

Returns:
syntax of the scalar value.

toString

public java.lang.String toString()
Returns a string representation of the object.

Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

addGetListener

public void addGetListener(FScalarGetListener l)

removeGetListener

public void removeGetListener(FScalarGetListener l)

addSetListener

public void addSetListener(FScalarSetListener l)
Registers the given observer to begin receiving "changed value" events when changes are made to the managed object.

Parameters:
l - the observer to register.

removeSetListener

public void removeSetListener(FScalarSetListener l)
Unregisters the given observer from the notification list so it will no longer receive change updates.

Parameters:
l - the observer to unregister.

addValidationListener

public void addValidationListener(FScalarValidationListener l)
Registers the given observer to begin receiving "validation" events when changes are made to the managed object.

Parameters:
l - the observer to register.

removeValidationListener

public void removeValidationListener(FScalarValidationListener l)
Unregisters the given observer to stop receiving "validation" events when changes are made to the managed object.

Parameters:
l - the observer to unregister.