com.espertech.esper.event
Interface EventAdapterService

All Known Implementing Classes:
EventAdapterServiceImpl

public interface EventAdapterService

Interface for a service to resolve event names to event type.


Method Summary
 EventBean adapterForBean(Object event)
          Wrap the native event returning an EventBean.
 EventBean adapterForCompositeEvent(EventType eventType, Map<String,EventBean> taggedEvents)
          Creates a wrapper for a composite event type.
 EventBean adapterForDOM(Node node)
          Returns an adapter for the XML DOM document that exposes it's data as event properties for use in statements.
 EventBean adapterForMap(Map event, String eventTypeAlias)
          Wrap the Map-type event returning an EventBean using the event type alias name to identify the EventType that the event should carry.
 void addAutoAliasPackage(String javaPackageName)
          Adds a Java package name of a package that Java event classes reside in.
 EventType addBeanType(String eventTypeAlias, Class clazz)
          Add an event type with the given alias and Java class.
 EventType addBeanType(String eventTypeAlias, String fullyQualClassName, boolean considerAutoAlias)
          Add an event type with the given alias and Java fully-qualified class name.
 EventType addMapType(String eventTypeAlias, Map<String,Class> propertyTypes)
          Add an event type with the given alias and a given set of properties.
 EventType addNestableMapType(String eventTypeAlias, Map<String,Object> propertyTypes)
          Add an event type with the given alias and a given set of properties, wherein properties may itself be Maps, nested and strongly-typed.
 EventType addWrapperType(String eventTypeAlias, EventType underlyingEventType, Map<String,Object> propertyTypes)
          Add an event type with the given alias and the given underlying event type, as well as the additional given properties.
 EventType addXMLDOMType(String eventTypeAlias, ConfigurationEventTypeXMLDOM configurationEventTypeXMLDOM)
          Adds an XML DOM event type.
 EventType createAddToEventType(EventType originalType, String[] fieldNames, Class[] fieldTypes)
          Create an event type based on the original type passed in adding one or more properties.
 EventType createAnonymousCompositeType(Map<String,EventType> taggedEventTypes)
          Creates an unnamed composite event type with event properties that are name-value pairs with values being other event types.
 EventType createAnonymousMapType(Map<String,Object> propertyTypes)
          Creates a new anonymous EventType instance for an event type that contains a map of name value pairs.
 EventType createAnonymousWrapperType(EventType underlyingEventType, Map<String,Object> propertyTypes)
          Create a new anonymous event type with the given underlying event type, as well as the additional given properties.
 EventBean createMapFromValues(Map<String,Object> properties, EventType eventType)
          Create an event wrapper bean from a set of event properties (name and value objectes) stored in a Map.
 EventBean createWrapper(EventBean event, Map<String,Object> properties, EventType eventType)
          Creata a wrapper around an event and some additional properties
 BeanEventTypeFactory getBeanEventTypeFactory()
          Returns a subset of the functionality of the service specific to creating POJO bean event types.
 EventType getExistsTypeByAlias(String eventTypeAlias)
          Return the event type for a given event name, or null if none is registered for that name.
 void setClassLegacyConfigs(Map<String,ConfigurationEventTypeLegacy> classLegacyInfo)
          Sets the configured legacy Java class information.
 void setDefaultPropertyResolutionStyle(Configuration.PropertyResolutionStyle classPropertyResolutionStyle)
          Sets the resolution style for case-sentitivity.
 

Method Detail

getExistsTypeByAlias

EventType getExistsTypeByAlias(String eventTypeAlias)
Return the event type for a given event name, or null if none is registered for that name.

Parameters:
eventTypeAlias - is the event type alias name to return type for
Returns:
event type for named event, or null if unknown/unnamed type

addMapType

EventType addMapType(String eventTypeAlias,
                     Map<String,Class> propertyTypes)
                     throws EventAdapterException
Add an event type with the given alias and a given set of properties.

If the alias already exists with the same event property information, returns the existing EventType instance.

If the alias already exists with different event property information, throws an exception.

If the alias does not already exists, adds the alias and constructs a new MapEventType.

Parameters:
eventTypeAlias - is the alias name for the event type
propertyTypes - is the names and types of event properties
Returns:
event type is the type added
Throws:
EventAdapterException - if alias already exists and doesn't match property type info

addNestableMapType

EventType addNestableMapType(String eventTypeAlias,
                             Map<String,Object> propertyTypes)
                             throws EventAdapterException
Add an event type with the given alias and a given set of properties, wherein properties may itself be Maps, nested and strongly-typed.

If the alias already exists with the same event property information, returns the existing EventType instance.

If the alias already exists with different event property information, throws an exception.

If the alias does not already exists, adds the alias and constructs a new MapEventType.

Parameters:
eventTypeAlias - is the alias name for the event type
propertyTypes - is the names and types of event properties
Returns:
event type is the type added
Throws:
EventAdapterException - if alias already exists and doesn't match property type info

addWrapperType

EventType addWrapperType(String eventTypeAlias,
                         EventType underlyingEventType,
                         Map<String,Object> propertyTypes)
                         throws EventAdapterException
Add an event type with the given alias and the given underlying event type, as well as the additional given properties.

Parameters:
eventTypeAlias - is the alias name for the event type
underlyingEventType - is the event type for the event type that this wrapper wraps
propertyTypes - is the names and types of any additional properties
Returns:
eventType is the type added
Throws:
EventAdapterException - if alias already exists and doesn't match this type's info

createAnonymousMapType

EventType createAnonymousMapType(Map<String,Object> propertyTypes)
Creates a new anonymous EventType instance for an event type that contains a map of name value pairs. The method accepts a Map that contains the property names as keys and Class objects as the values. The Class instances represent the property types.

New instances are createdStatement by this method on every invocation. Clients to this method need to cache the returned EventType instance to reuse EventType's for same-typed events.

Parameters:
propertyTypes - is a map of String to Class objects
Returns:
EventType implementation for map field names and value types

createMapFromValues

EventBean createMapFromValues(Map<String,Object> properties,
                              EventType eventType)
Create an event wrapper bean from a set of event properties (name and value objectes) stored in a Map.

Parameters:
properties - is key-value pairs for the event properties
eventType - is the type metadata for any maps of that type
Returns:
EventBean instance

createWrapper

EventBean createWrapper(EventBean event,
                        Map<String,Object> properties,
                        EventType eventType)
Creata a wrapper around an event and some additional properties

Parameters:
event - is the wrapped event
properties - are the additional properties
eventType - os the type metadata for any wrappers of this type
Returns:
wrapper event bean

addBeanType

EventType addBeanType(String eventTypeAlias,
                      String fullyQualClassName,
                      boolean considerAutoAlias)
                      throws EventAdapterException
Add an event type with the given alias and Java fully-qualified class name.

If the alias already exists with the same class name, returns the existing EventType instance.

If the alias already exists with different class name, throws an exception.

If the alias does not already exists, adds the alias and constructs a new BeanEventType.

Takes into account all event-type-auto-alias-package names supplied and attempts to resolve the class name via the packages if the direct resolution failed.

Parameters:
eventTypeAlias - is the alias name for the event type
fullyQualClassName - is the fully qualified class name
considerAutoAlias - whether auto-alias by Java packages should be considered
Returns:
event type is the type added
Throws:
EventAdapterException - if alias already exists and doesn't match class names

addBeanType

EventType addBeanType(String eventTypeAlias,
                      Class clazz)
                      throws EventAdapterException
Add an event type with the given alias and Java class.

If the alias already exists with the same Class, returns the existing EventType instance.

If the alias already exists with different Class name, throws an exception.

If the alias does not already exists, adds the alias and constructs a new BeanEventType.

Parameters:
eventTypeAlias - is the alias name for the event type
clazz - is the fully Java class
Returns:
event type is the type added
Throws:
EventAdapterException - if alias already exists and doesn't match class names

adapterForBean

EventBean adapterForBean(Object event)
Wrap the native event returning an EventBean.

Parameters:
event - to be wrapped
Returns:
event bean wrapping native underlying event

adapterForMap

EventBean adapterForMap(Map event,
                        String eventTypeAlias)
                        throws EventAdapterException
Wrap the Map-type event returning an EventBean using the event type alias name to identify the EventType that the event should carry.

Parameters:
event - to be wrapped
eventTypeAlias - alias for the event type of the event
Returns:
event bean wrapping native underlying event
Throws:
EventAdapterException - if the alias has not been declared, or the event cannot be wrapped using that alias's event type

createAddToEventType

EventType createAddToEventType(EventType originalType,
                               String[] fieldNames,
                               Class[] fieldTypes)
Create an event type based on the original type passed in adding one or more properties.

Parameters:
originalType - - event type to add property to
fieldNames - - names of properties
fieldTypes - - types of properties
Returns:
new event type

adapterForDOM

EventBean adapterForDOM(Node node)
Returns an adapter for the XML DOM document that exposes it's data as event properties for use in statements.

Parameters:
node - is the node to wrap
Returns:
event wrapper for document

createAnonymousCompositeType

EventType createAnonymousCompositeType(Map<String,EventType> taggedEventTypes)
Creates an unnamed composite event type with event properties that are name-value pairs with values being other event types. Pattern statement generate events of such type.

Parameters:
taggedEventTypes - is a map of name keys and event type values
Returns:
event type representing a composite event

adapterForCompositeEvent

EventBean adapterForCompositeEvent(EventType eventType,
                                   Map<String,EventBean> taggedEvents)
Creates a wrapper for a composite event type. The wrapper wraps an event that consists of name-value pairs in which the values are other already-wrapped events.

Parameters:
eventType - is the composite event type
taggedEvents - is the name-event map
Returns:
wrapper for composite event

createAnonymousWrapperType

EventType createAnonymousWrapperType(EventType underlyingEventType,
                                     Map<String,Object> propertyTypes)
                                     throws EventAdapterException
Create a new anonymous event type with the given underlying event type, as well as the additional given properties.

Parameters:
underlyingEventType - is the event type for the event type that this wrapper wraps
propertyTypes - is the names and types of any additional properties
Returns:
eventType is the type createdStatement
Throws:
EventAdapterException - if alias already exists and doesn't match this type's info

addXMLDOMType

EventType addXMLDOMType(String eventTypeAlias,
                        ConfigurationEventTypeXMLDOM configurationEventTypeXMLDOM)
Adds an XML DOM event type.

Parameters:
eventTypeAlias - is the alias to add the type for
configurationEventTypeXMLDOM - is the XML DOM config info
Returns:
event type

setClassLegacyConfigs

void setClassLegacyConfigs(Map<String,ConfigurationEventTypeLegacy> classLegacyInfo)
Sets the configured legacy Java class information.

Parameters:
classLegacyInfo - is configured legacy

setDefaultPropertyResolutionStyle

void setDefaultPropertyResolutionStyle(Configuration.PropertyResolutionStyle classPropertyResolutionStyle)
Sets the resolution style for case-sentitivity.

Parameters:
classPropertyResolutionStyle - for resolving properties.

addAutoAliasPackage

void addAutoAliasPackage(String javaPackageName)
Adds a Java package name of a package that Java event classes reside in.

Parameters:
javaPackageName - is the fully-qualified Java package name of the Java package that event classes reside in

getBeanEventTypeFactory

BeanEventTypeFactory getBeanEventTypeFactory()
Returns a subset of the functionality of the service specific to creating POJO bean event types.

Returns:
bean event type factory

© 2007 EsperTech Inc.
All rights reserved.
Visit us at espertech.com