private void disposeItem ( final Extractor extractor, final String localId ) { logger.debug ( "Dispose item: {}", localId ); final Map<String, DataItemInputChained> cache = this.itemCache.get ( extractor ); final DataItemInputChained item = cache.remove ( localId ); if ( item == null ) { logger.debug ( "Item not found" ); return; } this.storage.removed ( new org.eclipse.scada.da.server.browser.common.query.ItemDescriptor ( item, null ) ); this.itemFactory.disposeItem ( localId ); }
/** * Unregister everything from the hive */ protected synchronized void unregisterAllItems () { for ( final Map.Entry<String, OPCItem> entry : this.itemMap.entrySet () ) { final OPCItem item = entry.getValue (); this.hive.unregisterItem ( item ); this.allItemsStorage.removed ( new ItemDescriptor ( item, new HashMap<String, Variant> () ) ); } this.itemMap.clear (); }
private void disposeItem ( final Extractor extractor, final String localId ) { logger.debug ( "Dispose item: {}", localId ); final Map<String, DataItemInputChained> cache = this.itemCache.get ( extractor ); final DataItemInputChained item = cache.remove ( localId ); if ( item == null ) { logger.debug ( "Item not found" ); return; } this.storage.removed ( new org.eclipse.scada.da.server.browser.common.query.ItemDescriptor ( item, null ) ); this.itemFactory.disposeItem ( localId ); }
@Override public void registerItem(final DataItem item) { super.registerItem(item); this.storage.added(new ItemDescriptor(item, Collections.<String, Variant>emptyMap())); }
@Override public void unregisterItem(final DataItem item) { this.storage.removed(new ItemDescriptor(item, Collections.<String, Variant>emptyMap())); super.unregisterItem(item); }
private void unregisterItem ( final String itemId ) { logger.info ( "Unregistering item: {}", itemId ); final OPCItem item; synchronized ( this ) { item = this.itemMap.remove ( itemId ); if ( item == null ) { return; } setRegisteredItemCount ( this.itemMap.size () ); this.hive.unregisterItem ( item ); } item.itemUnrealized (); this.allItemsStorage.removed ( new ItemDescriptor ( item, null ) ); } }
private DataItemInputChained createItem ( final Extractor extractor, final String prefix, final ItemDescriptor descriptor ) { final String localId = makeId ( prefix, descriptor.getLocalId () ); final DataItemInputChained item = this.itemFactory.createInput ( localId, descriptor.getAttributes () ); Map<String, DataItemInputChained> cache = this.itemCache.get ( extractor ); if ( cache == null ) { cache = new HashMap<> (); this.itemCache.put ( extractor, cache ); } cache.put ( localId, item ); this.storage.added ( new org.eclipse.scada.da.server.browser.common.query.ItemDescriptor ( item, descriptor.getAttributes () ) ); return item; }
private DataItemInputChained createItem ( final Extractor extractor, final String prefix, final ItemDescriptor descriptor ) { final String localId = makeId ( prefix, descriptor.getLocalId () ); final DataItemInputChained item = this.itemFactory.createInput ( localId, descriptor.getAttributes () ); Map<String, DataItemInputChained> cache = this.itemCache.get ( extractor ); if ( cache == null ) { cache = new HashMap<> (); this.itemCache.put ( extractor, cache ); } cache.put ( localId, item ); this.storage.added ( new org.eclipse.scada.da.server.browser.common.query.ItemDescriptor ( item, descriptor.getAttributes () ) ); return item; }
public DataItemInputChained createInput ( final String localId, final Map<String, Variant> attributes ) { final DataItemInputChained item = new DataItemInputChained ( new DataItemInformationBase ( makeId ( localId ), EnumSet.of ( IODirection.INPUT ) ), this.hive.getOperationService () ); final org.eclipse.scada.da.server.browser.common.query.ItemDescriptor desc = new org.eclipse.scada.da.server.browser.common.query.ItemDescriptor ( item, attributes ); this.hive.registerItem ( item ); this.storage.added ( desc ); this.items.put ( localId, desc ); return item; }
this.allItemsStorage.added ( new ItemDescriptor ( item, browserMap ) );
private SNMPItem createItem ( final OID oid ) { String itemId; if ( oid.size () > 0 ) { itemId = oid.toString (); } else { itemId = ""; } final String id = getItemIDPrefix () + "." + itemId; final SNMPItem item = new SNMPItem ( this, id, oid ); final MapBuilder<String, Variant> builder = new MapBuilder<String, Variant> (); builder.put ( "snmp.oid", Variant.valueOf ( oid.toString () ) ); if ( this.mibManager != null ) { this.mibManager.fillAttributes ( oid.toString (), builder ); } this.storage.added ( new ItemDescriptor ( item, builder.getMap () ) ); ChainCreator.applyDefaultInputChain ( item ); this.hive.registerItem ( item ); return item; }