ConnectedSession

org.terminal21.client.ConnectedSession
class ConnectedSession(val session: Session, encoding: UiElementEncoding, val serverUrl: String, sessionsService: SessionsService, onCloseHandler: () => Unit)

A session connected to the terminal21 server.

Value parameters

encoding

json encoder for UiElements

onCloseHandler

gets notified when the user closes the session

serverUrl

the url of the server

session

the session

sessionsService

the service to talk to the server

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def clear(): Unit

Clears all UI elements and event handlers.

Clears all UI elements and event handlers.

Attributes

def eventIterator: Iterator[CommandEvent]

Attributes

Returns

A new event iterator. There can be many event iterators on the same time and each of them iterates events only from after the time it was created. The iterator blocks while waiting to receive an event.

def fireChangeEvent(e: UiElement, newValue: String): Unit
def fireClickEvent(e: UiElement): Unit
def fireEvent(event: CommandEvent): Unit
def fireEvents(events: CommandEvent*): Unit
def isClosed: Boolean

Attributes

Returns

true if user closed the session via the close button

def isLeaveSessionOpen: Boolean

Doesn't close the session upon exiting. In the UI the session seems active but events are not working because the event handlers are not available. Useful when we need to let the user read through some data. But no interaction is possible anymore between the user and the code.

Doesn't close the session upon exiting. In the UI the session seems active but events are not working because the event handlers are not available. Useful when we need to let the user read through some data. But no interaction is possible anymore between the user and the code.

Attributes

def render(es: Seq[UiElement]): Unit

Normally this method shouldn't be called directly. Terminates any previous event iterators, clears the UI and renders the UiElements.

Normally this method shouldn't be called directly. Terminates any previous event iterators, clears the UI and renders the UiElements.

Value parameters

es

the UiElements to be rendered.

Attributes

def uiUrl: String

Waits till user closes the session by clicking the session close [X] button.

Waits till user closes the session by clicking the session close [X] button.

Attributes

final def waitTillUserClosesSessionOr(condition: => Boolean): Unit

Waits till user closes the session or a custom condition becomes true

Waits till user closes the session or a custom condition becomes true

Value parameters

condition

if true then this returns otherwise it waits.

Attributes

Waits until at least 1 event iterator was created for the current page. Useful for testing purposes if i.e. one thread runs the main loop and gets an eventIterator at some point and an other thread needs to fire events.

Waits until at least 1 event iterator was created for the current page. Useful for testing purposes if i.e. one thread runs the main loop and gets an eventIterator at some point and an other thread needs to fire events.

Attributes

Concrete fields

val serverUrl: String
val session: Session