FileDocCategorySizeDatePackage
SnmpLcd.javaAPI DocJava SE 5 API3554Fri Aug 26 14:55:06 BST 2005com.sun.jmx.snmp.internal

SnmpLcd

public abstract class SnmpLcd extends Object
Class to extend in order to develop a customized Local Configuration Datastore. The Lcd is used by the SnmpEngine to store and retrieve data.

SnmpLcd manages the Lcds needed by every {@link com.sun.jmx.snmp.internal.SnmpModel SnmpModel}. It is possible to add and remove {@link com.sun.jmx.snmp.internal.SnmpModelLcd SnmpModelLcd}.

This API is a Sun Microsystems internal API and is subject to change without notice.

since
1.5

Fields Summary
private Hashtable
subs
Constructors Summary
Methods Summary
public voidaddModelLcd(com.sun.jmx.snmp.internal.SnmpSubSystem sys, int id, com.sun.jmx.snmp.internal.SnmpModelLcd lcd)
Adds an Lcd model.

param
sys The subsytem managing the model.
param
id The model Id.
param
lcd The Lcd model.

    
                                 
       
                                 
       
    
                  
        
    
                  
         
                              
       
			      
			      

	SubSysLcdManager subsys = (SubSysLcdManager) subs.get(sys);
	if( subsys == null ) {
	    subsys = new SubSysLcdManager();
	    subs.put(sys, subsys);
	}
	
	subsys.addModelLcd(id, lcd);
    
public abstract intgetEngineBoots()
Returns the number of time the engine rebooted.

return
The number of reboots or -1 if the information is not present in the Lcd.

public abstract java.lang.StringgetEngineId()
Returns the engine Id located in the Lcd.

return
The engine Id or null if the information is not present in the Lcd.

public com.sun.jmx.snmp.internal.SnmpModelLcdgetModelLcd(com.sun.jmx.snmp.internal.SnmpSubSystem sys, int id)
Gets an Lcd model.

param
sys The subsytem managing the model
param
id The model Id.
return
The Lcd model or null if no Lcd model were found.

	SubSysLcdManager subsys = (SubSysLcdManager) subs.get(sys);

	if(subsys == null) return null;

	return (SnmpModelLcd) subsys.getModelLcd(id);
    
public voidremoveModelLcd(com.sun.jmx.snmp.internal.SnmpSubSystem sys, int id)
Removes an Lcd model.

param
sys The subsytem managing the model.
param
id The model Id.


	SubSysLcdManager subsys = (SubSysLcdManager) subs.get(sys);
	if( subsys != null ) {
	    SnmpModelLcd lcd = subsys.removeModelLcd(id);
	    if(lcd == null) {
		throw new SnmpUnknownModelLcdException("Model : " + id);
	    }
	}
	else
	    throw new SnmpUnknownSubSystemException(sys.toString());
    
public abstract voidstoreEngineBoots(int i)
Persists the number of reboots.

param
i Reboot number.

public abstract voidstoreEngineId(com.sun.jmx.snmp.SnmpEngineId id)
Persists the engine Id.

param
id The engine Id.