com.espertech.esper.epl.core
Class StreamTypeServiceImpl

java.lang.Object
  extended by com.espertech.esper.epl.core.StreamTypeServiceImpl
All Implemented Interfaces:
StreamTypeService

public class StreamTypeServiceImpl
extends java.lang.Object
implements StreamTypeService

Implementation that provides stream number and property type information.


Constructor Summary
StreamTypeServiceImpl(EventType[] eventTypes, java.lang.String[] streamNames, boolean[] isIStreamOnly, java.lang.String engineURI, boolean isOnDemandStreams)
          Ctor.
StreamTypeServiceImpl(EventType eventType, java.lang.String streamName, boolean isIStreamOnly, java.lang.String engineURI)
          Ctor.
StreamTypeServiceImpl(java.util.LinkedHashMap<java.lang.String,Pair<EventType,java.lang.String>> namesAndTypes, java.lang.String engineURI, boolean isStreamZeroUnambigous, boolean requireStreamNames)
          Ctor.
StreamTypeServiceImpl(java.lang.String engineURI, boolean isOnDemandStreams)
          Ctor.
 
Method Summary
 java.lang.String getEngineURIQualifier()
           
 EventType[] getEventTypes()
          Returns an array of event types for each event stream in the order declared.
 boolean[] getIStreamOnly()
          Returns true for each stream without a data window.
 java.lang.String[] getStreamNames()
          Returns an array of event stream names in the order declared.
 int getStreamNumForStreamName(java.lang.String streamWildcard)
           
 boolean hasPropertyAgnosticType()
           
 boolean hasTableTypes()
           
 boolean isOnDemandStreams()
           
 boolean isStreamZeroUnambigous()
           
 PropertyResolutionDescriptor resolveByPropertyName(java.lang.String propertyName, boolean obtainFragment)
          Returns the offset of the stream and the type of the property for the given property name, by looking through the types offered and matching up.
 PropertyResolutionDescriptor resolveByPropertyNameExplicitProps(java.lang.String propertyName, boolean obtainFragment)
          Returns the offset of the stream and the type of the property for the given property name, by looking through the types offered considering only explicitly listed properties and matching up.
 PropertyResolutionDescriptor resolveByStreamAndPropName(java.lang.String streamAndPropertyName, boolean obtainFragment)
          Returns the offset of the stream and the type of the property for the given property name, by looking through the types offered and matching up.
 PropertyResolutionDescriptor resolveByStreamAndPropName(java.lang.String streamName, java.lang.String propertyName, boolean obtainFragment)
          Returns the offset of the stream and the type of the property for the given property name, by using the specified stream name to resolve the property.
 PropertyResolutionDescriptor resolveByStreamAndPropNameExplicitProps(java.lang.String streamName, java.lang.String propertyName, boolean obtainFragment)
          Returns the offset of the stream and the type of the property for the given property name, by using the specified stream name to resolve the property and considering only explicitly listed properties.
 void setRequireStreamNames(boolean requireStreamNames)
           
 void setStreamZeroUnambigous(boolean streamZeroUnambigous)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamTypeServiceImpl

public StreamTypeServiceImpl(java.lang.String engineURI,
                             boolean isOnDemandStreams)
Ctor.

Parameters:
engineURI - engine URI
isOnDemandStreams -

StreamTypeServiceImpl

public StreamTypeServiceImpl(EventType eventType,
                             java.lang.String streamName,
                             boolean isIStreamOnly,
                             java.lang.String engineURI)
Ctor.

Parameters:
eventType - a single event type for a single stream
streamName - the stream name of the single stream
engineURI - engine URI
isIStreamOnly - true for no datawindow for stream

StreamTypeServiceImpl

public StreamTypeServiceImpl(EventType[] eventTypes,
                             java.lang.String[] streamNames,
                             boolean[] isIStreamOnly,
                             java.lang.String engineURI,
                             boolean isOnDemandStreams)
Ctor.

Parameters:
eventTypes - - array of event types, one for each stream
streamNames - - array of stream names, one for each stream
isIStreamOnly - true for no datawindow for stream
engineURI - - engine URI
isOnDemandStreams - - true to indicate that all streams are on-demand pull-based

StreamTypeServiceImpl

public StreamTypeServiceImpl(java.util.LinkedHashMap<java.lang.String,Pair<EventType,java.lang.String>> namesAndTypes,
                             java.lang.String engineURI,
                             boolean isStreamZeroUnambigous,
                             boolean requireStreamNames)
Ctor.

Parameters:
namesAndTypes - is the ordered list of stream names and event types available (stream zero to N)
isStreamZeroUnambigous - indicates whether when a property is found in stream zero and another stream an exception should be thrown or the stream zero should be assumed
engineURI - uri of the engine
requireStreamNames - is true to indicate that stream names are required for any non-zero streams (for subqueries)
Method Detail

setRequireStreamNames

public void setRequireStreamNames(boolean requireStreamNames)

isOnDemandStreams

public boolean isOnDemandStreams()
Specified by:
isOnDemandStreams in interface StreamTypeService

getEventTypes

public EventType[] getEventTypes()
Description copied from interface: StreamTypeService
Returns an array of event types for each event stream in the order declared.

Specified by:
getEventTypes in interface StreamTypeService
Returns:
event types

getStreamNames

public java.lang.String[] getStreamNames()
Description copied from interface: StreamTypeService
Returns an array of event stream names in the order declared.

Specified by:
getStreamNames in interface StreamTypeService
Returns:
stream names

getIStreamOnly

public boolean[] getIStreamOnly()
Description copied from interface: StreamTypeService
Returns true for each stream without a data window.

Specified by:
getIStreamOnly in interface StreamTypeService
Returns:
true for non-windowed streams.

getStreamNumForStreamName

public int getStreamNumForStreamName(java.lang.String streamWildcard)
Specified by:
getStreamNumForStreamName in interface StreamTypeService

resolveByPropertyName

public PropertyResolutionDescriptor resolveByPropertyName(java.lang.String propertyName,
                                                          boolean obtainFragment)
                                                   throws DuplicatePropertyException,
                                                          PropertyNotFoundException
Description copied from interface: StreamTypeService
Returns the offset of the stream and the type of the property for the given property name, by looking through the types offered and matching up.

This method considers only a property name and looks at all streams to resolve the property name.

Specified by:
resolveByPropertyName in interface StreamTypeService
Parameters:
propertyName - - property name in event
Returns:
descriptor with stream number, property type and property name
Throws:
DuplicatePropertyException - to indicate property was found twice
PropertyNotFoundException - to indicate property could not be resolved

resolveByPropertyNameExplicitProps

public PropertyResolutionDescriptor resolveByPropertyNameExplicitProps(java.lang.String propertyName,
                                                                       boolean obtainFragment)
                                                                throws PropertyNotFoundException,
                                                                       DuplicatePropertyException
Description copied from interface: StreamTypeService
Returns the offset of the stream and the type of the property for the given property name, by looking through the types offered considering only explicitly listed properties and matching up.

This method considers only a property name and looks at all streams to resolve the property name.

Specified by:
resolveByPropertyNameExplicitProps in interface StreamTypeService
Parameters:
propertyName - - property name in event
Returns:
descriptor with stream number, property type and property name
Throws:
PropertyNotFoundException - to indicate property could not be resolved
DuplicatePropertyException - to indicate property was found twice

resolveByStreamAndPropName

public PropertyResolutionDescriptor resolveByStreamAndPropName(java.lang.String streamName,
                                                               java.lang.String propertyName,
                                                               boolean obtainFragment)
                                                        throws PropertyNotFoundException,
                                                               StreamNotFoundException
Description copied from interface: StreamTypeService
Returns the offset of the stream and the type of the property for the given property name, by using the specified stream name to resolve the property.

This method considers and explicit stream name and property name, both parameters are required.

Specified by:
resolveByStreamAndPropName in interface StreamTypeService
Parameters:
streamName - - name of stream, required
propertyName - - property name in event, , required
Returns:
descriptor with stream number, property type and property name
Throws:
PropertyNotFoundException - to indicate property could not be resolved
StreamNotFoundException - to indicate stream name could not be resolved

resolveByStreamAndPropNameExplicitProps

public PropertyResolutionDescriptor resolveByStreamAndPropNameExplicitProps(java.lang.String streamName,
                                                                            java.lang.String propertyName,
                                                                            boolean obtainFragment)
                                                                     throws PropertyNotFoundException,
                                                                            StreamNotFoundException
Description copied from interface: StreamTypeService
Returns the offset of the stream and the type of the property for the given property name, by using the specified stream name to resolve the property and considering only explicitly listed properties.

This method considers and explicit stream name and property name, both parameters are required.

Specified by:
resolveByStreamAndPropNameExplicitProps in interface StreamTypeService
Parameters:
streamName - - name of stream, required
propertyName - - property name in event, , required
Returns:
descriptor with stream number, property type and property name
Throws:
PropertyNotFoundException - to indicate property could not be resolved
StreamNotFoundException - to indicate stream name could not be resolved

resolveByStreamAndPropName

public PropertyResolutionDescriptor resolveByStreamAndPropName(java.lang.String streamAndPropertyName,
                                                               boolean obtainFragment)
                                                        throws DuplicatePropertyException,
                                                               PropertyNotFoundException
Description copied from interface: StreamTypeService
Returns the offset of the stream and the type of the property for the given property name, by looking through the types offered and matching up.

This method considers a single property name that may or may not be prefixed by a stream name. The resolution first attempts to find the property name itself, then attempts to consider a stream name that may be part of the property name.

Specified by:
resolveByStreamAndPropName in interface StreamTypeService
Parameters:
streamAndPropertyName - - stream name and property name (e.g. s0.p0) or just a property name (p0)
Returns:
descriptor with stream number, property type and property name
Throws:
DuplicatePropertyException - to indicate property was found twice
PropertyNotFoundException - to indicate property could not be resolved

getEngineURIQualifier

public java.lang.String getEngineURIQualifier()
Specified by:
getEngineURIQualifier in interface StreamTypeService

hasPropertyAgnosticType

public boolean hasPropertyAgnosticType()
Specified by:
hasPropertyAgnosticType in interface StreamTypeService

setStreamZeroUnambigous

public void setStreamZeroUnambigous(boolean streamZeroUnambigous)

hasTableTypes

public boolean hasTableTypes()
Specified by:
hasTableTypes in interface StreamTypeService

isStreamZeroUnambigous

public boolean isStreamZeroUnambigous()
Specified by:
isStreamZeroUnambigous in interface StreamTypeService

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