BrowseNext
When browse / browseWithPaging When the number of returned child nodes exceeds the server's single-page limit, the server returns a non-empty ContinuationPoint (paging token). Use browseNext to retrieve the next page.
- To get it, you must ContinuationPoint use browseWithPaging, Regular browse Will be discarded CP.
- A single line of code
browseAll(...)can be set to loop automatically SDK browseNextand retrieve all references.
Signature
public BrowsePage browseNext(byte[] continuationPoint, boolean release);
| Parameters | Note |
|---|---|
| continuationPoint | Last browse/ browseNext returned continuation token |
| release | true = Abort further paging; the server releases resources (no references are returned) |
BrowsePage Field
| Methods | Return | Note |
|---|---|---|
| getReferences() | List<Reference> | List of References for This Page |
| getContinuationPoint() | byte[] (null indicates no more pages) | Continue Posting Vouchers |
| hasMore() | boolean | Is there another page? |
Complete Page-Turning Example
import com.darra.opcua.*;
import java.util.ArrayList;
import java.util.List;
BrowsePage page = ua.browseWithPaging("ns=2;s=BigFolder");
List<Reference> allRefs = new ArrayList<>(page.getReferences());
while (page.hasMore()) {
page = ua.browseNext(page.getContinuationPoint(), false);
allRefs.addAll(page.getReferences());
}
System.out.println("Total " + allRefs.size() + " children");
Or a simple one-line command (internal auto browseNext, release on last page):
List<Reference> all = ua.browseAll("ns=2;s=BigFolder");
Proactive Release (Saves Server Resources)
The server maintains ContinuationPoint a state for each one, which consumes resources. If you decide to stop browsing partway through, call the method to explicitly release=true release it:
ua.browseNext(page.getContinuationPoint(), true);
Otherwise, these ContinuationPoint will continue to consume server resources until the server reclaims them on its own; the timing of reclamation is determined by the server's implementation (which varies by server), so do not rely on it—if you need to ensure they are released, do so explicitly release=true.
Note
ContinuationPointis an opaque byte array, Do not modify / parse- Each one can only
ContinuationPointbe used once. - The server imposes a limit on the number
ContinuationPointof sessions per user; this limit varies by server. The server also determines how to handle situations where the limit is exceeded—release sessions as soon as they are no longer needed; do not hold onto them.