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)
          Ctor.
 
Method Summary
 StreamSpecCompiled compile(EventAdapterService eventAdapterService, MethodResolutionService methodResolutionService, PatternObjectResolutionService patternObjectResolutionService)
          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 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)
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
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}

compile

public StreamSpecCompiled compile(EventAdapterService eventAdapterService,
                                  MethodResolutionService methodResolutionService,
                                  PatternObjectResolutionService patternObjectResolutionService)
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
Returns:
compiled stream