|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.esper.event.EventAdapterServiceImpl
public class EventAdapterServiceImpl
Implementation for resolving event name to event type.
The implementation assigned a unique identifier to each event type. For Class-based event types, only one EventType instance and one event type id exists for the same class.
Alias names must be unique, that is an alias name must resolve to a single event type.
Each event type can have multiple aliases defined for it. For example, expressions such as "select * from A" and "select * from B" in which A and B are aliases for the same class X the select clauses each fireStatementStopped for events of type X. In summary, aliases A and B point to the same underlying event type and therefore event type id.
Constructor Summary | |
---|---|
EventAdapterServiceImpl()
Ctor. |
Method Summary | |
---|---|
EventBean |
adapterForBean(Object event)
Create an event bean given an event of object id. |
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. |
EventType |
addBeanType(String eventTypeAlias,
Class clazz)
Add an alias and class as an event type. |
EventType |
addBeanType(String eventTypeAlias,
String fullyQualClassName)
Add an event type for the given Java 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 |
addWrapperType(String eventTypeAlias,
EventType underlyingEventType,
Map<String,Class> 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)
Add a configured 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,Class> propertyTypes)
Creates a new anonymous EventType instance for an event type that contains a map of name value pairs. |
EventType |
createAnonymousMapTypeUnd(Map<String,EventType> 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,Class> propertyTypes)
Create a new anonymous event type with the given underlying event type, as well as the additional given properties. |
EventBean |
createMapFromUnderlying(Map<String,EventBean> events,
EventType eventType)
Create an aggregate event wrapper bean from a set of named events stored in a Map. |
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 |
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> classToLegacyConfigs)
Set the legacy Java class type information. |
void |
setDefaultPropertyResolutionStyle(Configuration.PropertyResolutionStyle defaultPropertyResolutionStyle)
Sets the default property resolution style. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EventAdapterServiceImpl()
Method Detail |
---|
public void setClassLegacyConfigs(Map<String,ConfigurationEventTypeLegacy> classToLegacyConfigs)
setClassLegacyConfigs
in interface EventAdapterService
classToLegacyConfigs
- is the legacy class configspublic void setDefaultPropertyResolutionStyle(Configuration.PropertyResolutionStyle defaultPropertyResolutionStyle)
defaultPropertyResolutionStyle
- is the default stylepublic EventType getExistsTypeByAlias(String eventTypeAlias)
EventAdapterService
getExistsTypeByAlias
in interface EventAdapterService
eventTypeAlias
- is the event type alias name to return type for
public EventType addBeanType(String eventTypeAlias, Class clazz) throws EventAdapterException
addBeanType
in interface EventAdapterService
eventTypeAlias
- is the aliasclazz
- is the Java class to add
EventAdapterException
- to indicate an error constructing the typepublic EventBean adapterForBean(Object event)
adapterForBean
in interface EventAdapterService
event
- is the event class
public EventType addBeanType(String eventTypeAlias, String fullyQualClassName) throws EventAdapterException
addBeanType
in interface EventAdapterService
eventTypeAlias
- is the aliasfullyQualClassName
- is the Java class name
EventAdapterException
- if the Class name cannot resolve or other error occuredpublic EventType addMapType(String eventTypeAlias, Map<String,Class> propertyTypes) throws EventAdapterException
EventAdapterService
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
.
addMapType
in interface EventAdapterService
eventTypeAlias
- is the alias name for the event typepropertyTypes
- is the names and types of event properties
EventAdapterException
- if alias already exists and doesn't match property type infopublic EventBean adapterForMap(Map event, String eventTypeAlias) throws EventAdapterException
EventAdapterService
EventBean
using the event type alias name
to identify the EventType that the event should carry.
adapterForMap
in interface EventAdapterService
event
- to be wrappedeventTypeAlias
- alias for the event type of the event
EventAdapterException
- if the alias has not been declared, or the event cannot be wrapped using that
alias's event typepublic EventBean adapterForDOM(Node node)
EventAdapterService
adapterForDOM
in interface EventAdapterService
node
- is the node to wrap
public EventType addXMLDOMType(String eventTypeAlias, ConfigurationEventTypeXMLDOM configurationEventTypeXMLDOM)
addXMLDOMType
in interface EventAdapterService
eventTypeAlias
- is the alias name of the event typeconfigurationEventTypeXMLDOM
- configures the event type schema and namespace and XPath
property information.
public final EventBean createMapFromValues(Map<String,Object> properties, EventType eventType)
EventAdapterService
createMapFromValues
in interface EventAdapterService
properties
- is key-value pairs for the event propertieseventType
- is the type metadata for any maps of that type
public EventType addWrapperType(String eventTypeAlias, EventType underlyingEventType, Map<String,Class> propertyTypes) throws EventAdapterException
EventAdapterService
addWrapperType
in interface EventAdapterService
eventTypeAlias
- is the alias name for the event typeunderlyingEventType
- is the event type for the event type that this wrapper wrapspropertyTypes
- is the names and types of any additional properties
EventAdapterException
- if alias already exists and doesn't match this type's infopublic final EventType createAnonymousMapType(Map<String,Class> propertyTypes) throws EventAdapterException
EventAdapterService
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.
createAnonymousMapType
in interface EventAdapterService
propertyTypes
- is a map of String to Class objects
EventAdapterException
public final EventType createAnonymousWrapperType(EventType underlyingEventType, Map<String,Class> propertyTypes) throws EventAdapterException
EventAdapterService
createAnonymousWrapperType
in interface EventAdapterService
underlyingEventType
- is the event type for the event type that this wrapper wrapspropertyTypes
- is the names and types of any additional properties
EventAdapterException
- if alias already exists and doesn't match this type's infopublic final EventBean createMapFromUnderlying(Map<String,EventBean> events, EventType eventType)
EventAdapterService
createMapFromUnderlying
in interface EventAdapterService
events
- is key-value pairs where the key is the event name and the value is the eventeventType
- is the type metadata for any maps of that type
public final EventType createAddToEventType(EventType originalType, String[] fieldNames, Class[] fieldTypes)
EventAdapterService
createAddToEventType
in interface EventAdapterService
originalType
- - event type to add property tofieldNames
- - names of propertiesfieldTypes
- - types of properties
public final EventType createAnonymousCompositeType(Map<String,EventType> taggedEventTypes)
EventAdapterService
createAnonymousCompositeType
in interface EventAdapterService
taggedEventTypes
- is a map of name keys and event type values
public final EventBean createWrapper(EventBean event, Map<String,Object> properties, EventType eventType)
EventAdapterService
createWrapper
in interface EventAdapterService
event
- is the wrapped eventproperties
- are the additional propertieseventType
- os the type metadata for any wrappers of this type
public final EventBean adapterForCompositeEvent(EventType eventType, Map<String,EventBean> taggedEvents)
EventAdapterService
adapterForCompositeEvent
in interface EventAdapterService
eventType
- is the composite event typetaggedEvents
- is the name-event map
public final EventType createAnonymousMapTypeUnd(Map<String,EventType> propertyTypes)
EventAdapterService
createAnonymousMapTypeUnd
in interface EventAdapterService
propertyTypes
- is a map of String to EventType objects
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |