Framework Professional Edition Package


org.mbs.services.device.abstractdriver
Class DeviceStateGraph

java.lang.Object
  extended by org.mbs.services.device.abstractdriver.DeviceStateGraph
All Implemented Interfaces:
TagListener

public class DeviceStateGraph
extends java.lang.Object
implements TagListener

This class represents device state graph. Device state graph is loaded from XML file following the syntax described in stategraph.dtd.

Note: This class is not fully implemented yet!

Since:
$Date: 2004/09/15 15:46:23 $
Author:
Stoyan Zoubev

Constructor Summary
DeviceStateGraph(org.osgi.framework.BundleContext bc, java.io.InputStream is)
           
 
Method Summary
 java.lang.String getCurrentState(AbstractDeviceModel model, java.lang.String lastState)
          Evaluate state conditions upon the given device model and return the id of the state which condition is satisfied.
 boolean isActionAllowed(java.lang.String currentState, java.lang.String actionId)
          Check if the given action id is in the list of allowed actions of the current state.
 boolean isModelInconsistent(java.lang.String currentState, java.lang.String stateVarId)
          Check if the given state variable id is in the list of possible state var events of the current state.
static boolean isStateVariableIgnored(java.lang.String stateVarId)
           
 void useTag(TagClass tag)
          Invoked when a tag has been closed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeviceStateGraph

public DeviceStateGraph(org.osgi.framework.BundleContext bc,
                        java.io.InputStream is)
                 throws java.io.IOException
Throws:
java.io.IOException
Method Detail

useTag

public void useTag(TagClass tag)
Description copied from interface: TagListener
Invoked when a tag has been closed

Specified by:
useTag in interface TagListener
Parameters:
tag - tag with its content and its subtags
See Also:
TagListener.useTag(com.prosyst.util.xml.TagClass)

getCurrentState

public java.lang.String getCurrentState(AbstractDeviceModel model,
                                        java.lang.String lastState)
Evaluate state conditions upon the given device model and return the id of the state which condition is satisfied.

Parameters:
model - the device model
lastState - the previous state, necessary to validate the transition. The parameter may be null if the model is initialized.
Returns:
the id of the current state of the device

isModelInconsistent

public boolean isModelInconsistent(java.lang.String currentState,
                                   java.lang.String stateVarId)
Check if the given state variable id is in the list of possible state var events of the current state.

Parameters:
currentState - the id of the current state
stateVarId - the id of the state variable
Returns:
true if the given state variable id is NOT in the list of possible state var events of the current state.

isStateVariableIgnored

public static boolean isStateVariableIgnored(java.lang.String stateVarId)

isActionAllowed

public boolean isActionAllowed(java.lang.String currentState,
                               java.lang.String actionId)
Check if the given action id is in the list of allowed actions of the current state.

Parameters:
currentState - the id of the current state
actionId - the id of the action
Returns:
true if the given state variable id is in the list of possible state var events of the current state.

Framework Professional Edition Package


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