kaos.core.csi.extension.state
Interface StateManager

All Superinterfaces:
KAoSExtensionComponentManager

public interface StateManager
extends KAoSExtensionComponentManager

This interface defines a manager used to track the properties of a given state for a particular entity. Methods are provided for sensors to update the state and for interested parties to query the state.


Method Summary
 void deregisterState(java.lang.String stateId)
          This method is used to remove a state instance
 java.util.Set<java.lang.String> getPropertyValueForState(java.lang.String stateId, java.lang.String propertyName)
          This method is used to get the property value for a particular state
 OntInstanceDescription getStateInstance(java.lang.String stateId)
          This method is used to get the OntInstanceDescription for a state instance
 java.util.Collection<OntInstanceDescription> getStates()
          This method will return a list of OntInstanceDescriptions representing known state
 java.util.List<OntInstanceDescription> getStatesOfClass(java.lang.String stateClassName)
          This method will return a list of OntInstanceDescriptions that contain the state class name
 java.util.Set<java.lang.String> getSubjectWithState(OntClassDescription state)
          This method is used to get the subjects with a particular state
 boolean isStateSatisfied(OntClassDescription state)
          This method check if the state class is satisfied (matched) by any of the actual state in the state manger
 void registerAsListenerForState(StateUpdateListener listener)
          register as a listener for all state changes
 void registerAsListenerForStateClass(java.lang.String stateClass, StateUpdateListener listener)
          register as a listener for a particular state
 void registerAsListenerForStateInstance(java.lang.String stateID, StateUpdateListener listener)
          register as a listener for a particular state
 void registerInterest(OntClassDescription policyConditionDesc)
           
 void registerState(OntInstanceDescription stateInstance)
          This method is used to add a new state to the database (and its properties if included)
 void registerState(java.lang.String stateId, java.lang.String stateClassName)
          This method is used to add a new state to the database
 void removePropertyFromState(java.lang.String stateId, java.lang.String propertyName)
          This method is used to remove a property from a state
 void updateStateProperties(java.lang.String stateId, java.util.List<OntPropertyDescription> updatedproperties)
          This method is used to add or update properties of a state
 void updateStateProperty(java.lang.String stateId, OntPropertyDescription updatedproperty)
          This method is used to add or update properties of a state
 
Methods inherited from interface kaos.core.csi.extension.KAoSExtensionComponentManager
changeComponentEnabledStatus, deregisterComponent, getAllKAoSExtensionComponents, getComponent, getComponentEnabledStatus, getRepositoryManagerType, getRepositoryTableInformation, loadConfiguration, registerComponent, removeAllKAoSExtensionComponents
 

Method Detail

registerState

void registerState(OntInstanceDescription stateInstance)
This method is used to add a new state to the database (and its properties if included)

Parameters:
stateInstance - the description of the state instance to add

registerState

void registerState(java.lang.String stateId,
                   java.lang.String stateClassName)
                   throws java.net.URISyntaxException
This method is used to add a new state to the database

Parameters:
stateId - the unique identifier of the instance
stateClassName - the class of the instance
Throws:
java.net.URISyntaxException - is URI is invalid

deregisterState

void deregisterState(java.lang.String stateId)
This method is used to remove a state instance

Parameters:
stateId - the unique identifier of the state instance to remove

updateStateProperty

void updateStateProperty(java.lang.String stateId,
                         OntPropertyDescription updatedproperty)
                         throws java.lang.Exception
This method is used to add or update properties of a state

Parameters:
stateId - the unique instance id
propertyName - the name of the property
propertyValue - the value of the property
Throws:
java.lang.Exception - if no state with that stateId is registered

updateStateProperties

void updateStateProperties(java.lang.String stateId,
                           java.util.List<OntPropertyDescription> updatedproperties)
                           throws java.lang.Exception
This method is used to add or update properties of a state

Parameters:
stateId - the unique instance id
properties - map of property name -> value
Throws:
java.lang.Exception - if no state with that stateId is registered

removePropertyFromState

void removePropertyFromState(java.lang.String stateId,
                             java.lang.String propertyName)
                             throws java.lang.Exception
This method is used to remove a property from a state

Parameters:
stateId - the unique identifier of the state instance
propertyName - t-remove property property to remove
Throws:
java.lang.Exception - if no state of that stateId is registered

getStates

java.util.Collection<OntInstanceDescription> getStates()
This method will return a list of OntInstanceDescriptions representing known state

Returns:
a list of OntInstanceDescriptions containing state

getStatesOfClass

java.util.List<OntInstanceDescription> getStatesOfClass(java.lang.String stateClassName)
This method will return a list of OntInstanceDescriptions that contain the state class name

Parameters:
stateClassName - name of the class of interest
Returns:
a list of OntInstanceDescriptions containing the class name of interest

getStateInstance

OntInstanceDescription getStateInstance(java.lang.String stateId)
This method is used to get the OntInstanceDescription for a state instance

Parameters:
stateId - the unique identifier of the state instance
Returns:
the description of the state instance

getPropertyValueForState

java.util.Set<java.lang.String> getPropertyValueForState(java.lang.String stateId,
                                                         java.lang.String propertyName)
                                                         throws java.lang.Exception
This method is used to get the property value for a particular state

Parameters:
stateId - the unique identifier of the state instance
propertyName - the name of the property of interest
Returns:
the value of the property
Throws:
java.lang.Exception - if state or property does not exist

isStateSatisfied

boolean isStateSatisfied(OntClassDescription state)
This method check if the state class is satisfied (matched) by any of the actual state in the state manger

Parameters:
state - the state class to by matched with existing states
Returns:
true if matching state found

getSubjectWithState

java.util.Set<java.lang.String> getSubjectWithState(OntClassDescription state)
This method is used to get the subjects with a particular state

Parameters:
state - the state class to by matched with existing states
Returns:
the set of subject possessing the given state

registerAsListenerForState

void registerAsListenerForState(StateUpdateListener listener)
register as a listener for all state changes

Parameters:
listener - interface of recipient of update

registerAsListenerForStateClass

void registerAsListenerForStateClass(java.lang.String stateClass,
                                     StateUpdateListener listener)
register as a listener for a particular state

Parameters:
stateClass - String representing state class of interest
listener - interface of recipient of updates

registerAsListenerForStateInstance

void registerAsListenerForStateInstance(java.lang.String stateID,
                                        StateUpdateListener listener)
register as a listener for a particular state

Parameters:
stateID - String representing instance id of the state of interest
listener - interface of recipient of updates

registerInterest

void registerInterest(OntClassDescription policyConditionDesc)


Copyright © 2006 IHMC All Rights Reserved.