LiveView Ready Input Adapter

Introduction

The Spotfire LiveView Ready adapter informs a StreamBase application when the configured LiveView server is ready to accept connections, and when it changes to not ready.

At runtime, ready and not ready events on the specified LiveView server result in a tuple emitted on the adapter's output port.

Properties

This section describes the properties you can set for this adapter, using the various tabs of the Properties view for the adapter's icon in StreamBase Studio.

General Tab

Name: Use this required field to specify or change the name of this instance of this component. The name must be unique within the current EventFlow module. The name can contain alphanumeric characters, underscores, and escaped special characters. Special characters can be escaped as described in Identifier Naming Rules. The first character must be alphabetic or an underscore.

Adapter: A read-only field that shows the formal name of the adapter.

Class name: Shows the fully qualified class name that implements the functionality of this adapter. If you need to reference this class name elsewhere in your application, you can right-click this field and select Copy from the context menu to place the full class name in the system clipboard.

Start options: This field provides a link to the Cluster Aware tab, where you configure the conditions under which this adapter starts.

Enable Error Output Port: Select this checkbox to add an Error Port to this component. In the EventFlow canvas, the Error Port shows as a red output port, always the last port for the component. See Using Error Ports to learn about Error Ports.

Description: Optionally, enter text to briefly describe the purpose and function of the component. In the EventFlow Editor canvas, you can see the description by pressing Ctrl while the component's tooltip is displayed.

Adapter Properties Tab

This section describes the properties on the Adapter Properties tab in the Properties view for the LiveView Ready adapter.

Property Description
Set Server URI to encapsulating LiveView Select this checkbox when the adapter is part of a LiveView project. In this case, the adapter connects to the port of the running LiveView server. When authentication is enabled, the credentials used to connect to the LiveView server are retrieved from the liveview.internal.username and liveview.internal.password system properties. The corresponding LiveView user must be configured with the appropriate permissions to allow this adapter to perform its operations.
LiveView Server URI A LiveView server URI, or an expression or variable that resolves to a LiveView server URI. For example, the URI for the local machine and default port is lv://localhost:11080.
Use Runtime URIs Enables an additional input port to this adapter. The input port expects tuples of the schema (ControlAction: string, URI: string). The author time URI options are greyed out and the adapter will wait to connect until it receives a Connect tuple. If the connection fails, the adapters will continue to try and connect. If the adapter receives a Disconnect tuple, it will disconnect from its current connection, if it has one, or stop trying to connect if it’s currently in failure.
Connection Key Only enabled if Use Runtime URIs and Share LiveView Connection are enabled. If both are enabled, this is a required property which defines groups of adapters that will share connections. An author-defined string of alphanumeric characters is expected here like Pool1 or Pool2. All adapters set to share connections and use runtime URIs with the Connection Key Pool1 will connect and disconnect using a single shared connection as Connect/Disconnect tuples are received by any one of the adapters in the group.
Share LiveView Connection When selected (the default), this instance of the adapter shares a single LiveView connection to the configured LiveView server with all other LiveView adapters in the same container that also have the Share LiveView Connection property selected.
Enable Compressed Connection If checked, compress this adapter's LiveView connection. Not enabled if Use Runtime URI is also selected. To compress a connection defined at runtime, see the "ConnectCompress" control action defined in the Runtime URI Schema
Log Level Controls the level of verbosity the adapter uses to send notifications to the console. This setting can be higher than the containing application's log level. If set lower, the system log level is used. Available values, in increasing order of verbosity, are: OFF, ERROR, WARN, INFO, DEBUG, TRACE.

Cluster Aware Tab

Use the settings in this tab to enable this operator or adapter for runtime start and stop conditions in a multi-node cluster. During initial development of the fragment that contains this operator or adapter, and for maximum compatibility with releases before 10.5.0, leave the Cluster start policy control in its default setting, Start with module.

Cluster awareness is an advanced topic that requires an understanding of StreamBase Runtime architecture features, including clusters, quorums, availability zones, and partitions. See Cluster Awareness Tab Settings on the Using Cluster Awareness page for instructions on configuring this tab.

Concurrency Tab

Use the Concurrency tab to specify parallel regions for this instance of this component, or multiplicity options, or both. The Concurrency tab settings are described in Concurrency Options, and dispatch styles are described in Dispatch Styles.

Caution

Concurrency settings are not suitable for every application, and using these settings requires a thorough analysis of your application. For details, see Execution Order and Concurrency, which includes important guidelines for using the concurrency options.

Adapter Ports

The LiveView Ready adapter has a status port that supplies information about the configured server status.

As with other Spotfire Streaming adapters and operators, you can optionally enable an Error Output Port, as described in Using Error Ports and Error Streams.

An optional Use Runtime URI Input Port is also available for Connecting/Disconnecting to LiveView servers at runtime instead of at author time.

Runtime URI Input Port

When Use Runtime URIs is enabled on this adapter, so is this port.

This port accepts tuples of the below schema.

Field Data Type Description
ControlAction string A value of either
Connect ConnectCompress Disconnect
If Connect or ConnectCompress, the adapter (and any adapters with whom it shares a connection) will connect to the LiveView server specified in the URI field. If currently connected (or attempting to connect) to a URL, that will be closed and the new URL attempted. If Disconnect, this adapter or adapter group will disconnect from its currently connected LiveView server. ConnectCompress will initiate a compressed connection, and Connect will initiate an uncompressed connection.
URI string The URI of a LiveView server such as lv://localhost:11080. The adapter will attempt to connect to the LiveView server at this address if Connect or ConnectCompress is supplied in this tuple's ControlAction. If Disconnect is supplied as the ControlAction, a value for URI need not be supplied and will be ignored.

LiveView Ready Adapter Output Port

The LiveView Ready adapter has one output status port. For each server-up or server-down event, one or more tuples are emitted on the status port. The message type is always CONNECTION, while the Action field reports the status of the server.

The status port has the fields shown in the following table:

Field Data Type Description
Type string The basic state reported, currently always:
CONNECTION  
Object string The name on the EventFlow canvas of the adapter reporting the status.
Action string The action that occurred, always one of the following:
CONNECTED ERROR
FAILED  
Message string A human-readable string that provides additional context for the status message, including the URI of the LiveView server.
Time timestamp The time the readiness event occurred.

Using the Adapter in a StreamBase Application

Add an instance of the adapter to a new EventFlow application with the following steps:

  1. In StreamBase Studio, create a project, including an empty StreamBase EventFlow application file to host the adapter.

  2. From the Operators and Adapters drawer of the Palette view, drag the Adapters, Java Operators icon to the canvas. This opens the Insert an Operator or Adapter dialog.

  3. In the search field, type a string such as liveview to narrow the list of adapters. Select the icon for the LiveView Ready adapter, then click OK.

  4. Double-click the adapter's icon and select the Adapter Properties tab in the Properties view.

  5. Next, either:

    1. If this adapter is part of an EventFlow module that is itself part of a LiveView project, select the Set Server URI to encapsulating LiveView check box. This check box tells the adapter to connect to the host and port for the current project's LiveView server.

    2. Or specify the URI for a local or remote LiveView server to connect to (or accept the default URI, lv:/localhost:11080).

  6. Add an Output Stream and connect an arc to it from the LiveView Ready adapter's output port.

  7. At runtime, ready and not ready events on the specified LiveView server result in a tuple emitted on the adapter's output port.

Typechecking and Error Handling

The LiveView Ready adapter uses typecheck messages to help you configure the adapter.

The adapter generates warning messages at runtime under various conditions, including: The configured LiveView server is not available.

Suspend and Resume Behavior

When suspended, the adapter stays connected to the LiveView server; therefore, on resume the adapter is still connected.