Interface WqlCursor

All Superinterfaces:
AutoCloseable

public interface WqlCursor extends AutoCloseable
A lazily-advancing cursor over the rows of a WQL enumeration, returned by WindowsRemoteExecutor.streamWql(String, String, long, int, long). Rows are parsed and served page by page: advancing past the current WS-Enumeration page issues the next Pull request, so memory stays bounded by one page rather than the whole result set.

The cursor owns the executor's serial connection until it is exhausted or closed: no other operation can run on the same executor while the cursor is open (the same contract as a JDBC ResultSet on its connection). Exhaustion releases the connection on its own; closing before the end additionally sends a WS-Enumeration Release so the server frees the enumeration context immediately. Always close the cursor — use try-with-resources.

A cursor is not thread-safe: advance and close it from one thread at a time.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Release the enumeration and the executor's connection.
    Advance to the next row, issuing the next WS-Enumeration Pull when the current page is exhausted.
  • Method Details

    • next

      Advance to the next row, issuing the next WS-Enumeration Pull when the current page is exhausted.
      Returns:
      the next row as an ordered property map, or null once the enumeration is exhausted
      Throws:
      TimeoutException - when the server stays silent for a whole per-round-trip timeout (the inactivity timeout of the stream)
      WindowsRemoteException - for any other failure while pulling
    • close

      void close()
      Release the enumeration and the executor's connection. When the enumeration is not exhausted, a best-effort WS-Enumeration Release tells the server to free the enumeration context. Idempotent, and never throws: releasing the context is a courtesy the server can also handle on its own timeout.
      Specified by:
      close in interface AutoCloseable