com.espertech.esper.event.vaevent
Class ValueAddEventServiceImpl

java.lang.Object
  extended by com.espertech.esper.event.vaevent.ValueAddEventServiceImpl
All Implemented Interfaces:
ValueAddEventService

public class ValueAddEventServiceImpl
extends java.lang.Object
implements ValueAddEventService

Service for handling revision event types.

Each named window instance gets a dedicated revision processor.


Field Summary
protected  java.util.Map<java.lang.String,ValueAddEventProcessor> processorsByNamedWindow
          Map of named window name and processor.
protected  java.util.Map<java.lang.String,RevisionSpec> specificationsByRevisionName
          Map of revision event name and revision compiled specification.
protected  java.util.Map<java.lang.String,ValueAddEventProcessor> variantProcessors
          Map of revision event stream and variant stream processor.
 
Constructor Summary
ValueAddEventServiceImpl()
          Ctor.
 
Method Summary
 void addRevisionEventType(java.lang.String revisioneventTypeName, ConfigurationRevisionEventType config, EventAdapterService eventAdapterService)
          Adds a new revision event types.
 void addVariantStream(java.lang.String variantStreamname, ConfigurationVariantStream variantStreamConfig, EventAdapterService eventAdapterService, EventTypeIdGenerator eventTypeIdGenerator)
          Adds a new variant stream.
 EventType createRevisionType(java.lang.String namedWindowName, java.lang.String name, StatementStopService statementStopService, EventAdapterService eventAdapterService, EventTypeIdGenerator eventTypeIdGenerator)
          Upon named window creation, create a unique revision event type that this window processes.
 EventType[] getValueAddedTypes()
          Returns all event types representing value-add event types.
 ValueAddEventProcessor getValueAddProcessor(java.lang.String name)
          Gets a value-added event processor.
 EventType getValueAddUnderlyingType(java.lang.String name)
          Upon named window creation, and during resolution of type specified as part of a named window create statement, returns looks up the revision event type name provided and return the revision event type if found, or null if not found.
 void init(java.util.Map<java.lang.String,ConfigurationRevisionEventType> configRevision, java.util.Map<java.lang.String,ConfigurationVariantStream> configVariant, EventAdapterService eventAdapterService, EventTypeIdGenerator eventTypeIdGenerator)
          Called at initialization time, verifies configurations provided.
 boolean isRevisionTypeName(java.lang.String revisionTypeName)
          Upon named window creation, check if the name used is a revision event type name.
protected static RevisionSpec validateRevision(java.lang.String revisioneventTypeName, ConfigurationRevisionEventType config, EventAdapterService eventAdapterService)
          Valiate the revision configuration.
static VariantSpec validateVariantStream(java.lang.String variantStreamname, ConfigurationVariantStream variantStreamConfig, EventAdapterService eventAdapterService)
          Validate the variant stream definition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

specificationsByRevisionName

protected final java.util.Map<java.lang.String,RevisionSpec> specificationsByRevisionName
Map of revision event name and revision compiled specification.


processorsByNamedWindow

protected final java.util.Map<java.lang.String,ValueAddEventProcessor> processorsByNamedWindow
Map of named window name and processor.


variantProcessors

protected final java.util.Map<java.lang.String,ValueAddEventProcessor> variantProcessors
Map of revision event stream and variant stream processor.

Constructor Detail

ValueAddEventServiceImpl

public ValueAddEventServiceImpl()
Ctor.

Method Detail

getValueAddedTypes

public EventType[] getValueAddedTypes()
Description copied from interface: ValueAddEventService
Returns all event types representing value-add event types.

Specified by:
getValueAddedTypes in interface ValueAddEventService
Returns:
value-add event type

init

public void init(java.util.Map<java.lang.String,ConfigurationRevisionEventType> configRevision,
                 java.util.Map<java.lang.String,ConfigurationVariantStream> configVariant,
                 EventAdapterService eventAdapterService,
                 EventTypeIdGenerator eventTypeIdGenerator)
          throws ConfigurationException
Description copied from interface: ValueAddEventService
Called at initialization time, verifies configurations provided.

Specified by:
init in interface ValueAddEventService
Parameters:
configRevision - is the revision types to add
configVariant - is the variant streams to add
eventAdapterService - for obtaining event type information for each name
Throws:
ConfigurationException

addRevisionEventType

public void addRevisionEventType(java.lang.String revisioneventTypeName,
                                 ConfigurationRevisionEventType config,
                                 EventAdapterService eventAdapterService)
                          throws ConfigurationException
Description copied from interface: ValueAddEventService
Adds a new revision event types.

Specified by:
addRevisionEventType in interface ValueAddEventService
Parameters:
revisioneventTypeName - to add
config - the revision event type configuration
eventAdapterService - for obtaining event type information for each name
Throws:
ConfigurationException

addVariantStream

public void addVariantStream(java.lang.String variantStreamname,
                             ConfigurationVariantStream variantStreamConfig,
                             EventAdapterService eventAdapterService,
                             EventTypeIdGenerator eventTypeIdGenerator)
                      throws ConfigurationException
Description copied from interface: ValueAddEventService
Adds a new variant stream.

Specified by:
addVariantStream in interface ValueAddEventService
Parameters:
variantStreamname - the name of the type
variantStreamConfig - the configs
eventAdapterService - for handling nested events
Throws:
ConfigurationException - if the configuration is invalid

validateVariantStream

public static VariantSpec validateVariantStream(java.lang.String variantStreamname,
                                                ConfigurationVariantStream variantStreamConfig,
                                                EventAdapterService eventAdapterService)
Validate the variant stream definition.

Parameters:
variantStreamname - the stream name
variantStreamConfig - the configuration information
eventAdapterService - the event adapters
Returns:
specification for variant streams

createRevisionType

public EventType createRevisionType(java.lang.String namedWindowName,
                                    java.lang.String name,
                                    StatementStopService statementStopService,
                                    EventAdapterService eventAdapterService,
                                    EventTypeIdGenerator eventTypeIdGenerator)
Description copied from interface: ValueAddEventService
Upon named window creation, create a unique revision event type that this window processes.

Specified by:
createRevisionType in interface ValueAddEventService
Parameters:
namedWindowName - name of window
name - name to use
statementStopService - for handling stops
eventAdapterService - for event type info
Returns:
revision event type

getValueAddProcessor

public ValueAddEventProcessor getValueAddProcessor(java.lang.String name)
Description copied from interface: ValueAddEventService
Gets a value-added event processor.

Specified by:
getValueAddProcessor in interface ValueAddEventService
Parameters:
name - of the value-add events
Returns:
processor

getValueAddUnderlyingType

public EventType getValueAddUnderlyingType(java.lang.String name)
Description copied from interface: ValueAddEventService
Upon named window creation, and during resolution of type specified as part of a named window create statement, returns looks up the revision event type name provided and return the revision event type if found, or null if not found.

Specified by:
getValueAddUnderlyingType in interface ValueAddEventService
Parameters:
name - to look up
Returns:
null if not found, of event type

isRevisionTypeName

public boolean isRevisionTypeName(java.lang.String revisionTypeName)
Description copied from interface: ValueAddEventService
Upon named window creation, check if the name used is a revision event type name.

Specified by:
isRevisionTypeName in interface ValueAddEventService
Parameters:
revisionTypeName - to check
Returns:
true if revision event type, false if not

validateRevision

protected static RevisionSpec validateRevision(java.lang.String revisioneventTypeName,
                                               ConfigurationRevisionEventType config,
                                               EventAdapterService eventAdapterService)
                                        throws ConfigurationException
Valiate the revision configuration.

Parameters:
revisioneventTypeName - name of revision types
config - configures revision type
eventAdapterService - event adapters
Returns:
revision specification
Throws:
ConfigurationException - if the configs are invalid

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