@ Override protected SshConnection getConnection ( ) throws IOException { if ( ! isPersistedConnectionValid ( ) ) { activeConnection = super . getConnection ( ) ; logger . trace ( "SSH connection is not valid anymore, a new one was created." ) ; } return activeConnection ; }
Returns a fresh SSH connection if the persisted one is not valid . Otherwise returns the existing connection .