@Override public boolean containsKey(Object arg0) { return node.getChild(arg0) != null; }
public static Set getChildrenNames(Cache cache, Fqn fqn) { Node node = cache.getRoot().getChild(fqn); return (node != null) ? node.getChildrenNames() : Collections.emptySet(); }
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; }
@Override @SuppressWarnings("unchecked") public V get(Object arg0) { Node child = node.getChild(arg0); if (child == null) return null; return (V) child.get(KEY); }
public Map<String, String> getSipApplicationSessionKeys() { 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(); storeSipApplicationSessionOwners(ids, (String) owner.getFqn() .getLastElement(), result); } } } } storeSipApplicationSessionOwners(jBossCacheService.getChildrenNames(sipappFqn), null, result); return result; }
public static Set getChildrenNames(Cache cache, Fqn fqn) { Node node = cache.getRoot().getChild(fqn); return (node != null) ? node.getChildrenNames() : Collections.emptySet(); }
@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 SIPDialog getDialog(String dialogId) throws SipCacheException { try { Node dialogNode = ((Node) dialogRootNode.getChild(Fqn.fromString(dialogId))); if(dialogNode != null) { return (SIPDialog) dialogNode.get(dialogId); } else { return null; } } catch (CacheException e) { throw new SipCacheException("A problem occured while retrieving the following dialog " + dialogId + " from JBoss Cache", e); } }
public SIPServerTransaction getServerTransaction(String transactionId) throws SipCacheException { try { Node serverTransactionNode = ((Node) serverTxRootNode.getChild(Fqn.fromString(transactionId))); if(serverTransactionNode != null) { return (SIPServerTransaction) serverTransactionNode.get(transactionId); } else { return null; } } catch (CacheException e) { throw new SipCacheException("A problem occured while retrieving the following server transaction " + transactionId + " from JBoss Cache", e); } }
public SIPClientTransaction getClientTransaction(String transactionId) throws SipCacheException { try { Node clientTransactionNode = ((Node) clientTxRootNode.getChild(Fqn .fromString(transactionId))); if (clientTransactionNode != null) { return (SIPClientTransaction) clientTransactionNode .get(transactionId); } else { return null; } } catch (CacheException e) { throw new SipCacheException( "A problem occured while retrieving the following client transaction " + transactionId + " from JBoss Cache", e); } }
public void updateDialog(SIPDialog sipDialog) throws SipCacheException { Node dialogNode = ((Node) dialogRootNode.getChild(Fqn.fromString(sipDialog.getDialogId()))); if(dialogNode != null) { if(dialogNode != null) { sipDialog = (SIPDialog) dialogNode.get(sipDialog.getDialogId()); } } }
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; }
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)); } } }
public Map<String, Object> getSipApplicationSessionAttributes( String sipApplicationSessionKey) { if (sipApplicationSessionKey == null) { @SuppressWarnings("unchecked") Map<String, Object> empty = Collections.EMPTY_MAP; return empty; } Fqn<String> fqn = delegate.getSipApplicationSessionFqn(combinedPath_, sipApplicationSessionKey); Node<Object, Object> node = getCache().getRoot().getChild(Fqn.fromString(fqn.toString() + "/" + AbstractJBossCacheService.ATTRIBUTE_KEY)); Map<Object, Object> rawData = node.getData(); return getSessionAttributes(null, rawData); }
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; }
private Node getInternalNode(Node parent, Fqn internalFqn) { Object name = internalFqn.get(parent.getFqn().size()); cache.getInvocationContext().getOptionOverrides().setSkipCacheStatusCheck(true); Node result = parent.getChild(name); if (result != null && internalFqn.size() < result.getFqn().size()) { // need to recursively walk down the tree result = getInternalNode(result, internalFqn); } return result; }
added = root.getChild(fqn);
added = root.getChild(fqn);