+ public void setInventoryService(IInventoryService service) {
+ logger.trace("Got inventory service set request {}", service);
+ this.inventoryService = service;
+ }
+
+ public void unsetInventoryService(IInventoryService service) {
+ logger.trace("Got a service UNset request");
+ this.inventoryService = null;
+ }
+
+ private void getInventories() {
+ Map<Node, Map<String, Property>> nodeProp = this.inventoryService.getNodeProps();
+ for (Map.Entry<Node, Map<String, Property>> entry : nodeProp.entrySet()) {
+ Node node = entry.getKey();
+ logger.debug("getInventories for node:{}", new Object[] { node });
+ Map<String, Property> propMap = entry.getValue();
+ Set<Property> props = new HashSet<Property>();
+ for (Property property : propMap.values()) {
+ props.add(property);
+ }
+ updateNode(node, UpdateType.ADDED, props);
+ }
+
+ Map<NodeConnector, Map<String, Property>> nodeConnectorProp = this.inventoryService.getNodeConnectorProps();
+ for (Map.Entry<NodeConnector, Map<String, Property>> entry : nodeConnectorProp.entrySet()) {
+ Map<String, Property> propMap = entry.getValue();
+ Set<Property> props = new HashSet<Property>();
+ for (Property property : propMap.values()) {
+ props.add(property);
+ }
+ updateNodeConnector(entry.getKey(), UpdateType.ADDED, props);
+ }
+ }
+