com.espertech.esper.client
Class ConfigurationEventTypeXMLDOM

java.lang.Object
  extended by com.espertech.esper.client.ConfigurationEventTypeXMLDOM
All Implemented Interfaces:
MetaDefItem, java.io.Serializable

public class ConfigurationEventTypeXMLDOM
extends java.lang.Object
implements MetaDefItem, java.io.Serializable

Configuration object for enabling the engine to process events represented as XML DOM document nodes.

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.

See Also:
Serialized Form

Nested Class Summary
static class ConfigurationEventTypeXMLDOM.XPathPropertyDesc
          Descriptor class for event properties that are resolved via XPath-expression.
 
Constructor Summary
ConfigurationEventTypeXMLDOM()
          Ctor.
 
Method Summary
 void addNamespacePrefix(java.lang.String prefix, java.lang.String namespace)
          Add a prefix and namespace name for use in XPath expressions refering to that prefix.
 void addNamespacePrefixes(java.util.Map<java.lang.String,java.lang.String> prefixNamespaceMap)
          Add prefixes and namespace names for use in XPath expressions refering to that prefix.
 void addXPathProperty(java.lang.String name, java.lang.String xpath, javax.xml.namespace.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(java.lang.String name, java.lang.String xpath, javax.xml.namespace.QName type, java.lang.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(java.lang.String name, java.lang.String xpath, javax.xml.namespace.QName type, java.lang.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(java.lang.Object otherObj)
           
 java.lang.String getDefaultNamespace()
          Returns the default namespace.
 java.lang.String getEndTimestampPropertyName()
          Returns the property name of the property providing the end timestamp value.
 java.util.Map<java.lang.String,java.lang.String> getNamespacePrefixes()
          Returns the namespace prefixes in a map of prefix as key and namespace name as value.
 java.lang.String getRootElementName()
          Returns the root element name.
 java.lang.String getRootElementNamespace()
          Returns the root element namespace.
 java.lang.String getSchemaResource()
          Returns the schema resource.
 java.lang.String getSchemaText()
          Returns the schema text, if provided instead of a schema resource, this call returns the actual text of the schema document.
 java.lang.String getStartTimestampPropertyName()
          Returns the property name of the property providing the start timestamp value.
 java.lang.String getXPathFunctionResolver()
          Returns the class name of the XPath function resolver to be assigned to the XPath factory instance upon type initialization.
 java.util.Map<java.lang.String,ConfigurationEventTypeXMLDOM.XPathPropertyDesc> getXPathProperties()
          Returns a map of property name and descriptor for XPath-expression properties.
 java.lang.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(java.lang.String defaultNamespace)
          Sets the default namespace.
 void setEndTimestampPropertyName(java.lang.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(java.lang.String rootElementName)
          Sets the root element name.
 void setRootElementNamespace(java.lang.String rootElementNamespace)
          Sets the root element namespace.
 void setSchemaResource(java.lang.String schemaResource)
          Sets the schema resource.
 void setSchemaText(java.lang.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(java.lang.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(java.lang.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(java.lang.String xPathVariableResolver)
          Sets the class name of the XPath variable resolver to be assigned to the XPath factory instance upon type initialization.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigurationEventTypeXMLDOM

public ConfigurationEventTypeXMLDOM()
Ctor.

Method Detail

getRootElementName

public java.lang.String getRootElementName()
Returns the root element name.

Returns:
root element name

setRootElementName

public void setRootElementName(java.lang.String rootElementName)
Sets the root element name.

Parameters:
rootElementName - is the name of the root element

getRootElementNamespace

public java.lang.String getRootElementNamespace()
Returns the root element namespace.

Returns:
root element namespace

setRootElementNamespace

public void setRootElementNamespace(java.lang.String rootElementNamespace)
Sets the root element namespace.

Parameters:
rootElementNamespace - is the namespace for the root element

getDefaultNamespace

public java.lang.String getDefaultNamespace()
Returns the default namespace.

Returns:
default namespace

setDefaultNamespace

public void setDefaultNamespace(java.lang.String defaultNamespace)
Sets the default namespace.

Parameters:
defaultNamespace - is the default namespace

getSchemaResource

public java.lang.String getSchemaResource()
Returns the schema resource.

Returns:
schema resource

setSchemaResource

public void setSchemaResource(java.lang.String schemaResource)
Sets the schema resource.

Parameters:
schemaResource - is the schema resource

getSchemaText

public java.lang.String getSchemaText()
Returns the schema text, if provided instead of a schema resource, this call returns the actual text of the schema document.

Set a schema text first. This call will not resolve the schema resource to a text.

Returns:
schema text, if provided, or null value

setSchemaText

public void setSchemaText(java.lang.String schemaText)
Sets the schema text, for use when the schema resource is impractical and when providing the actual text of the schema instead.

Parameters:
schemaText - schema text is the actual content of an XSD schema file as a string, provide instead of a schema resource name

getXPathProperties

public java.util.Map<java.lang.String,ConfigurationEventTypeXMLDOM.XPathPropertyDesc> getXPathProperties()
Returns a map of property name and descriptor for XPath-expression properties.

Returns:
XPath property information

isXPathPropertyExpr

public 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.

Returns:
indicator how property expressions are evaluated

setXPathPropertyExpr

public 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.

Parameters:
xPathPropertyExpr - indicator how property expressions are evaluated

isEventSenderValidatesRoot

public 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.

Returns:
true for validation of root document element name by event sender, false for no validation

setEventSenderValidatesRoot

public 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.

Parameters:
eventSenderValidatesRoot - true for validation of root document element name by event sender, false for no validation

isAutoFragment

public 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.

Returns:
indicator whether to allow splitting-up (fragmenting) properties (nodes) in an document

setAutoFragment

public 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.

Parameters:
autoFragment - indicator whether to allow splitting-up (fragmenting) properties (nodes) in an document

addXPathProperty

public void addXPathProperty(java.lang.String name,
                             java.lang.String xpath,
                             javax.xml.namespace.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.

Parameters:
name - of the event property
xpath - is an arbitrary xpath expression
type - is a constant obtained from javax.xml.xpath.XPathConstants. Typical values are XPathConstants.NUMBER, STRING and BOOLEAN.

addXPathProperty

public void addXPathProperty(java.lang.String name,
                             java.lang.String xpath,
                             javax.xml.namespace.QName type,
                             java.lang.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.

Parameters:
name - of the event property
xpath - is an arbitrary xpath expression
type - 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 to

addXPathPropertyFragment

public void addXPathPropertyFragment(java.lang.String name,
                                     java.lang.String xpath,
                                     javax.xml.namespace.QName type,
                                     java.lang.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.

Parameters:
name - of the event property
xpath - is an arbitrary xpath expression
type - 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 nodes

getNamespacePrefixes

public java.util.Map<java.lang.String,java.lang.String> getNamespacePrefixes()
Returns the namespace prefixes in a map of prefix as key and namespace name as value.

Returns:
namespace prefixes

addNamespacePrefix

public void addNamespacePrefix(java.lang.String prefix,
                               java.lang.String namespace)
Add a prefix and namespace name for use in XPath expressions refering to that prefix.

Parameters:
prefix - is the prefix of the namespace
namespace - is the namespace name

addNamespacePrefixes

public void addNamespacePrefixes(java.util.Map<java.lang.String,java.lang.String> prefixNamespaceMap)
Add prefixes and namespace names for use in XPath expressions refering to that prefix.

Parameters:
prefixNamespaceMap - map of prefixes and namespaces

isXPathResolvePropertiesAbsolute

public boolean isXPathResolvePropertiesAbsolute()
Indicates whether properties are compiled into absolute or deep XPath expressions (see setter method for more detail).

Returns:
true for absolute properties, false for deep properties

setXPathResolvePropertiesAbsolute

public 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".

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.

Parameters:
XPathResolvePropertiesAbsolute - true for absolute XPath for properties (default), false for deep XPath

getXPathFunctionResolver

public java.lang.String getXPathFunctionResolver()
Returns the class name of the XPath function resolver to be assigned to the XPath factory instance upon type initialization.

Returns:
class name of xpath function resolver, or null if none set

setXPathFunctionResolver

public void setXPathFunctionResolver(java.lang.String xPathFunctionResolver)
Sets the class name of the XPath function resolver to be assigned to the XPath factory instance upon type initialization.

Parameters:
xPathFunctionResolver - class name of xpath function resolver, or null if none set

getXPathVariableResolver

public java.lang.String getXPathVariableResolver()
Returns the class name of the XPath variable resolver to be assigned to the XPath factory instance upon type initialization.

Returns:
class name of xpath function resolver, or null if none set

setXPathVariableResolver

public void setXPathVariableResolver(java.lang.String xPathVariableResolver)
Sets the class name of the XPath variable resolver to be assigned to the XPath factory instance upon type initialization.

Parameters:
xPathVariableResolver - class name of xpath function resolver, or null if none set

isUpdateStoredType

public 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. Set to true to indicate that configuration type information takes precedence over stored type information.

Returns:
indicator is false (the default) to indicate that stored type information takes precedence over configuration type information

setUpdateStoredType

public 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. Set to true to indicate that configuration type information takes precedence over stored type information.

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).

Parameters:
updateStoredType - set to false (the default) to indicate that stored type information takes precedence over configuration type information

getStartTimestampPropertyName

public java.lang.String getStartTimestampPropertyName()
Returns the property name of the property providing the start timestamp value.

Returns:
start timestamp property name

setStartTimestampPropertyName

public void setStartTimestampPropertyName(java.lang.String startTimestampPropertyName)
Sets the property name of the property providing the start timestamp value.

Parameters:
startTimestampPropertyName - start timestamp property name

getEndTimestampPropertyName

public java.lang.String getEndTimestampPropertyName()
Returns the property name of the property providing the end timestamp value.

Returns:
end timestamp property name

setEndTimestampPropertyName

public void setEndTimestampPropertyName(java.lang.String endTimestampPropertyName)
Sets the property name of the property providing the end timestamp value.

Parameters:
endTimestampPropertyName - start timestamp property name

equals

public boolean equals(java.lang.Object otherObj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

© 2006-2015 EsperTech Inc.
All rights reserved.
Visit us at espertech.com