com.espertech.esper.view.internal
Class IntersectViewFactory

java.lang.Object
  extended by com.espertech.esper.view.internal.IntersectViewFactory
All Implemented Interfaces:
DataWindowViewFactory, DataWindowViewFactoryUniqueCandidate, ViewFactory

public class IntersectViewFactory
extends java.lang.Object
implements ViewFactory, DataWindowViewFactory, DataWindowViewFactoryUniqueCandidate

Factory for union-views.


Field Summary
protected  EventType parentEventType
          The event type.
protected  java.util.List<ViewFactory> viewFactories
          The view factories.
 
Constructor Summary
IntersectViewFactory()
          Ctor.
 
Method Summary
 void attach(EventType parentEventType, StatementContext statementContext, ViewFactory optionalParentFactory, java.util.List<ViewFactory> parentViewFactories)
          Attaches the factory to a parent event type such that the factory can validate attach requirements and determine an event type for resulting views.
 boolean canReuse(View view)
          Determines if the given view could be used instead of creating a new view, requires the view factory to compare view type, parameters and other capabilities provided.
 EventType getEventType()
          Returns the event type that the view that is created by the view factory would create for events posted by the view.
 java.util.Set<java.lang.String> getUniquenessCandidatePropertyNames()
           
 java.lang.String getViewName()
          Returns the name of the view, not namespace+name but readable name.
protected static java.lang.String getViewNameUnionIntersect(boolean intersect, java.util.Collection<ViewFactory> factories)
           
 View makeView(AgentInstanceViewFactoryChainContext agentInstanceViewFactoryContext)
          Create a new view.
 void setParentEventType(EventType parentEventType)
          Sets the parent event type.
 void setViewFactories(java.util.List<ViewFactory> viewFactories)
          Sets the view factories.
 void setViewParameters(ViewFactoryContext viewFactoryContext, java.util.List<ExprNode> viewParameters)
          Indicates user EPL query view parameters to the view factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parentEventType

protected EventType parentEventType
The event type.


viewFactories

protected java.util.List<ViewFactory> viewFactories
The view factories.

Constructor Detail

IntersectViewFactory

public IntersectViewFactory()
Ctor.

Method Detail

setParentEventType

public void setParentEventType(EventType parentEventType)
Sets the parent event type.

Parameters:
parentEventType - type

setViewFactories

public void setViewFactories(java.util.List<ViewFactory> viewFactories)
Sets the view factories.

Parameters:
viewFactories - factories

setViewParameters

public void setViewParameters(ViewFactoryContext viewFactoryContext,
                              java.util.List<ExprNode> viewParameters)
                       throws ViewParameterException
Description copied from interface: ViewFactory
Indicates user EPL query view parameters to the view factory.

Specified by:
setViewParameters in interface ViewFactory
Parameters:
viewFactoryContext - supplied context information for the view factory
viewParameters - is the objects representing the view parameters
Throws:
ViewParameterException - if the parameters don't match view parameter needs

attach

public void attach(EventType parentEventType,
                   StatementContext statementContext,
                   ViewFactory optionalParentFactory,
                   java.util.List<ViewFactory> parentViewFactories)
            throws ViewParameterException
Description copied from interface: ViewFactory
Attaches the factory to a parent event type such that the factory can validate attach requirements and determine an event type for resulting views.

Specified by:
attach in interface ViewFactory
Parameters:
parentEventType - is the parent event stream's or view factory's event type
statementContext - contains the services needed for creating a new event type
optionalParentFactory - is null when there is no parent view factory, or contains the parent view factory
parentViewFactories - is a list of all the parent view factories or empty list if there are none
Throws:
ViewParameterException - is thrown to indicate that this view factories's view would not play with the parent view factories view

makeView

public View makeView(AgentInstanceViewFactoryChainContext agentInstanceViewFactoryContext)
Description copied from interface: ViewFactory
Create a new view.

Specified by:
makeView in interface ViewFactory

getEventType

public EventType getEventType()
Description copied from interface: ViewFactory
Returns the event type that the view that is created by the view factory would create for events posted by the view.

Specified by:
getEventType in interface ViewFactory
Returns:
event type of view's created by the view factory

canReuse

public boolean canReuse(View view)
Description copied from interface: ViewFactory
Determines if the given view could be used instead of creating a new view, requires the view factory to compare view type, parameters and other capabilities provided.

Specified by:
canReuse in interface ViewFactory
Parameters:
view - is the candidate view to compare to
Returns:
true if the given view can be reused instead of creating a new view, or false to indicate the view is not right for reuse

getUniquenessCandidatePropertyNames

public java.util.Set<java.lang.String> getUniquenessCandidatePropertyNames()
Specified by:
getUniquenessCandidatePropertyNames in interface DataWindowViewFactoryUniqueCandidate

getViewName

public java.lang.String getViewName()
Description copied from interface: ViewFactory
Returns the name of the view, not namespace+name but readable name.

Specified by:
getViewName in interface ViewFactory
Returns:
readable name

getViewNameUnionIntersect

protected static java.lang.String getViewNameUnionIntersect(boolean intersect,
                                                            java.util.Collection<ViewFactory> factories)

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