|
||||||||||
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.
Constructor Summary | |
---|---|
EventAdapterServiceImpl(Map<String,ConfigurationEventTypeLegacy> classToLegacyConfigs)
Ctor. |
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. |
EventType |
addBeanType(String eventTypeAlias,
Class clazz)
Add an event type with the given alias and Java class. |
EventType |
addBeanType(String eventTypeAlias,
String fullyQualClassName)
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. |
void |
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. |
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. |
EventType |
getEventType(String eventName)
Return the event type for a given event name, or null if none is registered for that name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EventAdapterServiceImpl(Map<String,ConfigurationEventTypeLegacy> classToLegacyConfigs)
classToLegacyConfigs
- is a map of event type alias to legacy event type configMethod Detail |
---|
public EventType getEventType(String eventName)
EventAdapterService
getEventType
in interface EventAdapterService
eventName
- is the event type alias name to return type for
public EventType addBeanType(String eventTypeAlias, Class clazz) throws EventAdapterException
EventAdapterService
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
.
addBeanType
in interface EventAdapterService
eventTypeAlias
- is the alias name for the event typeclazz
- is the fully Java class
EventAdapterException
- if alias already exists and doesn't match class namespublic EventType addBeanType(String eventTypeAlias, String fullyQualClassName) throws EventAdapterException
EventAdapterService
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
.
addBeanType
in interface EventAdapterService
eventTypeAlias
- is the alias name for the event typefullyQualClassName
- is the fully qualified class name
EventAdapterException
- if alias already exists and doesn't match class namespublic 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 EventType createAnonymousMapType(Map<String,Class> propertyTypes) throws EventAdapterException
EventAdapterService
New instances are created 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 EventBean adapterForBean(Object event)
EventAdapterService
EventBean
.
adapterForBean
in interface EventAdapterService
event
- to be wrapped
public 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 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 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 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 EventBean adapterForDOM(Node node)
EventAdapterService
adapterForDOM
in interface EventAdapterService
node
- is the node to wrap
public EventType createAnonymousCompositeType(Map<String,EventType> taggedEventTypes)
EventAdapterService
createAnonymousCompositeType
in interface EventAdapterService
taggedEventTypes
- is a map of name keys and event type values
public 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 void addXMLDOMType(String eventTypeAlias, ConfigurationEventTypeXMLDOM configurationEventTypeXMLDOM)
eventTypeAlias
- is the alias name of the event typeconfigurationEventTypeXMLDOM
- configures the event type schema and namespace and XPath
property information.public 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 |