<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns="http://www.springframework.org/schema/integration/ip"
		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/ip"
		elementFormDefault="qualified"
		attributeFormDefault="unqualified">

	<xsd:import namespace="http://www.springframework.org/schema/beans"/>
	<xsd:import namespace="http://www.springframework.org/schema/tool"/>
	<xsd:import namespace="http://www.springframework.org/schema/integration"
			schemaLocation="http://www.springframework.org/schema/integration/spring-integration-2.0.xsd"/>

	<xsd:annotation>
		<xsd:documentation><![CDATA[
	Defines the configuration elements for Spring Integration's IP adapters.
		]]></xsd:documentation>
	</xsd:annotation>

	<xsd:element name="udp-inbound-channel-adapter">
		<xsd:annotation>
			<xsd:documentation>
	Defines a udp inbound Channel Adapter for receiving incoming udp packets.
			</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:complexContent>
				<xsd:extension base="udpAdapterType">
					<xsd:attribute name="pool-size" type="xsd:string" >
						<xsd:annotation>
							<xsd:documentation>
The number of threads that will be used for socket/channel handling. Only applies
if an external task-executor is NOT being used. When using an external task executor,
its configuration specifies the number of threads.
							</xsd:documentation>
						</xsd:annotation>
					</xsd:attribute>
					<xsd:attribute name="receive-buffer-size" type="xsd:string" />
					<xsd:attribute name="multicast-address" type="xsd:string" />
					<xsd:attribute name="task-executor" type="xsd:string">
						<xsd:annotation>
							<xsd:documentation>
	Specifies a specific Executor to be used for socket handling. If not supplied, an internal
	pooled executor will be used (See pool-size). Needed on some platforms that require the use of specific
	task executors such as a WorkManagerTaskExecutor.
							</xsd:documentation>
						</xsd:annotation>
					</xsd:attribute>
					<xsd:attribute name="error-channel" type="xsd:string">
						<xsd:annotation>
							<xsd:appinfo>
								<tool:annotation kind="ref">
									<tool:expected-type type="org.springframework.integration.MessageChannel"/>
								</tool:annotation>
							</xsd:appinfo>
							<xsd:documentation>
								If a (synchronous) downstream exception is thrown and an "error-channel" is specified,
								the MessagingException will be sent to this channel. Otherwise, any such exception
								will simply be logged by the channel adapter.
							</xsd:documentation>
						</xsd:annotation>
					</xsd:attribute>
					<xsd:attribute name="lookup-host" type="xsd:string" >
						<xsd:annotation>
							<xsd:documentation>
Whether or not to do a DNS reverse-lookup on the remote ip address to insert the host name into the 
message headers (ip_hostName). Default "true".
							</xsd:documentation>
						</xsd:annotation>
			</xsd:attribute>
				</xsd:extension>
			</xsd:complexContent>
		</xsd:complexType>
	</xsd:element>

	<xsd:element name="udp-outbound-channel-adapter">
		<xsd:annotation>
			<xsd:documentation>
	Defines an outbound UDP packet-sending Channel Adapter.
			</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:complexContent>
				<xsd:extension base="udpAdapterType">
					<xsd:attribute name="host" type="xsd:string" />
					<xsd:attribute name="acknowledge" type="xsd:string" />
					<xsd:attribute name="ack-host" type="xsd:string" />
					<xsd:attribute name="ack-port" type="xsd:string" />
					<xsd:attribute name="ack-timeout" type="xsd:string" />
					<xsd:attribute name="min-acks-for-success" type="xsd:string" />
					<xsd:attribute name="time-to-live" type="xsd:string" />
					<xsd:attribute name="task-executor" type="xsd:string">
						<xsd:annotation>
							<xsd:documentation>
Specifies a specific Executor to be used for handling acknowledgments in the UDP adapter. If not supplied, an internal
pooled executor will be used. Needed on some platforms that require the use of specific
task executors such as a WorkManagerTaskExecutor.
							</xsd:documentation>
						</xsd:annotation>
					</xsd:attribute>
					<xsd:attribute name="order">
						<xsd:annotation>
							<xsd:documentation>
								Specifies the order for invocation when this endpoint is connected as a
								subscriber to a SubscribableChannel.
							</xsd:documentation>
						</xsd:annotation>
					</xsd:attribute>
				</xsd:extension>
			</xsd:complexContent>
		</xsd:complexType>
	</xsd:element>

	<xsd:element name="tcp-inbound-channel-adapter">
		<xsd:complexType>
			<xsd:attribute name="id" type="xsd:ID"/>		
			<xsd:attribute name="connection-factory" type="xsd:string">
				<xsd:annotation>
					<xsd:appinfo>
						<tool:annotation kind="ref">
							<tool:expected-type type="org.springframework.integration.ip.tcp.connection.ConnectionFactory"/>
						</tool:annotation>
					</xsd:appinfo>
					<xsd:documentation>
A connection factory is needed by an inbound adapter. If the connection factory has a type 'server',
the factory is 'owned' by this adapter. If it has a type 'client', it is owned by an outbound channel
adapter and this adapter will receive any incoming messages on the connection created by the outbound
adapter. 						 
					</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="channel" type="xsd:string">
				<xsd:annotation>
					<xsd:appinfo>
						<tool:annotation kind="ref">
							<tool:expected-type type="org.springframework.integration.MessageChannel"/>
						</tool:annotation>
					</xsd:appinfo>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="error-channel" type="xsd:string">
				<xsd:annotation>
					<xsd:appinfo>
						<tool:annotation kind="ref">
							<tool:expected-type type="org.springframework.integration.MessageChannel"/>
						</tool:annotation>
					</xsd:appinfo>
					<xsd:documentation>
						If a (synchronous) downstream exception is thrown and an "error-channel" is specified,
						the MessagingException will be sent to this channel. Otherwise, any such exception
						will simply be logged by the channel adapter.
					</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
		</xsd:complexType>
	</xsd:element>

	<xsd:element name="tcp-outbound-channel-adapter">
		<xsd:complexType>
			<xsd:attribute name="id" type="xsd:ID"/>		
			<xsd:attribute name="connection-factory" type="xsd:string">
				<xsd:annotation>
					<xsd:appinfo>
						<tool:annotation kind="ref">
							<tool:expected-type type="org.springframework.integration.ip.tcp.connection.ConnectionFactory"/>
						</tool:annotation>
					</xsd:appinfo>
					<xsd:documentation>
A connection factory is needed by an outbound adapter. If the connection factory has a type 'client',
the factory is 'owned' by this adapter. If it has a type 'server', it is owned by an inbound channel
adapter and this adapter will attempt to correlate messages to the connection on which an original
inbound message was received. 						 
					</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="channel" type="xsd:string">
				<xsd:annotation>
					<xsd:appinfo>
						<tool:annotation kind="ref">
							<tool:expected-type type="org.springframework.integration.MessageChannel"/>
						</tool:annotation>
					</xsd:appinfo>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="order">
				<xsd:annotation>
					<xsd:documentation>
						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:element name="tcp-inbound-gateway">
		<xsd:complexType>
			<xsd:attribute name="id" type="xsd:ID"/>		
			<xsd:attribute name="connection-factory" type="xsd:string">
				<xsd:annotation>
					<xsd:appinfo>
						<tool:annotation kind="ref">
							<tool:expected-type type="org.springframework.integration.ip.tcp.connection.AbstractServerConnectionFactory"/>
						</tool:annotation>
					</xsd:appinfo>
					<xsd:documentation>
A connection factory is needed by an inbound adapter. The connection factory must be of type 'server'.
					</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="request-channel" type="xsd:string" use="required">
				<xsd:annotation>
					<xsd:appinfo>
						<tool:annotation kind="ref">
							<tool:expected-type type="org.springframework.integration.MessageChannel"/>
						</tool:annotation>
					</xsd:appinfo>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="reply-channel" type="xsd:string">
				<xsd:annotation>
					<xsd:appinfo>
						<tool:annotation kind="ref">
							<tool:expected-type type="org.springframework.integration.MessageChannel"/>
						</tool:annotation>
					</xsd:appinfo>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="reply-timeout" type="xsd:string"/>
			<xsd:attribute name="error-channel" type="xsd:string">
				<xsd:annotation>
					<xsd:appinfo>
						<tool:annotation kind="ref">
							<tool:expected-type type="org.springframework.integration.MessageChannel"/>
						</tool:annotation>
					</xsd:appinfo>
					<xsd:documentation>
						If a (synchronous) downstream exception is thrown and an "error-channel" is specified,
						the MessagingException will be sent to this channel and the ultimate response
						of the error flow will be returned as a response by the gateway. If no  
						"error-channel" is specified, any such exception
						will simply be logged by the gateway. In such a situation, no response is sent
						to the client. 
					</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
		</xsd:complexType>
	</xsd:element>

	<xsd:element name="tcp-outbound-gateway">
		<xsd:complexType>
			<xsd:attribute name="id" type="xsd:ID"/>		
			<xsd:attribute name="connection-factory" type="xsd:string">
				<xsd:annotation>
					<xsd:appinfo>
						<tool:annotation kind="ref">
							<tool:expected-type type="org.springframework.integration.ip.tcp.connection.ConnectionFactory"/>
						</tool:annotation>
					</xsd:appinfo>
					<xsd:documentation>
A connection factory is needed by an outbound adapter. The connection factory must be of 'client'.
					</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="request-channel" type="xsd:string" use="required">
				<xsd:annotation>
					<xsd:appinfo>
						<tool:annotation kind="ref">
							<tool:expected-type type="org.springframework.integration.MessageChannel"/>
						</tool:annotation>
					</xsd:appinfo>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="reply-channel" type="xsd:string">
				<xsd:annotation>
					<xsd:appinfo>
						<tool:annotation kind="ref">
							<tool:expected-type type="org.springframework.integration.MessageChannel"/>
						</tool:annotation>
					</xsd:appinfo>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="request-timeout" type="xsd:string"/>
			<xsd:attribute name="reply-timeout" type="xsd:string"/>
			<xsd:attribute name="order">
				<xsd:annotation>
					<xsd:documentation>
						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:element name="tcp-connection-factory">
		<xsd:complexType>
			<xsd:attribute name="id" type="xsd:ID"/>
			<xsd:attribute name="type">
				<xsd:annotation>
					<xsd:documentation>
Connection factories can be 'client' or 'server'. Client factories
open a connection to a server using a host and port. Server factories
listen on a port and create a separate connection for each incoming
connection request.
					</xsd:documentation>
				</xsd:annotation>
				<xsd:simpleType>
					<xsd:restriction base="xsd:NMTOKEN">
						<xsd:enumeration value="client" />
						<xsd:enumeration value="server" />
					</xsd:restriction>
				</xsd:simpleType>
			</xsd:attribute>
			<xsd:attribute name="host" type="xsd:string">
				<xsd:annotation>
					<xsd:documentation>
The host to which a client connection factory will connect.					
					</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="port" type="xsd:string">
				<xsd:annotation>
					<xsd:documentation>
For client factories, the port to which a client connection factory will connect.
For server factories, the port on which the factory will listen for incoming
connections. 					
					</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="using-nio" type="xsd:string" default="false">
				<xsd:annotation>
					<xsd:documentation>
If true, the factory will use java.nio.channel.SocketChannel for communication; 
for a large number of connections on the server side, this can provide better
performance and may use fewer threads.
					</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="so-keep-alive" type="xsd:string" />
			<xsd:attribute name="so-linger" type="xsd:string" />
			<xsd:attribute name="so-receive-buffer-size" type="xsd:string" />
			<xsd:attribute name="so-send-buffer-size" type="xsd:string" />
			<xsd:attribute name="so-tcp-no-delay" type="xsd:string" />
			<xsd:attribute name="so-timeout" type="xsd:string" />
			<xsd:attribute name="so-traffic-class" type="xsd:string" />
			<xsd:attribute name="using-direct-buffers" type="xsd:string">
				<xsd:annotation>
					<xsd:documentation>
If true, instructs the factory to use direct buffers if possible; only applies if
using-nio is true. Refer to ByteBuffer javadocs for more information.		
					</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>			
			<xsd:attribute name="single-use" type="xsd:string">
				<xsd:annotation>
					<xsd:documentation>
If true, a new connection will be created for each use. For inbound adapters
where there is no outbound adapter sharing the factory, the connection will
be closed after a message is received. For outbound adapters where there is
no inbound adapter sharing the factory, or for inbound adapters where an
outbound adapter shares the factory, the connection will be closed after
so-timeout milliseconds. For outbound adapters where an inbound adapter shares
the factory, the connection will be closed after a response is received. 					
					</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="serializer" type="xsd:string" >
				<xsd:annotation>
					<xsd:appinfo>
						<tool:annotation kind="ref">
							<tool:expected-type type="org.springframework.core.serializer.Serializer"/>
						</tool:annotation>
					</xsd:appinfo>
					<xsd:documentation>
A Serializer that converts message payloads to/from output streams/input streams
associated with the connection. Default is ByteArrayCrLfSerializer. Serializer and Deserializer
would normally be the same but this is not required.									
					</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="deserializer" type="xsd:string" >
				<xsd:annotation>
					<xsd:appinfo>
						<tool:annotation kind="ref">
							<tool:expected-type type="org.springframework.core.serializer.Deserializer"/>
						</tool:annotation>
					</xsd:appinfo>
					<xsd:documentation>
A Deserializer that converts message payloads to/from output streams/input streams
associated with the connection. Default is ByteArrayCrLfSerializer. Serializer and Deserializer
would normally be the same but this is not required.					
					</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="local-address" type="xsd:string">
				<xsd:annotation>
					<xsd:documentation>
On a multi-homed system, specifies the ip address of the network interface used to communicate.
For inbound adapters and gateways, specifies the interface used to listen for incoming connections.
If omitted, the endpoint will listen on all available adapters. For the UDP multicast outbound adapter
specifies the interface to which multicast packets will be sent. For UDP unicast and multicast
adapters, specifies which interface to which the acknowledgment socket will be bound. Does not
apply to TCP outbound adapters and gateways.
					</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="task-executor" type="xsd:string" />
			<xsd:attribute name="pool-size" type="xsd:string" >
				<xsd:annotation>
					<xsd:documentation>
The number of threads that will be used for socket/channel handling. Only applies
if an external task-executor is NOT being used. When using an external task executor,
its configuration specifies the number of threads.
					</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="lookup-host" type="xsd:string" >
				<xsd:annotation>
					<xsd:documentation>
Whether or not to do a DNS reverse-lookup on the remote ip address to insert the host name into the 
message headers (ip_connectionId, ip_hostName). Default "true".
					</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="interceptor-factory-chain" type="xsd:string">
				<xsd:annotation>
					<xsd:appinfo>
						<tool:annotation kind="ref">
							<tool:expected-type type="org.springframework.integration.ip.tcp.connection.TcpConnectionInterceptorFactoryChain"/>
						</tool:annotation>
					</xsd:appinfo>
				</xsd:annotation>
			</xsd:attribute>
		</xsd:complexType>
	</xsd:element>

	<xsd:complexType name="udpAdapterType">
		<xsd:annotation>
			<xsd:documentation>
	Common configuration for UDP-based adapters.
			</xsd:documentation>
		</xsd:annotation>
		<xsd:complexContent>
			<xsd:extension base="common-attributes">
				<xsd:attribute name="channel" type="xsd:string">
					<xsd:annotation>
						<xsd:appinfo>
							<tool:annotation kind="ref">
								<tool:expected-type type="org.springframework.integration.MessageChannel"/>
							</tool:annotation>
						</xsd:appinfo>
					</xsd:annotation>
				</xsd:attribute>
				<xsd:attribute name="check-length" type="xsd:string" />
				<xsd:attribute name="multicast" type="xsd:string" />
			</xsd:extension>
		</xsd:complexContent>
	</xsd:complexType>

	<xsd:complexType name="common-attributes">
		<xsd:attribute name="id" type="xsd:ID"/>
		<xsd:attribute name="port" type="xsd:string" />
		<xsd:attribute name="so-receive-buffer-size" type="xsd:string" />
		<xsd:attribute name="so-send-buffer-size" type="xsd:string" />
		<xsd:attribute name="so-timeout" type="xsd:string" />
		<xsd:attribute name="local-address" type="xsd:string">
			<xsd:annotation>
				<xsd:documentation>
On a multi-homed system, specifies the ip address of the network interface used to communicate.
For inbound adapters and gateways, specifies the interface used to listen for incoming connections.
If omitted, the endpoint will listen on all available adapters. For the UDP multicast outbound adapter
specifies the interface to which multicast packets will be sent. For UDP unicast and multicast
adapters, specifies which interface to which the acknowledgment socket will be bound. Does not
apply to TCP outbound adapters and gateways.
				</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
	</xsd:complexType>

</xsd:schema>
