2 Defines abstract classes which describe fundamental data concepts as
7 # Copyright (c) 2017 Cisco Systems, Inc. and others. All rights reserved.
9 # This program and the accompanying materials are made available under the
10 # terms of the Eclipse Public License v1.0 which accompanies this distribution,
11 # and is available at http://www.eclipse.org/legal/epl-v10.html
15 class IoTData(object):
16 """Data exchanged in IoT communication"""
19 """Returns copy of this object"""
20 raise NotImplementedError()
22 def _compare(self, data2):
24 Compares two IoT data instances, return True if they are equal,
27 raise NotImplementedError()
30 class IoTDataBuilder(object):
31 """Builder class of IoTData objects"""
34 """Returns copy of this builder object"""
35 raise NotImplementedError()
38 """Builds the IoTData object"""
39 raise NotImplementedError()
42 class IoTDataEncoder(object):
43 """Encodes IoTData object to protocol specific message"""
45 def encode(self, iotdm_data):
46 """Returns protocol specific message including encoded IoTData"""
47 raise NotImplementedError()
50 class IoTDataEncodeError(Exception):
51 """IoTData encoding error"""
56 class IoTDataDecoder(object):
57 """Decoded protocol specific message to IoTData"""
59 def decode(self, protocol_message):
60 """Returns IoTData decoded of the protocol specific message"""
61 raise NotImplementedError()
64 class IoTDataDecodeError(Exception):
65 """Protocol message decoding error"""