Class SQLStream

java.lang.Object
com.espertech.esper.common.client.soda.Stream
com.espertech.esper.common.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:
  • Constructor Details

    • SQLStream

      public SQLStream()
      Ctor.
    • 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 Details

    • 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
    • toEPLStream

      public void toEPLStream(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(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(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