com.espertech.esper.epl.spec
Class DBStatementStreamSpec

java.lang.Object
  extended by com.espertech.esper.epl.spec.StreamSpecBase
      extended by com.espertech.esper.epl.spec.DBStatementStreamSpec
All Implemented Interfaces:
StreamSpec, StreamSpecCompiled, StreamSpecRaw, MetaDefItem, java.io.Serializable

public class DBStatementStreamSpec
extends StreamSpecBase
implements StreamSpecRaw, StreamSpecCompiled, MetaDefItem, java.io.Serializable

Specification object for historical data poll via database SQL statement.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface com.espertech.esper.epl.spec.StreamSpecCompiled
EMPTY_STREAM_ARRAY
 
Constructor Summary
DBStatementStreamSpec(java.lang.String optionalStreamName, ViewSpec[] viewSpecs, java.lang.String databaseName, java.lang.String sqlWithSubsParams, java.lang.String metadataSQL)
          Ctor.
 
Method Summary
 StreamSpecCompiled compile(StatementContext statementContext, java.util.Set<java.lang.String> eventTypeReferences, boolean isInsertInto, java.util.Collection<java.lang.Integer> assignedTypeNumberStack, boolean isJoin, boolean isContextDeclaration, boolean isOnTrigger)
          Compiles a raw stream specification consisting event type information and filter expressions to an validated, optimized form for use with filter service
 java.lang.String getDatabaseName()
          Returns the database name.
 java.lang.String getMetadataSQL()
          Returns the optional sample metadata SQL
 java.lang.String getSqlWithSubsParams()
          Returns the SQL with substitution parameters.
 
Methods inherited from class com.espertech.esper.epl.spec.StreamSpecBase
getOptionalStreamName, getOptions, getViewSpecs
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.espertech.esper.epl.spec.StreamSpec
getOptionalStreamName, getOptions, getViewSpecs
 

Constructor Detail

DBStatementStreamSpec

public DBStatementStreamSpec(java.lang.String optionalStreamName,
                             ViewSpec[] viewSpecs,
                             java.lang.String databaseName,
                             java.lang.String sqlWithSubsParams,
                             java.lang.String metadataSQL)
Ctor.

Parameters:
optionalStreamName - is a stream name optionally given to stream
viewSpecs - is a list of views onto the stream
databaseName - is the database name to poll
sqlWithSubsParams - is the SQL with placeholder parameters
metadataSQL - is the sample SQL to retrieve statement metadata, if any was supplied
Method Detail

getDatabaseName

public java.lang.String getDatabaseName()
Returns the database name.

Returns:
name of database.

getSqlWithSubsParams

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

Returns:
SQL with parameters embedded as ${stream.param}

getMetadataSQL

public java.lang.String getMetadataSQL()
Returns the optional sample metadata SQL

Returns:
null if not supplied, or SQL to fire to retrieve metadata

compile

public StreamSpecCompiled compile(StatementContext statementContext,
                                  java.util.Set<java.lang.String> eventTypeReferences,
                                  boolean isInsertInto,
                                  java.util.Collection<java.lang.Integer> assignedTypeNumberStack,
                                  boolean isJoin,
                                  boolean isContextDeclaration,
                                  boolean isOnTrigger)
Description copied from interface: StreamSpecRaw
Compiles a raw stream specification consisting event type information and filter expressions to an validated, optimized form for use with filter service

Specified by:
compile in interface StreamSpecRaw
Parameters:
statementContext - statement-level services
eventTypeReferences - event type names used by the statement
isInsertInto - true for insert-into
isJoin - indicates whether a join or not a join
isContextDeclaration - indicates whether declared as part of the context declarations, if any
Returns:
compiled stream

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