public TerminalSnapshot getSnapshot() { lazyConnect(); // clear the snapshot sequence is different from the session, clear it so it will re-build if (terminalSnapshot != null && terminalSnapshot.getSequence() != null && !terminalConnection.getSequence().equals(terminalSnapshot.getSequence())) { terminalSnapshot = null; } waitForNonEmptySnapshot(); if (!isConnected()) { disconnect(); throw (new OpenLegacyRuntimeException("Session is not connected")); } if (terminalSnapshot == null) { throw (new OpenLegacyProviderException( MessageFormat.format( "Current screen is empty for session after waiting for {0}", maxWaitOnEmptyScreen))); } return terminalSnapshot; }
public Integer getSequence() { if (!isConnected()) { return 0; } return terminalConnection.getSequence(); }