Package com.zb.mom.ww.mxgateway.client
Class LazyBrowseNode
java.lang.Object
com.zb.mom.ww.mxgateway.client.LazyBrowseNode
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 Summary
Modifier and TypeMethodDescriptionvoidexpand()Fetches direct children from the gateway and populatesgetChildren().booleanboolean
-
Method Details
-
getObject
- Returns:
- the underlying Galaxy object proto for this node.
-
hasChildrenHint
public boolean hasChildrenHint()- Returns:
truewhen the server reports this node has at least one matching descendant.
-
getChildren
- Returns:
- a snapshot of direct children loaded by
expand(); empty until then.
-
isExpanded
public boolean isExpanded()- Returns:
trueafter the firstexpand()call completes.
-
expand
public void expand()Fetches direct children from the gateway and populatesgetChildren(). 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
-