/** * Constructs a new resource with the specified name and makes it visible to * clients if the flag is true. * * @param name the name * @param visible if the resource is visible */ public CoapResource(String name, boolean visible) { this.name = name; this.path = ""; this.setVisible(visible); this.attributes = new ResourceAttributes(); this.children = new ConcurrentHashMap<String, Resource>(); this.observers = new CopyOnWriteArrayList<ResourceObserver>(); this.observeRelations = new ObserveRelationContainer(); this.notificationOrderer = new ObserveNotificationOrderer(); }
well_known.setVisible(false); well_known.add(new DiscoveryResource(root)); root.add(well_known);
wellKnown.setVisible(false); wellKnown.add(new DiscoveryResource(root)); root.add(wellKnown);