Class LazyBrowseNode

java.lang.Object
com.zb.mom.ww.mxgateway.client.LazyBrowseNode

public final class LazyBrowseNode extends Object
One node in a lazy-loaded Galaxy browse tree. Holds the underlying GalaxyRepositoryOuterClass.GalaxyObject and exposes expand() to fetch its direct children on demand. Expansion is one-shot: a second call is a no-op. Pagination of large sibling sets is handled internally by the client.
  • Method Details

    • getObject

      Returns:
      the underlying Galaxy object proto for this node.
    • hasChildrenHint

      public boolean hasChildrenHint()
      Returns:
      true when the server reports this node has at least one matching descendant.
    • getChildren

      public List<LazyBrowseNode> getChildren()
      Returns:
      a snapshot of direct children loaded by expand(); empty until then.
    • isExpanded

      public boolean isExpanded()
      Returns:
      true after the first expand() call completes.
    • expand

      public void expand()
      Fetches direct children from the gateway and populates getChildren(). Idempotent: subsequent calls are no-ops and do not issue a second RPC.

      Concurrent callers coalesce onto a single in-flight RPC: the first caller (the "leader") issues the gRPC call, while any other thread that calls expand() during that window blocks on the leader's future and sees the same result (or the same exception). On failure the in-flight slot is cleared so a subsequent call can retry.

      Readers (getChildren() / isExpanded()) take a separate read lock and are never blocked for the duration of the RPC.

      Throws:
      MxGatewayException - on transport or protocol failure