- private void notifyInventoryShimListener(Node node, UpdateType type,
- Set<Property> props) {
- switch (type) {
- case ADDED:
- // Notify only the default Inventory Service
- IInventoryShimInternalListener inventoryShimDefaultListener = inventoryShimInternalListeners
- .get(GlobalConstants.DEFAULT.toString());
- if (inventoryShimDefaultListener != null) {
- inventoryShimDefaultListener.updateNode(node, type, props);
- }
- break;
- case REMOVED:
- // Notify all Inventory Service containers
- for (IInventoryShimInternalListener inventoryShimInternalListener : inventoryShimInternalListeners
- .values()) {
- inventoryShimInternalListener.updateNode(node, type, null);
- }
- break;
- case CHANGED:
- // Notify only the default Inventory Service
- inventoryShimDefaultListener = inventoryShimInternalListeners
- .get(GlobalConstants.DEFAULT.toString());
- if (inventoryShimDefaultListener != null) {
- inventoryShimDefaultListener.updateNode(node, type, props);
- }
- break;
- default:
- break;
+ private void notifyInventoryShimListener(Node node, UpdateType type, Set<Property> props) {
+ // Now notify other containers
+ Set<String> containers = (nodeContainerMap.get(node) == null) ? new HashSet<String>() : new HashSet<String>(
+ nodeContainerMap.get(node));
+ containers.add(GlobalConstants.DEFAULT.toString());
+ for (String container : containers) {
+ notifyInventoryShimInternalListener(container, node, type, props);