public class ViewServiceHelper
extends java.lang.Object
Constructor and Description |
---|
ViewServiceHelper() |
Modifier and Type | Method and Description |
---|---|
protected static void |
addMergeViews(java.util.List<ViewSpec> specifications)
Add merge views for any views in the chain requiring a merge (group view).
|
static java.util.Set<java.lang.String> |
getUniqueCandidateProperties(java.util.List<ViewFactory> viewFactory,
java.lang.annotation.Annotation[] annotations) |
static java.util.List<View> |
instantiateChain(Viewable parentViewable,
java.util.List<ViewFactory> viewFactories,
AgentInstanceViewFactoryChainContext viewFactoryChainContext)
Instantiate a chain of views.
|
static java.util.List<ViewFactory> |
instantiateFactories(int streamNum,
java.util.List<ViewSpec> viewSpecList,
StatementContext statementContext,
boolean isSubquery,
int subqueryNumber)
Given a list of view specifications obtained from by parsing this method instantiates a list of view factories.
|
protected static Pair<Viewable,java.util.List<View>> |
matchExistingViews(Viewable rootViewable,
java.util.List<ViewFactory> viewFactories,
AgentInstanceContext agentInstanceContext)
Match the views under the stream to the list of view specications passed in.
|
protected static java.util.List<View> |
removeChainLeafView(Viewable parentViewable,
Viewable viewToRemove)
Removes a view from a parent view returning the orphaned parent views in a list.
|
static void |
removeFirstUnsharedView(java.util.List<View> childViews) |
public static java.util.Set<java.lang.String> getUniqueCandidateProperties(java.util.List<ViewFactory> viewFactory, java.lang.annotation.Annotation[] annotations)
protected static void addMergeViews(java.util.List<ViewSpec> specifications) throws ViewProcessingException
specifications
- is a list of view definitions defining the chain of views.ViewProcessingException
- indicating that the view chain configuration is invalidpublic static java.util.List<View> instantiateChain(Viewable parentViewable, java.util.List<ViewFactory> viewFactories, AgentInstanceViewFactoryChainContext viewFactoryChainContext)
parentViewable
- - parent view to add the chain toviewFactories
- - is the view factories to use to make each view, or reuse and existing viewviewFactoryChainContext
- contextpublic static void removeFirstUnsharedView(java.util.List<View> childViews)
protected static java.util.List<View> removeChainLeafView(Viewable parentViewable, Viewable viewToRemove)
parentViewable
- - parent to remove view fromviewToRemove
- - view to removeprotected static Pair<Viewable,java.util.List<View>> matchExistingViews(Viewable rootViewable, java.util.List<ViewFactory> viewFactories, AgentInstanceContext agentInstanceContext)
rootViewable
- is the top rootViewable event stream to which all views are attached as child views
This parameter is changed by this method, ie. specifications are removed if they match existing views.viewFactories
- is the view specifications for making viewsagentInstanceContext
- agent instance contextpublic static java.util.List<ViewFactory> instantiateFactories(int streamNum, java.util.List<ViewSpec> viewSpecList, StatementContext statementContext, boolean isSubquery, int subqueryNumber) throws ViewProcessingException
streamNum
- is the stream numberviewSpecList
- is the view definitionstatementContext
- is statement service context and statement infoisSubquery
- subquery indicatorsubqueryNumber
- for subqueriesViewProcessingException
- if the factory cannot be creates such as for invalid view spec