private Fqn getFqn(Object o) { if (o instanceof Node) return ((Node) o).getFqn(); if (o instanceof InternalNode) return ((InternalNode) o).getFqn(); throw new IllegalArgumentException(); }
private Fqn getFqn(Object o) { if (o instanceof Node) return ((Node) o).getFqn(); if (o instanceof InternalNode) return ((InternalNode) o).getFqn(); throw new IllegalArgumentException(); }
private Set<Node> retainInternalNodes(Node target) { Set<Node> result = new HashSet<Node>(); Fqn targetFqn = target.getFqn(); for (Fqn internalFqn : internalFqns) { if (internalFqn.isChildOf(targetFqn)) { Node internalNode = getInternalNode(target, internalFqn); if (internalNode != null) { result.add(internalNode); } } } return result; }
private Set<Fqn> retainInternalNodes(Fqn target) { Set<Fqn> result = new HashSet<Fqn>(); for (Fqn internalFqn : internalFqns) { if (internalFqn.isChildOf(target)) { prepareContextOptions(); Node node = getInternalNode(cache.getNode(target), internalFqn); if (node != null) { result.add(node.getFqn()); } } } return result; }
public void evictDialog(String dialogId) { cache.evict(Fqn.fromElements(dialogRootNode.getFqn(), Fqn.fromString(dialogId))); }
private void integrateRetainedNodes(NodeSPI target) { Set<Node> retainedNodes = retainInternalNodes(target); Fqn rootFqn = target.getFqn(); for (Node retained : retainedNodes) { if (retained.getFqn().isChildOf(rootFqn)) { integrateRetainedNode(target, retained); } } }
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; }
String profileName = profileNode.getFqn() .toString().substring( (profileManager.getRootFqn() + "/profile:"
Node profileNode = (Node) it.next(); String profileName = profileNode .getFqn() .toString() .substring(("/" + key + "/").length());
private void migrateDefunctData(NodeSPI backupRoot, Address dataOwner) { Fqn defunctBackupRootFqn = getDefunctBackupRootFqn(dataOwner); if (log.isDebugEnabled()) log.debug("Migrating defunct data. Backup root is " + backupRoot + ". New backup root is " + defunctBackupRootFqn); if (trace) log.trace("Children of backup root are " + backupRoot.getChildren()); String ownerName = buddyFqnTransformer.getGroupNameFromAddress(dataOwner); Set<DefunctDataHistory> newHistorySet = new ConcurrentHashSet<DefunctDataHistory>(); Set<DefunctDataHistory> historySet = defunctDataHistory.putIfAbsent(ownerName, newHistorySet); if (historySet == null) { historySet = newHistorySet; } DefunctDataHistory history = new DefunctDataHistory(dataOwner, (Integer) defunctBackupRootFqn.getLastElement(), System.currentTimeMillis()); historySet.add(history); for (Object child : backupRoot.getChildren()) { Fqn childFqn = ((Node) child).getFqn(); cache.getInvocationContext().getOptionOverrides().setCacheModeLocal(true); cache.move(childFqn, defunctBackupRootFqn); } history.recordDataMoved(); cache.getInvocationContext().getOptionOverrides().setCacheModeLocal(true); backupRoot.getParentDirect().removeChild(backupRoot.getFqn().getLastElement()); }
private void integrateRetainedNode(NodeSPI ancestor, Node descendant) Fqn descFqn = descendant.getFqn(); Fqn ancFqn = ancestor.getFqn(); Object name = descFqn.get(ancFqn.size());
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; }
if (trace) log.trace("Found node " + actualNode.getFqn() + " but it is not valid. Returning 'no data found'", e); return GravitateResult.noDataFound();