public class ConfigurationEventTypeXMLDOM extends Object implements MetaDefItem, Serializable
Use this class to configure the engine for processing of XML DOM objects that represent events and contain all the data for event properties used by statements.
Minimally required is the root element name which allows the engine to map the document to the event type that has been named in an EPL or pattern statement.
Event properties that are results of XPath expressions can be made known to the engine via this class. For XPath expressions that must refer to namespace prefixes those prefixes and their namespace name must be supplied to the engine. A default namespace can be supplied as well.
By supplying a schema resource the engine can interrogate the schema, allowing the engine to verify event properties and return event properties in the type defined by the schema. When a schema resource is supplied, the optional root element namespace defines the namespace in case the root element name occurs in multiple namespaces.
Modifier and Type | Class and Description |
---|---|
static class |
ConfigurationEventTypeXMLDOM.XPathPropertyDesc
Descriptor class for event properties that are resolved via XPath-expression.
|
Constructor and Description |
---|
ConfigurationEventTypeXMLDOM()
Ctor.
|
Modifier and Type | Method and Description |
---|---|
void |
addNamespacePrefix(String prefix,
String namespace)
Add a prefix and namespace name for use in XPath expressions refering to that prefix.
|
void |
addNamespacePrefixes(Map<String,String> prefixNamespaceMap)
Add prefixes and namespace names for use in XPath expressions refering to that prefix.
|
void |
addXPathProperty(String name,
String xpath,
QName type)
Adds an event property for which the engine uses the supplied XPath expression against
a DOM document node to resolve a property value.
|
void |
addXPathProperty(String name,
String xpath,
QName type,
String castToType)
Adds an event property for which the engine uses the supplied XPath expression against
a DOM document node to resolve a property value.
|
void |
addXPathPropertyFragment(String name,
String xpath,
QName type,
String eventTypeName)
Adds an event property for which the engine uses the supplied XPath expression against
a DOM document node to resolve a property value.
|
boolean |
equals(Object otherObj) |
String |
getDefaultNamespace()
Returns the default namespace.
|
String |
getEndTimestampPropertyName()
Returns the property name of the property providing the end timestamp value.
|
Map<String,String> |
getNamespacePrefixes()
Returns the namespace prefixes in a map of prefix as key and namespace name as value.
|
String |
getRootElementName()
Returns the root element name.
|
String |
getRootElementNamespace()
Returns the root element namespace.
|
String |
getSchemaResource()
Returns the schema resource.
|
String |
getSchemaText()
Returns the schema text, if provided instead of a schema resource, this call returns the actual text of the schema document.
|
String |
getStartTimestampPropertyName()
Returns the property name of the property providing the start timestamp value.
|
String |
getXPathFunctionResolver()
Returns the class name of the XPath function resolver to be assigned to the XPath factory instance
upon type initialization.
|
Map<String,ConfigurationEventTypeXMLDOM.XPathPropertyDesc> |
getXPathProperties()
Returns a map of property name and descriptor for XPath-expression properties.
|
String |
getXPathVariableResolver()
Returns the class name of the XPath variable resolver to be assigned to the XPath factory instance
upon type initialization.
|
int |
hashCode() |
boolean |
isAutoFragment()
Set to true (the default) to look up or create event types representing fragments of an XML document
automatically upon request for fragment event type information; Or false when only explicit
properties may return fragments.
|
boolean |
isEventSenderValidatesRoot()
Returns true to indicate that an
EventSender returned for this event type validates
the root document element name against the one configured (the default), or false to not validate the root document
element name as configured. |
boolean |
isUpdateStoredType()
Indicator for use with EsperHA, false by default to indicate that stored type information takes
precedence over configuration type information provided at engine initialization time.
|
boolean |
isXPathPropertyExpr()
Returns false to indicate that property expressions are evaluated by the DOM-walker
implementation (the default), or true to indicate that property expressions are rewritten into XPath expressions.
|
boolean |
isXPathResolvePropertiesAbsolute()
Indicates whether properties are compiled into absolute or deep XPath expressions (see setter method for more detail).
|
void |
setAutoFragment(boolean autoFragment)
Set to true (the default) to look up or create event types representing fragments of an XML document
automatically upon request for fragment event type information; Or false when only explicit
properties may return fragments.
|
void |
setDefaultNamespace(String defaultNamespace)
Sets the default namespace.
|
void |
setEndTimestampPropertyName(String endTimestampPropertyName)
Sets the property name of the property providing the end timestamp value.
|
void |
setEventSenderValidatesRoot(boolean eventSenderValidatesRoot)
Set to true to indicate that an
EventSender returned for this event type validates
the root document element name against the one configured (the default), or false to not validate the root document
element name as configured. |
void |
setRootElementName(String rootElementName)
Sets the root element name.
|
void |
setRootElementNamespace(String rootElementNamespace)
Sets the root element namespace.
|
void |
setSchemaResource(String schemaResource)
Sets the schema resource.
|
void |
setSchemaText(String schemaText)
Sets the schema text, for use when the schema resource is impractical and when providing the actual text
of the schema instead.
|
void |
setStartTimestampPropertyName(String startTimestampPropertyName)
Sets the property name of the property providing the start timestamp value.
|
void |
setUpdateStoredType(boolean updateStoredType)
Indicator for use with EsperHA, false by default to indicate that stored type information takes
precedence over configuration type information provided at engine initialization time.
|
void |
setXPathFunctionResolver(String xPathFunctionResolver)
Sets the class name of the XPath function resolver to be assigned to the XPath factory instance
upon type initialization.
|
void |
setXPathPropertyExpr(boolean xPathPropertyExpr)
Set to false to indicate that property expressions are evaluated by the DOM-walker
implementation (the default), or set to true to indicate that property expressions are rewritten into XPath expressions.
|
void |
setXPathResolvePropertiesAbsolute(boolean xPathResolvePropertiesAbsolute)
When set to true (the default), indicates that when properties are compiled to XPath expressions that the
compilation should generate an absolute XPath expression such as "/getQuote/request" for the
simple request property, or "/getQuote/request/symbol" for a "request.symbol" nested property,
wherein the root element node is "getQuote".
|
void |
setXPathVariableResolver(String xPathVariableResolver)
Sets the class name of the XPath variable resolver to be assigned to the XPath factory instance
upon type initialization.
|
public String getRootElementName()
public void setRootElementName(String rootElementName)
rootElementName
- is the name of the root elementpublic String getRootElementNamespace()
public void setRootElementNamespace(String rootElementNamespace)
rootElementNamespace
- is the namespace for the root elementpublic String getDefaultNamespace()
public void setDefaultNamespace(String defaultNamespace)
defaultNamespace
- is the default namespacepublic String getSchemaResource()
public void setSchemaResource(String schemaResource)
schemaResource
- is the schema resourcepublic String getSchemaText()
Set a schema text first. This call will not resolve the schema resource to a text.
public void setSchemaText(String schemaText)
schemaText
- schema text is the actual content of an XSD schema file as a string,
provide instead of a schema resource namepublic Map<String,ConfigurationEventTypeXMLDOM.XPathPropertyDesc> getXPathProperties()
public boolean isXPathPropertyExpr()
public void setXPathPropertyExpr(boolean xPathPropertyExpr)
xPathPropertyExpr
- indicator how property expressions are evaluatedpublic boolean isEventSenderValidatesRoot()
EventSender
returned for this event type validates
the root document element name against the one configured (the default), or false to not validate the root document
element name as configured.public void setEventSenderValidatesRoot(boolean eventSenderValidatesRoot)
EventSender
returned for this event type validates
the root document element name against the one configured (the default), or false to not validate the root document
element name as configured.eventSenderValidatesRoot
- true for validation of root document element name by event sender, false for no validationpublic boolean isAutoFragment()
public void setAutoFragment(boolean autoFragment)
autoFragment
- indicator whether to allow splitting-up (fragmenting) properties (nodes) in an documentpublic void addXPathProperty(String name, String xpath, QName type)
name
- of the event propertyxpath
- is an arbitrary xpath expressiontype
- is a constant obtained from javax.xml.xpath.XPathConstants. Typical values are
XPathConstants.NUMBER, STRING and BOOLEAN.public void addXPathProperty(String name, String xpath, QName type, String castToType)
name
- of the event propertyxpath
- is an arbitrary xpath expressiontype
- is a constant obtained from javax.xml.xpath.XPathConstants. Typical values are
XPathConstants.NUMBER, STRING and BOOLEAN.castToType
- is the type name of the type that the return value of the xpath expression is casted topublic void addXPathPropertyFragment(String name, String xpath, QName type, String eventTypeName)
name
- of the event propertyxpath
- is an arbitrary xpath expressiontype
- is a constant obtained from javax.xml.xpath.XPathConstants. Typical values are
XPathConstants.NODE and XPathConstants.NODESET.eventTypeName
- is the name of another event type that represents the XPath nodespublic Map<String,String> getNamespacePrefixes()
public void addNamespacePrefix(String prefix, String namespace)
prefix
- is the prefix of the namespacenamespace
- is the namespace namepublic void addNamespacePrefixes(Map<String,String> prefixNamespaceMap)
prefixNamespaceMap
- map of prefixes and namespacespublic boolean isXPathResolvePropertiesAbsolute()
public void setXPathResolvePropertiesAbsolute(boolean xPathResolvePropertiesAbsolute)
When set to false, indicates that when properties are compiled to XPath expressions that the compilation should generate a deep XPath expression such as "//symbol" for the simple symbol property, or "//request/symbol" for a "request.symbol" nested property.
xPathResolvePropertiesAbsolute
- true for absolute XPath for properties (default), false for deep XPathpublic String getXPathFunctionResolver()
public void setXPathFunctionResolver(String xPathFunctionResolver)
xPathFunctionResolver
- class name of xpath function resolver, or null if none setpublic String getXPathVariableResolver()
public void setXPathVariableResolver(String xPathVariableResolver)
xPathVariableResolver
- class name of xpath function resolver, or null if none setpublic boolean isUpdateStoredType()
public void setUpdateStoredType(boolean updateStoredType)
When setting this flag to true care should be taken about the compatibility of the supplied XML type
configuration information and the existing EPL statements and stored events, if any. For more information
please consult ConfigurationOperations.replaceXMLEventType(String, ConfigurationEventTypeXMLDOM)
.
updateStoredType
- set to false (the default) to indicate that stored type information takes precedence over configuration type informationpublic String getStartTimestampPropertyName()
public void setStartTimestampPropertyName(String startTimestampPropertyName)
startTimestampPropertyName
- start timestamp property namepublic String getEndTimestampPropertyName()
public void setEndTimestampPropertyName(String endTimestampPropertyName)
endTimestampPropertyName
- start timestamp property name