net.esper.eql.spec
Class DBStatementStreamSpec

java.lang.Object
  extended by net.esper.eql.spec.StreamSpecBase
      extended by net.esper.eql.spec.DBStatementStreamSpec
All Implemented Interfaces:
Serializable, StreamSpec, StreamSpecCompiled, StreamSpecRaw, MetaDefItem

public class DBStatementStreamSpec
extends StreamSpecBase
implements StreamSpecRaw, StreamSpecCompiled, MetaDefItem

Specification object for historical data poll via database SQL statement.

See Also:
Serialized Form

Constructor Summary
DBStatementStreamSpec(String optionalStreamName, List<ViewSpec> viewSpecs, String databaseName, String sqlWithSubsParams, String metadataSQL)
          Ctor.
 
Method Summary
 StreamSpecCompiled compile(EventAdapterService eventAdapterService, MethodResolutionService methodResolutionService, PatternObjectResolutionService patternObjectResolutionService, TimeProvider timeProvider)
          Compiles a raw stream specification consisting event type information and filter expressions to an validated, optimized form for use with filter service
 String getDatabaseName()
          Returns the database name.
 String getMetadataSQL()
          Returns the optional sample metadata SQL
 String getSqlWithSubsParams()
          Returns the SQL with substitution parameters.
 
Methods inherited from class net.esper.eql.spec.StreamSpecBase
getOptionalStreamName, getViewSpecs
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.esper.eql.spec.StreamSpec
getOptionalStreamName, getViewSpecs
 
Methods inherited from interface net.esper.eql.spec.StreamSpec
getOptionalStreamName, getViewSpecs
 

Constructor Detail

DBStatementStreamSpec

public DBStatementStreamSpec(String optionalStreamName,
                             List<ViewSpec> viewSpecs,
                             String databaseName,
                             String sqlWithSubsParams,
                             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 String getDatabaseName()
Returns the database name.

Returns:
name of database.

getSqlWithSubsParams

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

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

getMetadataSQL

public String getMetadataSQL()
Returns the optional sample metadata SQL

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

compile

public StreamSpecCompiled compile(EventAdapterService eventAdapterService,
                                  MethodResolutionService methodResolutionService,
                                  PatternObjectResolutionService patternObjectResolutionService,
                                  TimeProvider timeProvider)
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:
eventAdapterService - supplies type information
methodResolutionService - for resolving imports
patternObjectResolutionService - for resolving pattern objects
timeProvider - - provides engine current time
Returns:
compiled stream