Package org.infinispan.tree

Examples of org.infinispan.tree.Fqn


     * @param ns
     * @param pLIDMId
     * @param id
     */
    void putGtnGroupId(String ns, String pLIDMId, String id) {
        Fqn nodeFqn = getFqn(ns, NODE_GTN_GROUP_ID, pLIDMId);

        Node ioNode = addNode(nodeFqn);

        if (ioNode != null) {
            ioNode.put(NODE_OBJECT_KEY, id);


     * @param pLIDMId
     * @return
     */
    String getGtnGroupId(String ns, String pLIDMId) {

        Fqn nodeFqn = getFqn(ns, NODE_GTN_GROUP_ID, pLIDMId);

        Node node = getNode(nodeFqn);

        if (node != null) {
            String id = (String) node.get(NODE_OBJECT_KEY);

     * @param ns
     * @param query
     * @param list
     */
    void putGtnUserLazyPageList(String ns, Query query, IDMUserListAccess list) {
        Fqn nodeFqn = getFqn(ns, USER_QUERY_NODE, getQueryKey(query));

        Node ioNode = addNode(nodeFqn);

        if (ioNode != null) {
            ioNode.put(NODE_OBJECT_KEY, list);

     * @param query
     * @return LazyPageList
     */
    IDMUserListAccess getGtnUserLazyPageList(String ns, Query query) {

        Fqn nodeFqn = getFqn(ns, USER_QUERY_NODE, getQueryKey(query));

        Node node = getNode(nodeFqn);

        if (node != null) {
            IDMUserListAccess list = (IDMUserListAccess) node.get(NODE_OBJECT_KEY);

     *
     * @param ns
     * @param rootGroup
     */
    void putRootGroup(String ns, Group rootGroup) {
        Fqn nodeFqn = getFqn(ns, NODE_PLIDM_ROOT_GROUP);

        Node ioNode = addNode(nodeFqn);

        if (ioNode != null) {
            ioNode.put(NODE_OBJECT_KEY, rootGroup);

     *
     * @param ns
     * @return
     */
    Group getRootGroup(String ns) {
        Fqn nodeFqn = getFqn(ns, NODE_PLIDM_ROOT_GROUP);

        Node node = getNode(nodeFqn);

        if (node != null) {
            Group rootGroup = (Group) node.get(NODE_OBJECT_KEY);

   }

   private Node<K, V> addChild(AdvancedCache<?, ?> cache, Fqn f) {
      startAtomic();
      try {
         Fqn absoluteChildFqn = Fqn.fromRelativeFqn(fqn, f);

         //1) first register it with the parent
         AtomicMap<Object, Fqn> structureMap = getStructure(cache);
         structureMap.put(f.getLastElement(), absoluteChildFqn);

   private boolean removeChild(AdvancedCache cache, Object childName) {
      startAtomic();
      try {
         AtomicMap<Object, Fqn> s = getStructure(cache);
         Fqn childFqn = s.remove(childName);
         if (childFqn != null) {
            Node<K, V> child = new NodeImpl<K, V>(childFqn, cache, batchContainer);
            child.removeChildren();
            child.clearData()// this is necessary in case we have a remove and then an add on the same node, in the same tx.
            cache.remove(new NodeKey(childFqn, NodeKey.Type.DATA));

   }

   private boolean hasChild(AdvancedCache<?, ?> cache, Fqn f) {
      if (f.size() > 1) {
         // indirect child.
         Fqn absoluteFqn = Fqn.fromRelativeFqn(fqn, f);
         return exists(cache, absoluteFqn);
      } else {
         return hasChild(f.getLastElement());
      }
   }

            createNodeInCache(cache, newParentFqn);
            if (trace) log.tracef("The new parent (%s) did not exists, was created", newParentFqn);
         }

         // create an empty node for this new parent
         Fqn newFqn = Fqn.fromRelativeElements(newParentFqn, nodeToMoveFqn.getLastElement());
         createNodeInCache(cache, newFqn);
         Node<K, V> newNode = getNode(cache, newFqn);
         Map<K, V> oldData = nodeToMove.getData();
         if (oldData != null && !oldData.isEmpty()) newNode.putAll(oldData);
         for (Object child : nodeToMove.getChildrenNames()) {
            // move kids
            if (trace) log.tracef("Moving child %s", child);
            Fqn oldChildFqn = Fqn.fromRelativeElements(nodeToMoveFqn, child);
            move(cache, oldChildFqn, newFqn);
         }
         removeNode(cache, nodeToMoveFqn);
         success = true;
      } finally {

TOP

Related Classes of org.infinispan.tree.Fqn

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.