public class SQLStream extends Stream
Constructor and Description |
---|
SQLStream()
Ctor.
|
SQLStream(String databaseName,
String sqlWithSubsParams,
String optStreamName,
String optionalMetadataSQL)
Ctor.
|
Modifier and Type | Method and Description |
---|---|
static SQLStream |
create(String databaseName,
String sqlWithSubsParams)
Creates a new SQL-based stream.
|
static SQLStream |
create(String databaseName,
String sqlWithSubsParams,
String optStreamName)
Creates a new SQL-based stream.
|
static SQLStream |
create(String databaseName,
String sqlWithSubsParams,
String optStreamName,
String optionalMetadataSQL)
Creates a new SQL-based stream.
|
String |
getDatabaseName()
Returns the database name.
|
String |
getOptionalMetadataSQL()
Returns the metadata SQL if any.
|
String |
getSqlWithSubsParams()
Returns the SQL with optional substitution parameters in the SQL.
|
void |
setDatabaseName(String databaseName)
Sets the database name.
|
void |
setOptionalMetadataSQL(String optionalMetadataSQL)
Sets metadata SQL.
|
void |
setSqlWithSubsParams(String sqlWithSubsParams)
Sets the SQL with optional substitution parameters in the SQL.
|
void |
toEPLStream(StringWriter writer,
EPStatementFormatter formatter)
Renders the stream in textual representation.
|
void |
toEPLStreamOptions(StringWriter writer)
Renders the stream in textual representation any stream options, if present.
|
void |
toEPLStreamType(StringWriter writer)
Renders the stream type under a non-complete textual representation for tool use
|
getStreamName, setStreamName, toEPL
public SQLStream()
public SQLStream(String databaseName, String sqlWithSubsParams, String optStreamName, String optionalMetadataSQL)
databaseName
- is the database name to pollsqlWithSubsParams
- is the SQL to useoptStreamName
- is the optional as-name of the stream, or null if unnamedoptionalMetadataSQL
- optional SQL delivering metadata of statementpublic static SQLStream create(String databaseName, String sqlWithSubsParams)
databaseName
- is the database name to pollsqlWithSubsParams
- is the SQL to usepublic static SQLStream create(String databaseName, String sqlWithSubsParams, String optStreamName)
databaseName
- is the database name to pollsqlWithSubsParams
- is the SQL to useoptStreamName
- is the as-name of the streampublic static SQLStream create(String databaseName, String sqlWithSubsParams, String optStreamName, String optionalMetadataSQL)
databaseName
- is the database name to pollsqlWithSubsParams
- is the SQL to useoptStreamName
- is the as-name of the streamoptionalMetadataSQL
- optional SQL delivering metadata of statementpublic String getDatabaseName()
public void setDatabaseName(String databaseName)
databaseName
- database namepublic String getSqlWithSubsParams()
public void setSqlWithSubsParams(String sqlWithSubsParams)
sqlWithSubsParams
- SQL set setpublic String getOptionalMetadataSQL()
public void setOptionalMetadataSQL(String optionalMetadataSQL)
optionalMetadataSQL
- is the SQL to fire to obtain metadata from, or null if disabledpublic void toEPLStream(StringWriter writer, EPStatementFormatter formatter)
Stream
toEPLStream
in class Stream
writer
- to output toformatter
- for newline-whitespace formattingpublic void toEPLStreamType(StringWriter writer)
Stream
toEPLStreamType
in class Stream
writer
- to output topublic void toEPLStreamOptions(StringWriter writer)
Stream
toEPLStreamOptions
in class Stream
writer
- to output to