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, Serializable

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, NamedWindowService namedWindowService, ValueAddEventService valueAddEventService, VariableService variableService, String engineURI, URI[] plugInTypeResolutionURIs)
          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 com.espertech.esper.epl.spec.StreamSpecBase
getOptionalStreamName, getViewSpecs, isUnidirectional
 
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, getViewSpecs, isUnidirectional
 
Methods inherited from interface com.espertech.esper.epl.spec.StreamSpec
getOptionalStreamName, getViewSpecs, isUnidirectional
 

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,
                                  NamedWindowService namedWindowService,
                                  ValueAddEventService valueAddEventService,
                                  VariableService variableService,
                                  String engineURI,
                                  URI[] plugInTypeResolutionURIs)
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
namedWindowService - is the service managing named windows
valueAddEventService - service that handles update events
variableService - provides variable values
engineURI - the engine URI
plugInTypeResolutionURIs - is URIs for resolving the event name against plug-inn event representations, if any
Returns:
compiled stream

© 2007 EsperTech Inc.
All rights reserved.
Visit us at espertech.com