/** * Returns a {@link Map}, where map entries are partitioned into child nodes, * within the cache root, by key hash code. * * @param cache cache to use * @return a Map representation of the cache */ public static <K, V> Map<K, V> asPartitionedMap(Cache<K, V> cache) { return asPartitionedMap(cache.getRoot()); }
/** * Returns a {@link Map} from the root node. * * @param cache cache to wrap as a map * @return a map representation of the cache * @see #asMap(Node) */ public static <K, V> Map<K, V> asMap(Cache<K, V> cache) { if (cache == null) throw new NullPointerException("cache"); return asMap(cache.getRoot()); }
public static Set getChildrenNames(Cache cache, Fqn fqn) { Node node = cache.getRoot().getChild(fqn); return (node != null) ? node.getChildrenNames() : Collections.emptySet(); }
public static Set getChildrenNames(Cache cache, Fqn fqn) { Node node = cache.getRoot().getChild(fqn); return (node != null) ? node.getChildrenNames() : Collections.emptySet(); }
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 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 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); }
regionRoot = jbcCache.getRoot().getChild( regionFqn ); if (regionRoot == null || !regionRoot.isValid()) {
regionRoot = jbcCache.getRoot().getChild( regionFqn ); if (regionRoot == null || !regionRoot.isValid()) {
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; }
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; }
Node root = cache.getRoot(); setInvocationOption(cache, option);
Node root = cache.getRoot(); setInvocationOption(cache, option);