<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns="http://www.springframework.org/schema/integration/gemfire"
			xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:beans="http://www.springframework.org/schema/beans"
			xmlns:tool="http://www.springframework.org/schema/tool"
			xmlns:integration="http://www.springframework.org/schema/integration"
			targetNamespace="http://www.springframework.org/schema/integration/gemfire"
			elementFormDefault="qualified">

	<xsd:import namespace="http://www.springframework.org/schema/beans"
				schemaLocation="https://www.springframework.org/schema/beans/spring-beans.xsd"/>
	<xsd:import namespace="http://www.springframework.org/schema/tool"/>
	<xsd:import namespace="http://www.springframework.org/schema/integration"
				schemaLocation="https://www.springframework.org/schema/integration/spring-integration.xsd"/>
	<xsd:annotation>
		<xsd:documentation><![CDATA[
	Defines the core configuration elements for Spring Integration GemFire Support.
		]]></xsd:documentation>
	</xsd:annotation>

	<xsd:element name="inbound-channel-adapter">
		<xsd:annotation>
			<xsd:documentation>
				Configures a Message Producing Endpoint for the
				'org.springframework.integration.gemfire.inbound.CacheListeningMessageProducer' that backed by a
				GemFire CacheListener
			</xsd:documentation>
		</xsd:annotation>

		<xsd:complexType>
			<xsd:complexContent>
				<xsd:extension base="InboundChannelAdapterType">

					<xsd:attribute name="region" type="xsd:string" use="required">
						<xsd:annotation>
							<xsd:appinfo>
								<tool:annotation kind="ref">
									<tool:expected-type type="com.gemstone.gemfire.cache.Region"/>
								</tool:annotation>
							</xsd:appinfo>
						</xsd:annotation>
					</xsd:attribute>

					<xsd:attribute name="cache-events" type="xsd:string"
								   use="optional" default="CREATED,UPDATED">
						<xsd:annotation>
							<xsd:documentation><![CDATA[
						Enabled cache entry event types
				]]></xsd:documentation>
							<xsd:appinfo>
								<tool:annotation kind="ref">
									<tool:expected-type
											type="org.springframework.integration.gemfire.inbound.EventType"/>
								</tool:annotation>
							</xsd:appinfo>
						</xsd:annotation>
					</xsd:attribute>

				</xsd:extension>
			</xsd:complexContent>
		</xsd:complexType>
	</xsd:element>

	<xsd:element name="cq-inbound-channel-adapter">
		<xsd:annotation>
			<xsd:documentation>
				Configures a 'SourcePollingChannelAdapter' Endpoint for the
				'org.springframework.integration.gemfire.inbound.ContinuousQueryMessageProducer'
				that backed by a
				Spring Gemfire QueryListener
			</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:complexContent>
				<xsd:extension base="InboundChannelAdapterType">
					<xsd:attribute name="cq-listener-container" use="required">
						<xsd:annotation>
							<xsd:documentation><![CDATA[
						Reference to a ContinuousQueryListenerContainer
				]]></xsd:documentation>
							<xsd:appinfo>
								<tool:annotation kind="ref">
									<tool:expected-type
											type="org.springframework.data.gemfire.listener.ContinuousQueryListenerContainer"/>
								</tool:annotation>
							</xsd:appinfo>
						</xsd:annotation>
					</xsd:attribute>
					<xsd:attribute name="query-events" type="xsd:string"
								   use="optional" default="CREATED,UPDATED">
						<xsd:annotation>
							<xsd:documentation><![CDATA[
						Enabled continuous query event types
				]]></xsd:documentation>
							<xsd:appinfo>
								<tool:annotation kind="ref">
									<tool:expected-type
											type="org.springframework.integration.gemfire.inbound.CqEventType"/>
								</tool:annotation>
							</xsd:appinfo>
						</xsd:annotation>
					</xsd:attribute>
					<xsd:attribute name="query" use="required" type="xsd:string">
						<xsd:annotation>
							<xsd:documentation><![CDATA[
						The query string
				]]></xsd:documentation>
						</xsd:annotation>
					</xsd:attribute>
					<xsd:attribute name="query-name" use="optional" type="xsd:string">
						<xsd:annotation>
							<xsd:documentation><![CDATA[
						The query name
				]]></xsd:documentation>
						</xsd:annotation>
					</xsd:attribute>
					<xsd:attribute name="durable" use="optional" default="false">
						<xsd:annotation>
							<xsd:documentation><![CDATA[
							Indicates if the query is a durable subscription
							]]></xsd:documentation>
						</xsd:annotation>
						<xsd:simpleType>
							<xsd:union memberTypes="xsd:string xsd:boolean"/>
						</xsd:simpleType>
					</xsd:attribute>
				</xsd:extension>
			</xsd:complexContent>
		</xsd:complexType>
	</xsd:element>


	<xsd:element name="outbound-channel-adapter">
		<xsd:complexType>
			<xsd:annotation>
				<xsd:documentation>
					Configures a Consumer Endpoint for the
					'org.springframework.integration.gemfire.outbound.CacheWritingMessageHandler' that
					writes Message to a Gemfire cache
				</xsd:documentation>
			</xsd:annotation>
			<xsd:choice minOccurs="0" maxOccurs="3">
				<xsd:element name="cache-entries" type="beans:mapType"
							 minOccurs="0" maxOccurs="1">
					<xsd:annotation>
						<xsd:documentation>
							A map of SpEL expressions used to create cache entries. If not
							provided, payload must be a Map
						</xsd:documentation>
					</xsd:annotation>
				</xsd:element>
				<xsd:element ref="integration:poller" minOccurs="0" maxOccurs="1"/>
				<xsd:element name="request-handler-advice-chain" type="integration:handlerAdviceChainType" minOccurs="0"
							 maxOccurs="1"/>
			</xsd:choice>

			<xsd:attributeGroup ref="integration:channelAdapterAttributes"/>

			<xsd:attribute name="region" type="xsd:string" use="required">
				<xsd:annotation>
					<xsd:appinfo>
						<tool:annotation kind="ref">
							<tool:expected-type type="com.gemstone.gemfire.cache.Region"/>
						</tool:annotation>
					</xsd:appinfo>
				</xsd:annotation>
			</xsd:attribute>

			<xsd:attribute name="order" type="xsd:string" use="optional">
				<xsd:annotation>
					<xsd:documentation><![CDATA[
					Specifies the order for invocation when this endpoint is connected as a
					subscriber to a SubscribableChannel.
				]]></xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>

		</xsd:complexType>
	</xsd:element>

	<xsd:complexType name="InboundChannelAdapterType">
		<xsd:attributeGroup ref="integration:channelAdapterAttributes"/>
		<xsd:attribute name="error-channel" type="xsd:string" use="optional">
			<xsd:annotation>
				<xsd:appinfo>
					<xsd:documentation>
						Identifies the channel to which error messages will be sent if a failure occurs in this
						component's invocation. If no "error-channel" reference is provided, this component will
						propagate Exceptions to the caller. To completely suppress Exceptions, provide a
						reference to the "nullChannel" here.
					</xsd:documentation>
					<tool:annotation kind="ref">
						<tool:expected-type type="org.springframework.messaging.MessageChannel"/>
					</tool:annotation>
				</xsd:appinfo>
			</xsd:annotation>
		</xsd:attribute>

		<xsd:attribute name="expression" type="xsd:string" use="optional">
			<xsd:annotation>
				<xsd:documentation><![CDATA[
					Expression to be evaluated to produce a value for the payload. The root object of the
					expression evaluation is the GemFire 'EntryEvent'.
				]]></xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>

	</xsd:complexType>
</xsd:schema>
