@Override public Set<K> keySet() { return node.getKeys(); }
@Override public boolean containsKey(Object key) { return node.getKeys().contains(key); }
@Override public boolean contains(Object key) { return node.getKeys().contains(key); }
@Override public Iterator<K> iterator() { final Iterator i = node.getKeys().iterator(); return new Iterator<K>() { K key; boolean next = false; public boolean hasNext() { return i.hasNext(); } @SuppressWarnings("unchecked") public K next() { key = (K) i.next(); next = true; return key; } @SuppressWarnings("unchecked") public void remove() { if (!next) throw new IllegalStateException(); node.remove(key); } }; }
private void populateValues(Node<String, Object> cache, ArrayList<V> list) { Set<Node<String, Object>> children = cache.getChildren(); for (Node<String, Object> node : children) { Iterator<String> iterator = node.getKeys().iterator(); if (iterator.hasNext()) { String key = iterator.next(); V value = RuntimeUtils.<V> cast(node.get(key)); list.add(getClonedValue(value)); } } }
@Override public Collection<Ticket> getTickets() { try { final Node<String, Ticket> node = this.cache.getNode(FQN_TICKET); if (node == null) { return Collections.emptyList(); } final Set<String> keys = node.getKeys(); final List<Ticket> list = new ArrayList<>(); for (final String key : keys) { /** Returns null if the node contains no mapping for this key. **/ final Ticket ticket = node.get(key); if (ticket != null) { list.add(node.get(key)); } } return list; } catch (final CacheException e) { return Collections.emptyList(); } }
public Set<String> getSipApplicationSessionAttributeKeys( String sipApplicationSessionKey) { Set keys = null; Fqn<String> fqn = delegate.getSipApplicationSessionFqn(combinedPath_, sipApplicationSessionKey); try { Node<Object, Object> node = getCache().getRoot().getChild(Fqn.fromString(fqn.toString() + "/" + AbstractJBossCacheService.ATTRIBUTE_KEY)); if (node != null) { keys = node.getKeys(); keys.removeAll(INTERNAL_KEYS); } } catch (CacheException e) { log_.error( "getAttributeKeys(): Exception getting keys for session " + sipApplicationSessionKey, e); } return keys; }
public Set<String> getSipSessionAttributeKeys( String sipApplicationSessionKey, String sipSessionKey) { Set keys = null; Fqn<String> fqn = delegate.getSipSessionFqn(combinedPath_, sipApplicationSessionKey, sipSessionKey); try { Node<Object, Object> node = getCache().getRoot().getChild(Fqn.fromString(fqn.toString() + "/" + AbstractJBossCacheService.ATTRIBUTE_KEY)); if (node != null) { keys = node.getKeys(); keys.removeAll(INTERNAL_KEYS); } } catch (CacheException e) { log_.error( "getAttributeKeys(): Exception getting keys for session " + sipSessionKey, e); } return keys; }