Skip to content
Snippets Groups Projects
Commit c34a0992 authored by Edileuton Henrique de Oliveira's avatar Edileuton Henrique de Oliveira
Browse files

webservice: Issue #1565 Grant that mac address isn't NULL, and the fields city_code and ip are NULL

parent c7ce7ab3
No related branches found
No related tags found
No related merge requests found
......@@ -451,8 +451,8 @@ public class DataSID {
BigInteger down_packages, BigInteger up_kbits, BigInteger up_packages) throws SQLException {
final String query = "INSERT INTO " + SA_NET_USAGE + " " +
"(contact_date, id_point, macaddr, collect_date, collect_time, " +
"down_kbits, down_packages, up_kbits, up_packages) VALUES " +
"(?, ?, ?, ?, ?, ?, ?, ?, ?);";
"down_kbits, down_packages, up_kbits, up_packages, ip, city_code) VALUES " +
"(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);";
PreparedStatement st = con.prepareStatement(query);
......@@ -474,6 +474,10 @@ public class DataSID {
st.setInt(9, up_packages.intValue());
st.setObject(10, null);
st.setString(11, null);
return st;
}
}
......@@ -4,7 +4,7 @@
<xsd:complexType name="CollectedData">
<xsd:all>
<xsd:element name="agent-version" type="xsd:string" minOccurs="1" />
<xsd:element name="agent-version" type="Version" minOccurs="1" />
<xsd:element name="point-info" type="PointInfo" minOccurs="1" />
<xsd:element name="interfaces" type="Interfaces" minOccurs="1" />
<xsd:element name="machine-type" minOccurs="1">
......@@ -20,6 +20,12 @@
</xsd:all>
</xsd:complexType>
<xsd:simpleType name="Version">
<xsd:restriction base="xsd:string">
<xsd:pattern value="[0-9]+.[0-9]+.[0-9]+" />
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="Interfaces">
<xsd:sequence>
<xsd:element name="interface" type="Interface" minOccurs="1" maxOccurs="unbounded" />
......@@ -28,9 +34,15 @@
<xsd:complexType name="Interface">
<xsd:attribute name="name" type="xsd:string" use="required" />
<xsd:attribute name="mac-address" type="xsd:string" use="required" />
<xsd:attribute name="mac-address" type="MacAddress" use="required" />
</xsd:complexType>
<xsd:simpleType name="MacAddress">
<xsd:restriction base="xsd:string">
<xsd:pattern value="[0-9a-fA-F]{2}:[0-9a-fA-F]{2}:[0-9a-fA-F]{2}:[0-9a-fA-F]{2}:[0-9a-fA-F]{2}:[0-9a-fA-F]{2}" />
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="Inventory">
<xsd:all>
<xsd:element name="processor" type="xsd:string" minOccurs="1" />
......
......@@ -4,13 +4,19 @@
<xsd:complexType name="NetCollectedData">
<xsd:all>
<xsd:element name="agent-version" type="xsd:string" minOccurs="1" />
<xsd:element name="agent-version" type="Version" minOccurs="1" />
<xsd:element name="id-point" type="xsd:integer" minOccurs="1" />
<xsd:element name="interfaces" type="Interfaces" minOccurs="1" />
<xsd:element name="bandwidth-usage" type="BandwidthUsage" minOccurs="1" />
</xsd:all>
</xsd:complexType>
<xsd:simpleType name="Version">
<xsd:restriction base="xsd:string">
<xsd:pattern value="[0-9]+.[0-9]+.[0-9]+" />
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="Interfaces">
<xsd:sequence>
<xsd:element name="interface" type="Interface" minOccurs="1" maxOccurs="unbounded" />
......@@ -19,9 +25,15 @@
<xsd:complexType name="Interface">
<xsd:attribute name="name" type="xsd:string" use="required" />
<xsd:attribute name="mac-address" type="xsd:string" use="required" />
<xsd:attribute name="mac-address" type="MacAddress" use="required" />
</xsd:complexType>
<xsd:simpleType name="MacAddress">
<xsd:restriction base="xsd:string">
<xsd:pattern value="[0-9a-fA-F]{2}:[0-9a-fA-F]{2}:[0-9a-fA-F]{2}:[0-9a-fA-F]{2}:[0-9a-fA-F]{2}:[0-9a-fA-F]{2}" />
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="BandwidthUsage">
<xsd:sequence>
<xsd:element name="netuse" type="NetUse" minOccurs="1" maxOccurs="unbounded" />
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment