Commit 4c8a7824 authored by helene ortiz's avatar helene ortiz
Browse files

Changes for NomadServerGUI

parent 2c6e94e2
......@@ -792,8 +792,8 @@ public class PropertyManager {
/**
* Returns a sorted set containing all property names for given controller.
* @param controllerType controller type
* @return a set containing all property names for given controller type
* @param controllerName controller name
* @return a set containing all property names for given controller name
*/
public Set<String> getPropertiesForController(String controllerName) {
int servantId = ServantDatabase.getInstance().getServantId(controllerName);
......@@ -809,6 +809,25 @@ public class PropertyManager {
return properties;
}
/**
* Returns a sorted set containing all dynamic property names for given controller.
* @param controllerName controller name
* @return a set containing all dynamic property names for given controller name
*/
public Set<String> getDynamicPropertiesForController(String controllerName) {
int servantId = ServantDatabase.getInstance().getServantId(controllerName);
SortedSet<String> properties = new TreeSet<String>();
Map<String, String> namesAndTypes = PropertyDatabase.getInstance().getDynamicPropertyNamesAndTypes(servantId);
if (namesAndTypes != null) {
properties.addAll(namesAndTypes.keySet());
} else {
System.out.println("property map has no entries for " + controllerName);
}
return properties;
}
/**
*
* @param controller
......
......@@ -113,8 +113,8 @@ public class PropertyDatabase {
spyPropertiesByServant.get(servantId).add(descriptor);
// System.out.println("spy property for servant " + servantId);
// System.out.println(descriptor);
// System.out.println("spy property for servant " + servantId);
// System.out.println(descriptor);
}
/**
......@@ -168,6 +168,26 @@ public class PropertyDatabase {
}
/**
*
* @param servantId
* @return
*/
public Map<String, String> getDynamicPropertyNamesAndTypes(int servantId) {
Map<String, String> namesAndTypes = new HashMap<String, String>();
Set<DynamicPropertyDescriptor> propertyDescriptors = dynamicPropertiesByServant.get(servantId);
if (propertyDescriptors != null) {
Iterator<DynamicPropertyDescriptor> it = propertyDescriptors.iterator();
while (it.hasNext()) {
DynamicPropertyDescriptor descriptor = it.next();
namesAndTypes.put(descriptor.getName(), descriptor.getType());
}
}
return namesAndTypes;
}
/**
*
* @param id
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment