public class WrapperEventType extends Object implements EventTypeSPI
The additional fields are represented as a Map. Any queries to event properties are first held against the additional fields, and secondly are handed through to the underlying event.
If this event type is to add information to another wrapper event type (wrapper to wrapper), then it is the responsibility of the creating logic to use the existing event type and add to it.
Uses a the map event type MapEventType
to represent the mapped properties. This is because the additional properties
can also be beans or complex types and the Map event type handles these nicely.
Modifier and Type | Class and Description |
---|---|
static class |
WrapperEventType.PropertyDescriptorComposite |
Modifier and Type | Field and Description |
---|---|
protected EventTypeMetadata |
metadata
event type metadata
|
protected EventType |
underlyingEventType
The underlying wrapped event type.
|
protected MapEventType |
underlyingMapType
The map event type that provides the additional properties.
|
Constructor and Description |
---|
WrapperEventType(EventTypeMetadata metadata,
String typeName,
int eventTypeId,
EventType eventType,
Map<String,Object> properties,
EventAdapterService eventAdapterService)
Ctor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equalsCompareType(EventType otherEventType) |
EventBeanCopyMethod |
getCopyMethod(String[] properties)
Returns the copy method, considering only the attached properties for a write operation onto the copy
|
Iterator<EventType> |
getDeepSuperTypes()
Returns iterator over all super types to event type, going up the hierarchy and including all
Java interfaces (and their extended interfaces) and superclasses as EventType instances.
|
String |
getEndTimestampPropertyName()
Returns the property name of the property providing the end timestamp value.
|
int |
getEventTypeId()
Returns the event type id assigned to the event type.
|
FragmentEventType |
getFragmentType(String property)
Returns the event type of the fragment that is the value of a property name or property expression.
|
EventPropertyGetter |
getGetter(String propertyName)
Get the getter of an event property or property expression: Getters are useful when an application
receives events of the same event type multiple times and requires fast access
to an event property or nested, indexed or mapped property.
|
EventPropertyGetterIndexed |
getGetterIndexed(String indexedPropertyName)
Get the getter of an event property that is a indexed event property: Getters are useful when an application
receives events of the same event type multiple times and requires fast access
to a indexed property.
|
EventPropertyGetterIndexedSPI |
getGetterIndexedSPI(String indexedProperty) |
EventPropertyGetterMapped |
getGetterMapped(String mappedProperty)
Get the getter of an event property that is a mapped event property: Getters are useful when an application
receives events of the same event type multiple times and requires fast access
to a mapped property.
|
EventPropertyGetterMappedSPI |
getGetterMappedSPI(String mappedProperty) |
EventPropertyGetterSPI |
getGetterSPI(String property) |
EventTypeMetadata |
getMetadata()
Returns the type metadata.
|
String |
getName()
Returns the type name or null if no type name is assigned.
|
EventPropertyDescriptor |
getPropertyDescriptor(String propertyName)
Get the property descriptor for a given property of the event, or null
if a property by that name was not found.
|
EventPropertyDescriptor[] |
getPropertyDescriptors()
Get property descriptors for the event type.
|
String[] |
getPropertyNames()
Get the property names for the event type.
|
Class |
getPropertyType(String property)
Get the type of an event property.
|
EventBeanReader |
getReader()
Returns a reader for reading all properties of an event.
|
String |
getStartTimestampPropertyName()
Returns the property name of the property providing the start timestamp value.
|
EventType[] |
getSuperTypes()
Returns an array of event types that are super to this event type, from which this event type inherited event properties.
|
EventType |
getUnderlyingEventType()
Returns the wrapped event type.
|
MapEventType |
getUnderlyingMapType()
Returns the map type.
|
Class |
getUnderlyingType()
Get the class that represents the Java type of the event type.
|
EventPropertyDescriptor |
getWritableProperty(String propertyName)
Returns the descriptor for a writable property.
|
EventPropertyDescriptor[] |
getWriteableProperties()
Returns the writable properties.
|
EventPropertyWriter |
getWriter(String propertyName)
Return a writer for writing a single property value.
|
EventBeanWriter |
getWriter(String[] properties)
Returns the write for writing a set of properties.
|
boolean |
isProperty(String property)
Check that the given property name or property expression is valid for this event type, ie.
|
String |
toString() |
protected final EventTypeMetadata metadata
protected final EventType underlyingEventType
protected final MapEventType underlyingMapType
public WrapperEventType(EventTypeMetadata metadata, String typeName, int eventTypeId, EventType eventType, Map<String,Object> properties, EventAdapterService eventAdapterService)
typeName
- is the event type nameeventType
- is the event type of the wrapped eventsproperties
- is the additional properties this wrapper addsmetadata
- event type metadataeventAdapterService
- is the service for resolving unknown wrapped typeseventTypeId
- type idpublic String getStartTimestampPropertyName()
EventType
getStartTimestampPropertyName
in interface EventType
public String getEndTimestampPropertyName()
EventType
getEndTimestampPropertyName
in interface EventType
public Iterator<EventType> getDeepSuperTypes()
EventType
getDeepSuperTypes
in interface EventType
public String getName()
EventType
A type name is available for application-configured event types and for event types that represent events of a stream populated by insert-into.
No type name is available for anonymous statement-specific event type.
public int getEventTypeId()
EventType
getEventTypeId
in interface EventType
public EventPropertyGetterSPI getGetterSPI(String property)
getGetterSPI
in interface EventTypeSPI
public EventPropertyGetter getGetter(String propertyName)
EventType
Returns null if the property name or property expression is not valid against the event type.
The method takes a property name or property expression as a parameter. Property expressions may include indexed properties via the syntax "name[index]", mapped properties via the syntax "name('key')", nested properties via the syntax "outer.inner" or combinations thereof.
public EventPropertyGetterMappedSPI getGetterMappedSPI(String mappedProperty)
getGetterMappedSPI
in interface EventTypeSPI
public EventPropertyGetterMapped getGetterMapped(String mappedProperty)
EventType
Returns null if the property name is not valid against the event type or the property is not a mapped property.
The method takes a mapped property name (and not a property expression) as a parameter.
getGetterMapped
in interface EventType
mappedProperty
- is the property namepublic EventPropertyGetterIndexed getGetterIndexed(String indexedPropertyName)
EventType
Returns null if the property name is not valid against the event type or the property is not an indexed property.
The method takes a indexed property name (and not a property expression) as a parameter.
getGetterIndexed
in interface EventType
indexedPropertyName
- is the property namepublic EventPropertyGetterIndexedSPI getGetterIndexedSPI(String indexedProperty)
getGetterIndexedSPI
in interface EventTypeSPI
public String[] getPropertyNames()
EventType
Note that properties do not have a defined order. Your application should not rely on the order of properties returned by this method.
The method does not return property names of inner or nested types.
getPropertyNames
in interface EventType
public Class getPropertyType(String property)
EventType
Returns null if the property name or property expression is not valid against the event type. Can also return null if a select-clause selects a constant null value.
The method takes a property name or property expression as a parameter. Property expressions may include indexed properties via the syntax "name[index]", mapped properties via the syntax "name('key')", nested properties via the syntax "outer.inner" or combinations thereof.
Returns unboxed (such as 'int.class') as well as boxed (java.lang.Integer) type.
getPropertyType
in interface EventType
property
- is the property name or property expressionpublic EventBeanReader getReader()
EventTypeSPI
getReader
in interface EventTypeSPI
public EventType[] getSuperTypes()
EventType
For Java bean instances underlying the event this method returns the event types for all superclasses extended by the Java bean and all interfaces implemented by the Java bean.
getSuperTypes
in interface EventType
public Class getUnderlyingType()
EventType
getUnderlyingType
in interface EventType
public EventType getUnderlyingEventType()
public MapEventType getUnderlyingMapType()
public boolean isProperty(String property)
EventType
The method takes a property name or property expression as a parameter. Property expressions may include indexed properties via the syntax "name[index]", mapped properties via the syntax "name('key')", nested properties via the syntax "outer.inner" or combinations thereof.
isProperty
in interface EventType
property
- is the property name or property expression to checkpublic boolean equalsCompareType(EventType otherEventType)
equalsCompareType
in interface EventTypeSPI
public EventTypeMetadata getMetadata()
EventTypeSPI
getMetadata
in interface EventTypeSPI
public EventPropertyDescriptor[] getPropertyDescriptors()
EventType
Note that properties do not have a defined order. Your application should not rely on the order of properties returned by this method.
The method does not return property information of inner or nested types.
getPropertyDescriptors
in interface EventType
public EventPropertyDescriptor getPropertyDescriptor(String propertyName)
EventType
The property name parameter does accept a property expression. It therefore does not allow the indexed, mapped or nested property expression syntax and only returns the descriptor for the event type's known properties.
The method does not return property information of inner or nested types.
For returning a property descriptor for nested, indexed or mapped properties
use EventTypeUtility
.
getPropertyDescriptor
in interface EventType
propertyName
- property namepublic FragmentEventType getFragmentType(String property)
EventType
Returns null if the property name or property expression is not valid or does not return a fragment for the event type.
The EventPropertyDescriptor
provides a flag that indicates which properties
provide fragment events.
This is useful for navigating properties that are itself events or other well-defined types that the underlying event representation may represent as an event type. It is up to each event representation to determine what properties can be represented as event types themselves.
The method takes a property name or property expression as a parameter. Property expressions may include indexed properties via the syntax "name[index]", mapped properties via the syntax "name('key')", nested properties via the syntax "outer.inner" or combinations thereof.
The underlying event representation may not support providing fragments or therefore fragment event types for any or all properties, in which case the method returns null.
Use the EventType.getPropertyDescriptors()
method to obtain a list of properties for which a fragment event type
may be retrieved by this method.
getFragmentType
in interface EventType
property
- is the name of the property to return the fragment event typepublic EventPropertyWriter getWriter(String propertyName)
EventTypeSPI
getWriter
in interface EventTypeSPI
propertyName
- to write topublic EventPropertyDescriptor getWritableProperty(String propertyName)
EventTypeSPI
getWritableProperty
in interface EventTypeSPI
propertyName
- to get descriptor forpublic EventPropertyDescriptor[] getWriteableProperties()
EventTypeSPI
getWriteableProperties
in interface EventTypeSPI
public EventBeanCopyMethod getCopyMethod(String[] properties)
EventTypeSPI
getCopyMethod
in interface EventTypeSPI
properties
- to write after copypublic EventBeanWriter getWriter(String[] properties)
EventTypeSPI
getWriter
in interface EventTypeSPI
properties
- to write