@Override @SuppressWarnings("unchecked") public V get(Object key) { return node.get((K) key); }
@Override @SuppressWarnings("unchecked") public V get(Object arg0) { Node child = node.getChild(arg0); if (child == null) return null; return (V) child.get(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 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); } }
@Override public Object get(String region, String key) { try { Node node = cache.get(getFqn(region)); if (node != null) { return node.get(key); } else { return null; } } catch (CacheException e) { throw new IllegalStateException(String.format("Cache throw exception when trying to get %s from region %s.", key, region), 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); } }
@Override public Object get(String region, String key) { try { Node node = cache.get(getFqn(region)); if (node != null) { return node.get(key); } else { return null; } } catch (CacheException e) { throw new IllegalStateException(String.format("Cache throw exception when trying to get %s from region %s.", key, region), 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()); } } }