﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="SimpleXmppConfiguration"
		   targetNamespace="http://waher.se/Schema/SimpleXmppConfiguration.xsd"
		   elementFormDefault="qualified"
		   xmlns="http://waher.se/Schema/SimpleXmppConfiguration.xsd"
		   xmlns:mstns="http://waher.se/Schema/SimpleXmppConfiguration.xsd"
		   xmlns:xs="http://www.w3.org/2001/XMLSchema">

	<xs:element name="SimpleXmppConfiguration">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="Host" type="xs:string">
					<xs:annotation>
						<xs:documentation>Host name of XMPP server.</xs:documentation>
					</xs:annotation>
				</xs:element>
				<xs:element name="Port" type="PortNumber">
					<xs:annotation>
						<xs:documentation>Port number to use when connecting to XMPP server.</xs:documentation>
					</xs:annotation>
				</xs:element>
				<xs:element name="Account" type="xs:string">
					<xs:annotation>
						<xs:documentation>Name of account on XMPP server to connect to.</xs:documentation>
					</xs:annotation>
				</xs:element>
				<xs:element name="Password">
					<xs:annotation>
						<xs:documentation>Password of account.</xs:documentation>
					</xs:annotation>
					<xs:complexType>
						<xs:simpleContent>
							<xs:extension base="xs:string">
								<xs:attribute name="type" type="xs:string" use="optional"/>
							</xs:extension>
						</xs:simpleContent>
					</xs:complexType>
				</xs:element>
				<xs:element name="ThingRegistry" type="xs:string">
					<xs:annotation>
						<xs:documentation>JID of Thing Registry to use. Leave blank if no thing registry is to be used.</xs:documentation>
					</xs:annotation>
				</xs:element>
				<xs:element name="Provisioning" type="xs:string">
					<xs:annotation>
						<xs:documentation>JID of Provisioning Server to use. Leave blank if no thing registry is to be used.</xs:documentation>
					</xs:annotation>
				</xs:element>
				<xs:element name="Events" type="xs:string">
					<xs:annotation>
						<xs:documentation>JID of entity to whom events should be sent. Leave blank if events are not to be forwarded.</xs:documentation>
					</xs:annotation>
				</xs:element>
				<xs:element name="Sniffer" type="xs:boolean">
					<xs:annotation>
						<xs:documentation>If a sniffer is to be used ('true' or 'false'). If 'true', network communication will be output to the console.</xs:documentation>
					</xs:annotation>
				</xs:element>
				<xs:element name="TrustServer" type="xs:boolean">
					<xs:annotation>
						<xs:documentation>If the server certificate should be trusted automatically ('true'), or if a certificate validation should be done to test the validity of the server ('false').</xs:documentation>
					</xs:annotation>
				</xs:element>
				<xs:element name="AllowCramMD5" type="xs:boolean" minOccurs="0" default="true">
					<xs:annotation>
						<xs:documentation>If CRAM-MD5 authentication should be allowed. (Default=true)</xs:documentation>
					</xs:annotation>
				</xs:element>
				<xs:element name="AllowDigestMD5" type="xs:boolean" minOccurs="0" default="true">
					<xs:annotation>
						<xs:documentation>If DIGEST-MD5 authentication should be allowed. (Default=true)</xs:documentation>
					</xs:annotation>
				</xs:element>
				<xs:element name="AllowPlain" type="xs:boolean" minOccurs="0" default="false">
					<xs:annotation>
						<xs:documentation>If PLAIN authentication should be allowed. (Default=false)</xs:documentation>
					</xs:annotation>
				</xs:element>
				<xs:element name="AllowScramSHA1" type="xs:boolean" minOccurs="0" default="true">
					<xs:annotation>
						<xs:documentation>If SCRAM-SHA-1 authentication should be allowed. (Default=true)</xs:documentation>
					</xs:annotation>
				</xs:element>
        <xs:element name="AllowScramSHA256" type="xs:boolean" minOccurs="0" default="true">
          <xs:annotation>
            <xs:documentation>If SCRAM-SHA-256 authentication should be allowed. (Default=true)</xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="AllowEncryption" type="xs:boolean" minOccurs="0" default="true">
					<xs:annotation>
						<xs:documentation>If Encryption (TLS) should be allowed. (Default=true)</xs:documentation>
					</xs:annotation>
				</xs:element>
				<xs:element name="RequestRosterOnStartup" type="xs:boolean" minOccurs="0" default="true">
					<xs:annotation>
						<xs:documentation>If the roster should be requested during startup. (Default=true)</xs:documentation>
					</xs:annotation>
				</xs:element>
				<xs:element name="AllowRegistration" type="xs:boolean" minOccurs="0" default="false">
					<xs:annotation>
						<xs:documentation>If the client is allowed to register for a new account, if the account was not found. (Default=false)</xs:documentation>
					</xs:annotation>
				</xs:element>
				<xs:element name="FormSignatureKey" type="xs:string" minOccurs="0">
					<xs:annotation>
						<xs:documentation>Form signature key, if form signatures (XEP-0348) is to be used during registration.</xs:documentation>
					</xs:annotation>
				</xs:element>
				<xs:element name="FormSignatureSecret" type="xs:string" minOccurs="0">
					<xs:annotation>
						<xs:documentation>Form signature secret, if form signatures (XEP-0348) is to be used during registration.</xs:documentation>
					</xs:annotation>
				</xs:element>
			</xs:sequence>
		</xs:complexType>
	</xs:element>

	<xs:simpleType name="PortNumber">
		<xs:restriction base="xs:positiveInteger">
			<xs:maxInclusive value="65535"/>
		</xs:restriction>
	</xs:simpleType>

</xs:schema>
