net.esper.client.soda
Class SQLStream

java.lang.Object
  extended by net.esper.client.soda.Stream
      extended by net.esper.client.soda.SQLStream
All Implemented Interfaces:
Serializable

public class SQLStream
extends Stream

An SQL stream that polls via SQL for events via join.

See Also:
Serialized Form

Constructor Summary
SQLStream(String databaseName, String sqlWithSubsParams, String optStreamName, String optionalMetadataSQL)
          Ctor.
 
Method Summary
static SQLStream create(String databaseName, String sqlWithSubsParams)
          Creates a new SQL-based stream.
static SQLStream create(String databaseName, String sqlWithSubsParams, String optStreamName)
          Creates a new SQL-based stream.
static SQLStream create(String databaseName, String sqlWithSubsParams, String optStreamName, String optionalMetadataSQL)
          Creates a new SQL-based stream.
 String getDatabaseName()
          Returns the database name.
 String getOptionalMetadataSQL()
          Returns the metadata SQL if any.
 String getSqlWithSubsParams()
          Returns the SQL with optional substitution parameters in the SQL.
 void setDatabaseName(String databaseName)
          Sets the database name.
 void setOptionalMetadataSQL(String optionalMetadataSQL)
          Sets metadata SQL.
 void setSqlWithSubsParams(String sqlWithSubsParams)
          Sets the SQL with optional substitution parameters in the SQL.
 void toEQLStream(StringWriter writer)
          Renders the stream in textual representation.
 
Methods inherited from class net.esper.client.soda.Stream
getStreamName, setStreamName, toEQL
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLStream

public SQLStream(String databaseName,
                 String sqlWithSubsParams,
                 String optStreamName,
                 String optionalMetadataSQL)
Ctor.

Parameters:
databaseName - is the database name to poll
sqlWithSubsParams - is the SQL to use
optStreamName - is the optional as-name of the stream, or null if unnamed
optionalMetadataSQL - optional SQL delivering metadata of statement
Method Detail

create

public static SQLStream create(String databaseName,
                               String sqlWithSubsParams)
Creates a new SQL-based stream.

Parameters:
databaseName - is the database name to poll
sqlWithSubsParams - is the SQL to use
Returns:
stream

create

public static SQLStream create(String databaseName,
                               String sqlWithSubsParams,
                               String optStreamName)
Creates a new SQL-based stream.

Parameters:
databaseName - is the database name to poll
sqlWithSubsParams - is the SQL to use
optStreamName - is the as-name of the stream
Returns:
stream

create

public static SQLStream create(String databaseName,
                               String sqlWithSubsParams,
                               String optStreamName,
                               String optionalMetadataSQL)
Creates a new SQL-based stream.

Parameters:
databaseName - is the database name to poll
sqlWithSubsParams - is the SQL to use
optStreamName - is the as-name of the stream
optionalMetadataSQL - optional SQL delivering metadata of statement
Returns:
stream

getDatabaseName

public String getDatabaseName()
Returns the database name.

Returns:
database name

setDatabaseName

public void setDatabaseName(String databaseName)
Sets the database name.

Parameters:
databaseName - database name

getSqlWithSubsParams

public String getSqlWithSubsParams()
Returns the SQL with optional substitution parameters in the SQL.

Returns:
SQL

setSqlWithSubsParams

public void setSqlWithSubsParams(String sqlWithSubsParams)
Sets the SQL with optional substitution parameters in the SQL.

Parameters:
sqlWithSubsParams - SQL set set

getOptionalMetadataSQL

public String getOptionalMetadataSQL()
Returns the metadata SQL if any.

Returns:
metadata SQL

setOptionalMetadataSQL

public void setOptionalMetadataSQL(String optionalMetadataSQL)
Sets metadata SQL.

Parameters:
optionalMetadataSQL - is the SQL to fire to obtain metadata from, or null if disabled

toEQLStream

public void toEQLStream(StringWriter writer)
Description copied from class: Stream
Renders the stream in textual representation.

Specified by:
toEQLStream in class Stream
Parameters:
writer - to output to