jsbclientgen

StreamBase Java Client Generation — Generates a simple Java dequeue client for the running StreamBase application

SYNOPSIS

jsbclientgen [OPTIONS] [STREAM [OutputStream.Field] | [OutputStream] | [OutputStream@Field] ...]

DESCRIPTION

jsbclientgen generates a simple Java dequeue client for the running StreamBase application, creating a read-only display interface for one or more output streams. If no output streams are specified on the command line, data is displayed from up to five streams. Different forms of the stream options allow you to control the way dequeued data is displayed in the generated client.

If authentication is enabled for this application, the jsbclientgen command requires SBUser privilege level.

Here is a sequence of example commands. First, start the server for your StreamBase application:

sbd myapp.sbapp &        UNIX
start sbd myapp.sbapp    Windows

Next, enter the command to generate a Java source file for a client dequeuing from the running application:

jsbclientgen --class MyDequeueClient

To compile and run the client application, enter commands like the following for UNIX:

javac -cp `sb-config --classpath` MyDequeueClient
java MyDequeueClient

The equivalent commands for Windows are:

sb-config --classpath --setenv
javac MyDequeueClient.java
java MyDequeueClient

With the dequeue client running, start a feed simulation in a different terminal window to send test data to the application and view the dequeued results in the generated client. For example:

sbfeedsim myconfig.sbfs

OPTIONS

-d directory-name

Optional. Defaults to none. Use this option to specify a directory such as java-src for the location of the generated source file.

-h command, --help command

Displays usage text, then exits.

-Jjvm-option

Specifies a system property setting or other JVM argument to be passed to the JVM that runs this jsbclientgen command. Use this option to specify temporary settings that affect only the current invocation of jsbclientgen. You must specify multiple -J options to specify multiple JVM arguments.

There must be no space after the -J. For example, specify -J-Xmx2G. Use the full option syntax for jvm-option that you would use at the Java command line, including the initial hyphen. For example, specify -J-Dstreambase.log-level=2 to increase the log level for this invocation of jsbclientgen.

Your jvm-option argument might require surrounding quotes, depending on the characters it contains and the shell you are using. However, do not use quotes to escape the spaces between separate JVM arguments; instead use separate -J options. For example: -J-Xms512M -J-Xmx2G

-p TCP-port

Sets the port number only for the StreamBase Server. Useful when the server is localhost and you only need to specify a non-default port, instead of specifying the full URI with the -u option. The default port is 10000.

Note

The -p option is not supported for applications that have StreamBase authentication enabled (because there is no way to specify a username and password) or in conjunction with the multiple URI syntax.

--package package-name

Optional. Defaults to none. Specifies a package name in which this class will be generated, such as: jsbclientgen --package com.example.sbclient --class MyApplication

-u URI

Sets the URI of the StreamBase Server. The default is sb://localhost:10000/. The URI for the StreamBase Server may also be set using the STREAMBASE_SERVER environment variable. See the sburi page of the Reference Guide (or see sburi(5) at the UNIX shell prompt) for a discussion of the URI format and its shortcuts.

--version

Prints version information and exits.

COMMAND OPTIONS

STREAM

Allows you to specify one or more Output Streams in the StreamBase application. If no Output Streams were specified on the jsbclientgen command line, data is displayed from up to five (5) streams. If streams were specified, the format that you use on the command line determines how the generated client displays the data. For each stream, you can use the following options in any preferred combination (one format type per stream):

OutputStream.Field

Displays the value of the field Field of the most recent tuple.

OutputStream

Displays a table of all tuples on OutputStream.

OutputStream@Field

Displays a table of all tuples on OutputStream keyed by the field Field on OutputStream.

FILES

The jsbclientgen command generates a Java source file, class-name.java.

ENVIRONMENT

STREAMBASE_SERVER

Optional. Contains the URI for a StreamBase Server instance. Use this variable to set a default StreamBase URI for StreamBase commands that take the -u option. If set, commands use the URI in this variable, overriding their built-in default URI, which is sb://localhost:10000. If this variable is set, you must use the -u option to communicate with any server other than the one specified in this variable. See the sburi page in the Reference Guide for more on StreamBase URIs.

STREAMBASE_RETITLE_TERMINALS

Optional. If set to any value, StreamBase programs assign a terminal window title to match the name of the executable being run. By default, terminal titles are not affected.

STREAMBASE_LOG_LEVEL

Optional. Sets the minimum severity of messages that StreamBase writes to logging output. Default is 0, which gets NOTICE level messages and higher. Reasonable values are -1 (which disables NOTICE messages and shows only WARN, ERROR and FATAL messages), 1 (which adds INFO messages to the standard messages), and 2 (which adds DEBUG messages).

SEE ALSO

sbd(1)
sbadmin
syslog (3)