com.espertech.esper.view
Interface ViewService

All Known Implementing Classes:
ViewServiceImpl

public interface ViewService

Service interface for creating views.


Method Summary
 ViewFactoryChain createFactories(int streamNum, EventType parentEventType, ViewSpec[] viewSpecList, StreamSpecOptions options, StatementContext context)
          Returns a chain of view factories that can be used to obtain the final event type, and that can later be used to actually create the chain of views or reuse existing views.
 ViewServiceCreateResult createViews(Viewable eventStreamViewable, java.util.List<ViewFactory> viewFactoryChain, AgentInstanceViewFactoryChainContext viewFactoryChainContext, boolean hasPreviousNode)
          Creates the views given a chain of view factories.
 void remove(EventStream eventStream, Viewable view)
          Removes a view discoupling the view and any of it's parent views up the tree to the last shared parent view.
 

Method Detail

createFactories

ViewFactoryChain createFactories(int streamNum,
                                 EventType parentEventType,
                                 ViewSpec[] viewSpecList,
                                 StreamSpecOptions options,
                                 StatementContext context)
                                 throws ViewProcessingException
Returns a chain of view factories that can be used to obtain the final event type, and that can later be used to actually create the chain of views or reuse existing views.

Does not actually hook up the view factories or views against the event stream, but creates view factories and sets parameters on each view factory as supplied. Determines if view factories are compatible in the chain via the attach method.

Parameters:
streamNum - - the stream number starting at zero, a join would have N streams
parentEventType - - is the event type of the event stream that originates the raw events
viewSpecList - - the specification for each view factory in the chain to be created
context - - dependent services
options - - stream options such as unidirectional, retain-union etc
Returns:
chain of view factories
Throws:
ViewProcessingException - thrown if a view factory doesn't take parameters as supplied, or cannot hook onto it's parent view or event stream

createViews

ViewServiceCreateResult createViews(Viewable eventStreamViewable,
                                    java.util.List<ViewFactory> viewFactoryChain,
                                    AgentInstanceViewFactoryChainContext viewFactoryChainContext,
                                    boolean hasPreviousNode)
Creates the views given a chain of view factories.

Attempts to reuse compatible views under then parent event stream viewable as indicated by each view factories reuse method.

Parameters:
eventStreamViewable - is the event stream to hook into
viewFactoryChain - defines the list of view factorys to call makeView or canReuse on
viewFactoryChainContext - provides services
Returns:
last viewable in chain, or the eventStreamViewable if no view factories are supplied

remove

void remove(EventStream eventStream,
            Viewable view)
Removes a view discoupling the view and any of it's parent views up the tree to the last shared parent view.

Parameters:
eventStream - - the event stream that originates the raw events
view - - the view (should be the last in a chain) to remove

© 2006-2015 EsperTech Inc.
All rights reserved.
Visit us at espertech.com