* Replacing the message_schema.xsd and the user_schema.xsd with
sync_schema.xsd. * Added UserStatus * Changed bindings.xml to support the UserStatus Enum properly.
This commit is contained in:
parent
93503ae861
commit
ab52fb5b3d
22
src/main/java/envoy/schema/UserStatus.java
Normal file
22
src/main/java/envoy/schema/UserStatus.java
Normal file
@ -0,0 +1,22 @@
|
||||
package envoy.schema;
|
||||
|
||||
import javax.xml.bind.annotation.XmlEnum;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
/**
|
||||
* Project: <strong>envoy-common</strong><br>
|
||||
* File: <strong>UserStatus.java</strong><br>
|
||||
* Created: <strong>27 Nov 2019</strong><br>
|
||||
*
|
||||
* @author Maximilian Käfer
|
||||
*/
|
||||
@XmlType(name = "")
|
||||
@XmlEnum
|
||||
public enum UserStatus {
|
||||
|
||||
ONLINE, DONOTDISTURB, AFK, OFFLINE;
|
||||
|
||||
public String value() { return name(); }
|
||||
|
||||
public static UserStatus fromValue(String v) { return valueOf(v); }
|
||||
}
|
@ -1,48 +1,68 @@
|
||||
<?xml version="1.0"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
targetNamespace="https://github.com/informatik-ag-ngl"
|
||||
xmlns="https://github.com/informatik-ag-ngl"
|
||||
elementFormDefault="qualified">
|
||||
|
||||
<xs:element name="Messages">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="Message" type="Message" minOccurs="0"
|
||||
maxOccurs="unbounded" />
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
<xs:complexType name="Message">
|
||||
<xs:sequence>
|
||||
<xs:element name="MetaData">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="Sender" type="xs:long" />
|
||||
<xs:element name="Recipient" type="xs:long" />
|
||||
<xs:element name="Date" type="xs:dateTime" />
|
||||
<xs:element name="State">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="Waiting"/>
|
||||
<xs:enumeration value="Sent"/>
|
||||
<xs:enumeration value="Received"/>
|
||||
<xs:enumeration value="Read"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="Content" maxOccurs="unbounded">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="text" type="xs:string" />
|
||||
</xs:sequence>
|
||||
<xs:attribute name="type" type="xs:string" />
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
|
||||
</xs:schema>
|
||||
<?xml version="1.0"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
targetNamespace="https://github.com/informatik-ag-ngl"
|
||||
xmlns="https://github.com/informatik-ag-ngl"
|
||||
elementFormDefault="qualified">
|
||||
|
||||
<xs:element name="Sync">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="Message" type="Message" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="User" type="User" minOccurs="0" maxOccurs="unbounded" />
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
|
||||
<xs:complexType name="Message">
|
||||
<xs:sequence>
|
||||
<xs:element name="Metadata">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="Sender" type="xs:long" />
|
||||
<xs:element name="Recipient" type="xs:long" />
|
||||
<xs:element name="Date" type="xs:dateTime" />
|
||||
<xs:element name="MessageId" type="xs:long"/>
|
||||
<xs:element name="State">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="Waiting"/>
|
||||
<xs:enumeration value="Sent"/>
|
||||
<xs:enumeration value="Received"/>
|
||||
<xs:enumeration value="Read"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="Content" maxOccurs="unbounded">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="text" type="xs:string" />
|
||||
</xs:sequence>
|
||||
<xs:attribute name="type" type="xs:string" />
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
|
||||
|
||||
<xs:complexType name="User">
|
||||
<xs:sequence>
|
||||
<xs:element name="Name" type="xs:string" />
|
||||
<xs:element name="ID" type="xs:long" />
|
||||
<xs:element name="Status">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="ONLINE"/>
|
||||
<xs:enumeration value="DONOTDISTURB"/>
|
||||
<xs:enumeration value="AFK"/>
|
||||
<xs:enumeration value="OFFLINE"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
|
||||
</xs:schema>
|
@ -1,23 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
targetNamespace="https://github.com/informatik-ag-ngl"
|
||||
xmlns="https://github.com/informatik-ag-ngl"
|
||||
elementFormDefault="qualified">
|
||||
|
||||
<xs:element name="Users">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="User" type="User" minOccurs="0"
|
||||
maxOccurs="unbounded" />
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
<xs:complexType name="User">
|
||||
<xs:sequence>
|
||||
<xs:element name="Name" type="xs:string" />
|
||||
<xs:element name="ID" type="xs:long" />
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
|
||||
</xs:schema>
|
@ -6,10 +6,15 @@
|
||||
fixedAttributeAsConstantProperty="true">
|
||||
<xjc:serializable />
|
||||
</jaxb:globalBindings>
|
||||
<jaxb:bindings schemaLocation="../resources/message_schema.xsd">
|
||||
<jaxb:bindings schemaLocation="../resources/sync_schema.xsd">
|
||||
<jaxb:bindings
|
||||
node="//xs:element[@name='State']/xs:simpleType">
|
||||
<jaxb:typesafeEnumClass name="MessageState" />
|
||||
</jaxb:bindings>
|
||||
|
||||
<jaxb:bindings
|
||||
node="//xs:element[@name='Status']/xs:simpleType">
|
||||
<jaxb:typesafeEnumClass name="UserStatus" />
|
||||
</jaxb:bindings>
|
||||
</jaxb:bindings>
|
||||
</jaxb:bindings>
|
Reference in New Issue
Block a user