public static Set getChildrenNames(Cache cache, Fqn fqn) { Node node = cache.getRoot().getChild(fqn); return (node != null) ? node.getChildrenNames() : Collections.emptySet(); }
@Override public void clear() { for (Object o : node.getChildrenNames()) node.removeChild(o); }
@Override @SuppressWarnings("unchecked") public V remove(Object arg0) { Node child = node.getChild(arg0); if (child == null) return null; V o = (V) child.remove(KEY); node.removeChild(arg0); return o; }
public Map<String, String> getSipSessionKeys() { Map<String, String> result = new HashMap<String, String>(); Fqn<String> sipappFqn = getSipappFqn(); Node<Object, Object> bbRoot = jBossCacheService.getCache().getRoot() .getChild(jBossCacheService.BUDDY_BACKUP_FQN); if (bbRoot != null) { Set<Node<Object, Object>> owners = bbRoot.getChildren(); if (owners != null) { for (Node<Object, Object> owner : owners) { @SuppressWarnings("unchecked") Node sipRoot = owner.getChild(sipappFqn); if (sipRoot != null) { @SuppressWarnings("unchecked") Set<String> ids = sipRoot.getChildrenNames(); storeSipSessionOwners(ids, (String) owner.getFqn() .getLastElement(), result); } } } } storeSipSessionOwners(jBossCacheService.getChildrenNames(sipappFqn), null, result); return result; }
added = root.addChild( fqn ); added = root.getChild(fqn); added.setResident(true); return added;
regionRoot = jbcCache.getRoot().getChild( regionFqn ); if (regionRoot == null || !regionRoot.isValid()) { if (!regionRoot.isResident()) { regionRoot.setResident(true);
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)); } } }
public Map<String, Object> getSipSessionAttributes( String sipApplicationSessionKey, String sipSessionKey) { if (sipSessionKey == null) { @SuppressWarnings("unchecked") Map<String, Object> empty = Collections.EMPTY_MAP; return empty; } Fqn<String> fqn = delegate.getSipSessionFqn(combinedPath_, sipApplicationSessionKey, sipSessionKey); Node<Object, Object> node = getCache().getRoot().getChild(Fqn.fromString(fqn.toString() + "/" + AbstractJBossCacheService.ATTRIBUTE_KEY)); Map<Object, Object> rawData = node.getData(); return getSessionAttributes(null, rawData); }
private Node getInternalNode(Node parentNode, Fqn internalFqn) { Fqn parentFqn = parentNode.getFqn(); Object name = internalFqn.get(parentFqn.size()); prepareContextOptions(); Node result = parentNode.getChild(name); if (result != null && internalFqn.size() < result.getFqn().size()) { // need to recursively walk down the tree result = getInternalNode(result, internalFqn); } return result; }
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; }
if (regionRoot != null && regionRoot.isValid()) { return; regionRoot = jbcCache.getRoot().getChild( regionFqn ); return; newRoot = jbcCache.getRoot().getChild( regionFqn ); if (newRoot == null || !newRoot.isValid()) { newRoot.setResident(true);
actualNode.getData(); actualNode.getChildrenNames(); if (trace) log.trace("Found node " + actualNode.getFqn() + " but it is not valid. Returning 'no data found'", e); return GravitateResult.noDataFound();
private Fqn getFqn(Object o) { if (o instanceof Node) return ((Node) o).getFqn(); if (o instanceof InternalNode) return ((InternalNode) o).getFqn(); throw new IllegalArgumentException(); }
@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(); } }
/** * getData returns a snapshot of the data. */ @Override public Set<Map.Entry<K, V>> entrySet() { return node.getData().entrySet(); }
public void start() throws SipCacheException { try { cache.start(); } catch (Exception e) { throw new SipCacheException("Couldn't start JBoss Cache", e); } dialogRootNode = cache.getRoot().getChild(SipCache.DIALOG_PARENT_FQN_ELEMENT); if(dialogRootNode == null) { dialogRootNode = cache.getRoot().addChild(Fqn.fromElements(SipCache.DIALOG_PARENT_FQN_ELEMENT)); } if(clusteredSipStack.getReplicationStrategy() == ReplicationStrategy.EarlyDialog) { serverTxRootNode = cache.getRoot().getChild(SipCache.SERVER_TX_PARENT_FQN_ELEMENT); if(serverTxRootNode == null) { serverTxRootNode = cache.getRoot().addChild(Fqn.fromElements(SipCache.SERVER_TX_PARENT_FQN_ELEMENT)); } } }
Map profiles = childNode.getChildren(); if (profiles != null) { Iterator profilesIt = profiles.values().iterator(); String profileName = profileNode.getFqn() .toString().substring( (profileManager.getRootFqn() + "/profile:"
@Override @SuppressWarnings("unchecked") public V get(Object key) { return node.get((K) key); }