<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.restlet.org/schemas/2.0/Component"
	xmlns:tns="http://www.restlet.org/schemas/2.0/Component"
	elementFormDefault="qualified">

   <!--  
      * Copyright 2005-2014 Restlet.
      * 
      * The contents of this file are subject to the terms of one of the following
      * open source licenses: LGPL 3.0 or LGPL 2.1 or CDDL 1.0 or EPL 1.0 (the
      * "Licenses"). You can select the license that you prefer but you may not use
      * this file except in compliance with one of these Licenses.
      * 
      * You can obtain a copy of the LGPL 3.0 license at
      * http://www.opensource.org/licenses/lgpl-3.0.html
      * 
      * You can obtain a copy of the LGPL 2.1 license at
      * http://www.opensource.org/licenses/lgpl-2.1.php
      * 
      * You can obtain a copy of the CDDL 1.0 license at
      * http://www.opensource.org/licenses/cddl1.php
      * 
      * You can obtain a copy of the EPL 1.0 license at
      * http://www.opensource.org/licenses/eclipse-1.0.php
      * 
      * See the Licenses for the specific language governing permissions and
      * limitations under the Licenses.
      * 
      * Alternatively, you can obtain a royalty free commercial license with less
      * limitations, transferable or non-transferable, directly at
      * http://restlet.com/products/restlet-framework
      * 
      * Restlet is a registered trademark of restlet S.A.S..
   -->

   <!--
      * ===================================================
      * Schema for the configuration of a Restlet Component 
      * ===================================================
   -->

	<element name="component" type="tns:ComponentType" />

	<complexType name="AttachType">
		<sequence>
			<element name="parameter" type="tns:ParameterType" minOccurs="0"
				maxOccurs="unbounded" />
		</sequence>
		<attribute name="uriPattern" type="string" use="optional" />
		<attribute name="targetClass" type="string" use="optional" />
		<attribute name="targetDescriptor" type="string" use="optional" />
		<attribute name="default" type="boolean" use="optional" />
		<attribute name="matchingMode" type="int" use="optional" />
		<attribute name="defaultVariableType" type="int" use="optional" />
	</complexType>

	<complexType name="ClientType">
		<complexContent>
			<extension base="tns:ConnectorType" />
		</complexContent>
	</complexType>

	<complexType name="ComponentType">
		<complexContent>
			<extension base="tns:RestletType">
				<sequence>
					<element name="client" type="tns:ClientType" minOccurs="0"
						maxOccurs="unbounded" />
					<element name="server" type="tns:ServerType" minOccurs="0"
						maxOccurs="unbounded" />
					<element name="parameter" type="tns:ParameterType"
						minOccurs="0" maxOccurs="unbounded" />
					<element name="defaultHost" type="tns:VirtualHostType"
						minOccurs="0" maxOccurs="1" />
					<element name="host" type="tns:VirtualHostType" minOccurs="0"
						maxOccurs="unbounded" />
					<element name="internalRouter" type="tns:RouterType"
						minOccurs="0" maxOccurs="1" />
					<element name="logService" type="tns:LogServiceType"
						minOccurs="0" maxOccurs="1" />
					<element name="statusService" type="tns:StatusServiceType"
						minOccurs="0" maxOccurs="1" />
				</sequence>
			</extension>
		</complexContent>
	</complexType>

	<complexType name="ConnectorType" abstract="true">
		<complexContent>
			<extension base="tns:RestletType">
				<sequence>
					<element name="parameter" type="tns:ParameterType"
						minOccurs="0" maxOccurs="unbounded" />
				</sequence>
				<attribute name="protocol" type="string" use="optional" />
				<attribute name="protocols" type="tns:ProtocolListType"
					use="optional" />
			</extension>
		</complexContent>
	</complexType>

	<complexType name="LogServiceType">
		<attribute name="enabled" type="boolean" use="optional" />
		<attribute name="identityCheck" type="boolean" use="optional" />
		<attribute name="logFormat" type="string" use="optional" />
		<attribute name="loggerName" type="string" use="optional" />
	</complexType>

	<complexType name="ParameterType">
		<attribute name="name" type="string" />
		<attribute name="value" type="string" />
	</complexType>

	<complexType name="RestletType">
		<attribute name="name" type="string" use="optional" />
		<attribute name="description" type="string" use="optional" />
		<attribute name="owner" type="string" use="optional" />
		<attribute name="author" type="string" use="optional" />
	</complexType>

	<complexType name="RouterType">
		<complexContent>
			<extension base="tns:RestletType">
				<sequence>
					<element name="parameter" type="tns:ParameterType"
						minOccurs="0" maxOccurs="unbounded" />
					<element name="attach" type="tns:AttachType" minOccurs="0"
						maxOccurs="unbounded" />
					<element name="attachDefault" type="tns:AttachType"
						minOccurs="0" maxOccurs="1" />
				</sequence>
				<attribute name="defaultMatchingMode" type="int" use="optional"
					default="1" />
				<attribute name="defaultMatchQuery" type="boolean" use="optional" />
				<attribute name="maxAttempts" type="int" use="optional" />
				<attribute name="requiredScore" type="float" use="optional" />
				<attribute name="retryDelay" type="long" use="optional" />
				<attribute name="routingMode" type="int" use="optional" />
			</extension>
		</complexContent>
	</complexType>

	<complexType name="ServerType">
		<complexContent>
			<extension base="tns:ConnectorType">
				<attribute name="address" type="string" use="optional" />
				<attribute name="port" type="int" use="optional" />
			</extension>
		</complexContent>
	</complexType>

	<complexType name="StatusServiceType">
		<attribute name="contactEmail" type="string" use="optional" />
		<attribute name="enabled" type="boolean" use="optional" />
		<attribute name="homeRef" type="string" use="optional" />
		<attribute name="overwrite" type="boolean" use="optional" />
	</complexType>

	<complexType name="VirtualHostType">
		<complexContent>
			<extension base="tns:RouterType">
				<attribute name="hostDomain" type="string" use="optional" />
				<attribute name="hostPort" type="string" use="optional" />
				<attribute name="hostScheme" type="string" use="optional" />
				<attribute name="resourceDomain" type="string" use="optional" />
				<attribute name="resourcePort" type="string" use="optional" />
				<attribute name="resourceScheme" type="string" use="optional" />
				<attribute name="serverAddress" type="string" use="optional" />
				<attribute name="serverPort" type="string" use="optional" />
			</extension>
		</complexContent>
	</complexType>

	<simpleType name="ProtocolListType">
		<list itemType="string" />
	</simpleType>
</schema>
