+ return (nodeProps != null) ? new HashSet<Node>(nodeProps.keySet()) : new HashSet<Node>();
+ }
+
+ @Override
+ public Map<String, Property> getControllerProperties() {
+ return new HashMap<String, Property>(this.controllerProps);
+ }
+
+ @Override
+ public Property getControllerProperty(String propertyName) {
+ if (propertyName != null) {
+ HashMap<String, Property> propertyMap = new HashMap<String, Property>(this.controllerProps);
+ return propertyMap.get(propertyName);
+ }
+ return null;
+ }
+
+ @Override
+ public Status setControllerProperty(Property property) {
+ if (property != null) {
+ this.controllerProps.put(property.getName(), property);
+ return new Status(StatusCode.SUCCESS);
+ }
+ return new Status(StatusCode.BADREQUEST, "Invalid property provided when setting property");
+ }
+
+ @Override
+ public Status removeControllerProperty(String propertyName) {
+ if (propertyName != null) {
+ if (this.controllerProps.containsKey(propertyName)) {
+ this.controllerProps.remove(propertyName);
+ if (!this.controllerProps.containsKey(propertyName)) {
+ return new Status(StatusCode.SUCCESS);
+ }
+ }
+ String msg = "Unable to remove property " + propertyName + " from Controller";
+ return new Status(StatusCode.BADREQUEST, msg);
+ }
+ String msg = "Invalid property provided when removing property from Controller";
+ return new Status(StatusCode.BADREQUEST, msg);