Framework Professional Edition Package


org.mbs.services.cu.generator
Interface ControlUnitModel

All Known Implementing Classes:
AbstractDeviceModel, DefaultControlUnitModel

public interface ControlUnitModel

Control unit model interface. A model holds the current state of a control unit.

Author:
Stoyan Zoubev

Method Summary
 CUAdminCallback getControlUnitCallback()
          Returns control unit callback.
 java.lang.String getId()
          Returns the CU Id for which this object is model.
 java.lang.String getType()
          Returns the CU TYPE for which this object is model.
 java.lang.Object queryStateVariable(java.lang.String varId)
          Retrieves state variable value by its Id.
 void release()
          Free the resources for the model.
 void reset()
          Resets the model.
 void setControlUnitCallback(CUAdminCallback callback)
           
 boolean updateSV(java.lang.String stateVarId, java.lang.Object stateVarValue)
          Check if the old value of the state variable stateVarId is different from the new one and notify all listeners that have registered interest in the stateVar with id stateVarId
 

Method Detail

updateSV

boolean updateSV(java.lang.String stateVarId,
                 java.lang.Object stateVarValue)
Check if the old value of the state variable stateVarId is different from the new one and notify all listeners that have registered interest in the stateVar with id stateVarId

Parameters:
stateVarId - state variable id
stateVarValue - the new value for the state variable
Returns:
if the stateVariable value was changed

queryStateVariable

java.lang.Object queryStateVariable(java.lang.String varId)
                                    throws java.lang.IllegalArgumentException
Retrieves state variable value by its Id. The state variable can be mapped directly or indirectly to the state variables of device for the particular protocol.

Parameters:
varId - the id of required state variable.
Returns:
requested state variable value or throws IllegalArgumentException if it was not found.
Throws:
java.lang.IllegalArgumentException - if there is no state variable with this Id in this control unit

getId

java.lang.String getId()
Returns the CU Id for which this object is model.

Returns:
the CU Id for which this object is model.

getType

java.lang.String getType()
Returns the CU TYPE for which this object is model.

Returns:
the CU TYPE for which this object is model.

reset

void reset()
           throws java.lang.Exception
Resets the model. The model tries to restore its initial values.

Throws:
java.lang.Exception - thrown if error during reset occurs

release

void release()
Free the resources for the model.


setControlUnitCallback

void setControlUnitCallback(CUAdminCallback callback)
See Also:
org.msb.services.cu.spi.ManagedControlUnit#setControlUnitCallback(org.msb.services.cu.spi.CUAdminCallback)

getControlUnitCallback

CUAdminCallback getControlUnitCallback()
Returns control unit callback.

See Also:
org.msb.services.cu.spi.ManagedControlUnit#setControlUnitCallback(org.msb.services.cu.spi.CUAdminCallback)

Framework Professional Edition Package


Copyright © 1999-2007 ProSyst Software GmbH. All Rights Reserved