public class ConfigMasterModule extends cz.cuni.amis.pogamut.base.agent.module.SensomotoricModule<USAR2004Bot>
| Modifier and Type | Field and Description |
|---|---|
protected ConfigContainer |
configModules |
protected cz.cuni.amis.pogamut.usar2004.agent.module.master.ConfigMasterModule.ConfigurationMessageListener |
confListener |
protected static ConfigMasterModule |
singleton |
| Modifier and Type | Method and Description |
|---|---|
protected void |
cleanUp() |
protected SuperConfiguration |
createNewSensor(ConfigurationMessage message)
Asks ConfigType enum if it knows ConfigType represented by string
type.
|
protected void |
fileMessage(ConfigurationMessage message)
Updates previous State on genuine Sensor or creates a new Record.
|
SuperConfiguration |
getConfigurationByTypeName(String type,
String name)
Gets configuration message representatives from local hashmap specified
by type and by name.
|
List<SuperConfiguration> |
getConfigurationsByClass(Class clazz)
Adds every object that can be casted to initial class to the output list.
|
List<SuperConfiguration> |
getConfigurationsByConfigType(ConfigType type)
Note, that if type = UNKNOWN it returns all unknown
Configurations.
|
List<SuperConfiguration> |
getConfigurationsByType(String type) |
static ConfigMasterModule |
getModuleInstance(USAR2004Bot bot)
Method for obtaining the singleton.
|
List<MessageDescriptor> |
getNonEmptyDescription()
For each type of Configuration it adds all individuals to the returnee
List as a couple (Type, Name)
|
Boolean |
isReady()
Collection of sensor data check.
|
void |
queryConfigurationByType(String type)
Sends GETCONF message with specified type.
|
void |
queryConfigurationByTypeName(String type,
String name)
Sends GETCONF message with specified type and name.
|
protected boolean |
updateSensorCollection(ConfigurationMessage message)
Returns a flag that indicates if sensorUpdate was successful.
|
protected cz.cuni.amis.pogamut.usar2004.agent.module.master.ConfigMasterModule.ConfigurationMessageListener confListener
protected static ConfigMasterModule singleton
protected ConfigContainer configModules
public static ConfigMasterModule getModuleInstance(USAR2004Bot bot)
bot - USAR2004Bot parameter for creation of the singleton instance
when called for the first time.public Boolean isReady()
public List<SuperConfiguration> getConfigurationsByClass(Class clazz)
c - Class representing the type of which the return list should bepublic List<SuperConfiguration> getConfigurationsByType(String type)
type - String representing the type of Configuration to returnpublic List<SuperConfiguration> getConfigurationsByConfigType(ConfigType type)
type - ConfigurationType representing the type of Configuration to
returnpublic SuperConfiguration getConfigurationByTypeName(String type, String name)
type - String representing the type of configuration to return.name - String representing the name of configuration to return.public List<MessageDescriptor> getNonEmptyDescription()
public void queryConfigurationByType(String type)
type - type of Configuration data we want to know about. For example
: Sonar, MisPkg, Robot, Effecter, etc..public void queryConfigurationByTypeName(String type, String name)
type - type of Configuration data we want to know about. For example
: Sonar, MisPkg, Robot, Effecter, etc..name - of sensor/effecter. Can be omitted.protected SuperConfiguration createNewSensor(ConfigurationMessage message)
type - String representing possible valid ConfigType.protected boolean updateSensorCollection(ConfigurationMessage message)
message - protected void fileMessage(ConfigurationMessage message)
message - This ought to be SensorMessage caught by listener.protected void cleanUp()
cleanUp in class cz.cuni.amis.pogamut.base.agent.module.AgentModule<USAR2004Bot>Copyright © 2013 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.