# io.github.libtmux.Server.Server.snapshot

- **Module:** io.github.libtmux.Server.Server
- **Package:** io.github.libtmux:libtmux
- **Language:** Java
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-java/blob/842228310449e879ebcaa3f910597757c9dbffd6/libtmux/src/main/java/io/github/libtmux/Server.java#L891
- **Page:** https://libtmux.org/en/java/latest/reference/io-github-libtmux-server-server-snapshot/

```
io.github.libtmux.Server.Server.snapshot() -> ServerSnapshot
```

Captures the whole hierarchy in at most four listings, retrying once if the server is replaced.

One server-wide listing per kind of object, so ordering and membership stay tmux's decision
rather than being re-derived from another listing's rows.

A failed read throws, including when no daemon is running. An empty graph means a live
server successfully reported no sessions.

## Raises

- `ServerNotRunningException`: if no daemon is running
- `LibTmuxException`: if a listing otherwise fails or the listings cannot form one valid snapshot
