org.jboss.cache.Node.getKeys()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(102)

本文整理了Java中org.jboss.cache.Node.getKeys()方法的一些代码示例,展示了Node.getKeys()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.getKeys()方法的具体详情如下:
包路径:org.jboss.cache.Node
类名称:Node
方法名:getKeys

Node.getKeys介绍

[英]Returns a Set containing the data in this Node.
[中]返回包含此节点中数据的集合。

代码示例

代码示例来源:origin: org.jboss.cache/jbosscache-core

@Override
public Set<K> keySet()
{
  return node.getKeys();
}

代码示例来源:origin: org.jboss.cache/jbosscache-core

@Override
public boolean containsKey(Object key)
{
  return node.getKeys().contains(key);
}

代码示例来源:origin: org.jboss.cache/jbosscache-core

@Override
public boolean contains(Object key)
{
  return node.getKeys().contains(key);
}

代码示例来源:origin: org.jboss.cache/jbosscache-core

@Override
public Iterator<K> iterator()
{
  final Iterator i = node.getKeys().iterator();
  return new Iterator<K>()
  {
   K key;
   boolean next = false;
   public boolean hasNext()
   {
     return i.hasNext();
   }
   @SuppressWarnings("unchecked")
   public K next()
   {
     key = (K) i.next();
     next = true;
     return key;
   }
   @SuppressWarnings("unchecked")
   public void remove()
   {
     if (!next)
      throw new IllegalStateException();
     node.remove(key);
   }
  };
}

代码示例来源:origin: Verigreen/verigreen

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));
    }
  }
}

代码示例来源:origin: org.jasig.cas/cas-server-integration-jboss

@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();
  }
}

代码示例来源:origin: org.mobicents.servlet.sip.containers/sip-servlets-jboss5-ha-server-cache

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;
}

代码示例来源:origin: org.mobicents.servlet.sip.containers/sip-servlets-jboss5-ha-server-cache

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;
}

相关文章