com.espertech.esper.client.soda
Class SQLStream

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

public class SQLStream
extends Stream

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

See Also:
Serialized Form

Constructor Summary
SQLStream()
          Ctor.
SQLStream(java.lang.String databaseName, java.lang.String sqlWithSubsParams, java.lang.String optStreamName, java.lang.String optionalMetadataSQL)
          Ctor.
 
Method Summary
static SQLStream create(java.lang.String databaseName, java.lang.String sqlWithSubsParams)
          Creates a new SQL-based stream.
static SQLStream create(java.lang.String databaseName, java.lang.String sqlWithSubsParams, java.lang.String optStreamName)
          Creates a new SQL-based stream.
static SQLStream create(java.lang.String databaseName, java.lang.String sqlWithSubsParams, java.lang.String optStreamName, java.lang.String optionalMetadataSQL)
          Creates a new SQL-based stream.
 java.lang.String getDatabaseName()
          Returns the database name.
 java.lang.String getOptionalMetadataSQL()
          Returns the metadata SQL if any.
 java.lang.String getSqlWithSubsParams()
          Returns the SQL with optional substitution parameters in the SQL.
 void setDatabaseName(java.lang.String databaseName)
          Sets the database name.
 void setOptionalMetadataSQL(java.lang.String optionalMetadataSQL)
          Sets metadata SQL.
 void setSqlWithSubsParams(java.lang.String sqlWithSubsParams)
          Sets the SQL with optional substitution parameters in the SQL.
 void toEPLStream(java.io.StringWriter writer, EPStatementFormatter formatter)
          Renders the stream in textual representation.
 void toEPLStreamOptions(java.io.StringWriter writer)
          Renders the stream in textual representation any stream options, if present.
 void toEPLStreamType(java.io.StringWriter writer)
          Renders the stream type under a non-complete textual representation for tool use
 
Methods inherited from class com.espertech.esper.client.soda.Stream
getStreamName, setStreamName, toEPL
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLStream

public SQLStream()
Ctor.


SQLStream

public SQLStream(java.lang.String databaseName,
                 java.lang.String sqlWithSubsParams,
                 java.lang.String optStreamName,
                 java.lang.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(java.lang.String databaseName,
                               java.lang.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(java.lang.String databaseName,
                               java.lang.String sqlWithSubsParams,
                               java.lang.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(java.lang.String databaseName,
                               java.lang.String sqlWithSubsParams,
                               java.lang.String optStreamName,
                               java.lang.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 java.lang.String getDatabaseName()
Returns the database name.

Returns:
database name

setDatabaseName

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

Parameters:
databaseName - database name

getSqlWithSubsParams

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

Returns:
SQL

setSqlWithSubsParams

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

Parameters:
sqlWithSubsParams - SQL set set

getOptionalMetadataSQL

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

Returns:
metadata SQL

setOptionalMetadataSQL

public void setOptionalMetadataSQL(java.lang.String optionalMetadataSQL)
Sets metadata SQL.

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

toEPLStream

public void toEPLStream(java.io.StringWriter writer,
                        EPStatementFormatter formatter)
Description copied from class: Stream
Renders the stream in textual representation.

Specified by:
toEPLStream in class Stream
Parameters:
writer - to output to
formatter - for newline-whitespace formatting

toEPLStreamType

public void toEPLStreamType(java.io.StringWriter writer)
Description copied from class: Stream
Renders the stream type under a non-complete textual representation for tool use

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

toEPLStreamOptions

public void toEPLStreamOptions(java.io.StringWriter writer)
Description copied from class: Stream
Renders the stream in textual representation any stream options, if present.

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

© 2006-2015 EsperTech Inc.
All rights reserved.
Visit us at espertech.com