|
Oracle® Fusion Middleware Java API Reference for Oracle Event Processing 11g Release 1 (11.1.1.9) E14303-12 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Commands for manipulating EPN components.
A command is a high-level interface that abstracts the Java API. For instance, the channel
command creates an EventChannel
without the user having to go through an EventChannelFactory
. A session must be commenced by invoking beginSession()
before any commands can be issued. When done, a session must be ended by invoking endSession()
. Ending a session destroys all EPN components that were created during the session. A session is not multithread aware, and must be synchronized by client. The EPN commands are issued through the OCEP shell. See documentation on how to start the shell. The OCEP shell commands are:
The following variables can also be set for an EPN session:
For example, you can turn off including the time-stamp of the output events by using the following shell command: OUT_TIME=OFF
Further, you may make use of the EPN commands in a regular OCEP application. This is done by retrieving the EpnCommand
OSGi service. This services is registered as an OSGi service factory, thus each OCEP application gets a separate service object. This is ideal for creating Junit-like test-cases for testing EPNs and CQL statements. However, only the commands exposed in this class as methods can be used for this latter purpose.
Field Summary | |
static OutputTimeFormat |
DEFAULT_TIME_FORMAT Default time format for output events. |
static java.lang.String |
OUTPUT_TIME_FORMAT_VAR_NAME Session variable that indicates format of time-stamp to be included in the output events. |
Method Summary | |
void |
beginSession() Begins a new session for invoking commands. |
EventChannel |
createChannel(boolean relation, java.lang.String applicationTimestampProp, boolean totalOrder, java.lang.String channelName, java.lang.Class clazz) Creates a new channel using a Java class event-type. |
EventChannel |
createChannel(boolean relation, java.lang.String applicationTimestampProp, boolean totalOrder, java.lang.String channelName, java.util.Map metadata) Creates a new channel using a metadata-based event-type. |
EventChannel |
createChannel(boolean relation, java.lang.String channelName, java.lang.Class clazz) Creates a new system timestamped channel using a Java class event-type. |
EventChannel |
createChannel(boolean relation, java.lang.String channelName, java.util.Map metadata) Creates a new system timestamped channel using a metadata-based event-type. |
MapEventObject |
createMapEvent(EventChannel channel, java.util.Map event) Creates a map-event to be used for metadata-based channels. |
Processor |
createProcessor(java.lang.String processorName) Creates a CQL processor in the current session. |
Statement |
createQuery(Processor processor, java.lang.String id, java.lang.String statementValue) Creates a CQL query. |
Statement |
createView(Processor processor, java.lang.String id, java.lang.String statementValue) Creates a CQL view. |
void |
endSession() Ends the current session. |
EventChannel[] |
getChannels() Returns all channels that have been created in this current session. |
Processor[] |
getProcessors() Returns all processors that have been created in this session. |
StreamSource |
link(StreamSource fromStage, StreamSink toStage) Connects the fromStage to the toStage. |
Field Detail |
public static final java.lang.String OUTPUT_TIME_FORMAT_VAR_NAME
OutputTimeFormat
public static final OutputTimeFormat DEFAULT_TIME_FORMAT
Method Detail |
public void beginSession() throws java.lang.Exception, java.lang.IllegalStateException
public void endSession() throws java.lang.IllegalStateException
public EventChannel[] getChannels() throws java.lang.IllegalStateException
public EventChannel createChannel(boolean relation, java.lang.String channelName, java.lang.Class clazz) throws java.lang.Exception, java.lang.IllegalStateException
relation
- true if channel is a relation, false if it is a streamchannelName
- name of the channelclazz
- event-type of the channelpublic EventChannel createChannel(boolean relation, java.lang.String applicationTimestampProp, boolean totalOrder, java.lang.String channelName, java.lang.Class clazz) throws java.lang.Exception, java.lang.IllegalStateException
relation
- true if channel is a relation, false if it is a streamapplicationTimestampProp
- name of the event property that should be used as the application timestamp, or null if channel is system timestamped.totalOrder
- true if application time is always strictly greater than the last value used.channelName
- name of the channelclazz
- event-type of the channelpublic EventChannel createChannel(boolean relation, java.lang.String channelName, java.util.Map metadata) throws java.lang.Exception, java.lang.IllegalStateException
relation
- true if channel is a relation, false if it is a streamchannelName
- name of the channelmetadata
- metadata describing the channel's event-type.public EventChannel createChannel(boolean relation, java.lang.String applicationTimestampProp, boolean totalOrder, java.lang.String channelName, java.util.Map metadata) throws java.lang.Exception, java.lang.IllegalStateException
relation
- true if channel is a relation, false if it is a streamapplicationTimestampProp
- name of the event property that should be used as the application timestamp, or null if channel is system time-stamped.totalOrder
- true if application time is always strictly greater than the last value used.channelName
- name of the channelmetadata
- metadata describing the channel's event-type.public Processor[] getProcessors() throws java.lang.IllegalStateException
public Processor createProcessor(java.lang.String processorName) throws java.lang.Exception, java.lang.IllegalStateException
processorName
- name of the processorpublic StreamSource link(StreamSource fromStage, StreamSink toStage) throws java.util.TooManyListenersException, java.lang.IllegalStateException, java.lang.Exception
fromStage
- the event sourcetoStage
- the event sinkpublic Statement createView(Processor processor, java.lang.String id, java.lang.String statementValue) throws java.lang.IllegalStateException, java.lang.IllegalArgumentException
processor
- the source processorid
- the ID of the viewstatementValue
- the value of the viewprocessor
was not created in the current session.public Statement createQuery(Processor processor, java.lang.String id, java.lang.String statementValue) throws java.lang.IllegalStateException, java.lang.IllegalArgumentException
processor
- the source processorid
- the ID of the viewstatementValue
- the value of the viewprocessor
was not created in the current session.public MapEventObject createMapEvent(EventChannel channel, java.util.Map event)
channel
- targeted channelevent
- map-based event
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |