def create_type_ascii(self, value=None, nb_char_min=None, nb_char_max=None): return Serializer.datatype_to_json( self.__project.create_type_ascii(value=value, nb_char_min=nb_char_min, nb_char_max=nb_char_max))
def get_domain(self, did): if did is None: raise ValueError("A DID must be specified") did = str(did).strip() if len(did) == 0: raise ValueError("A DID must be specified") return Serializer.domain_to_json(self.__project.get_domain(did=did))
def get_capture(self, cid): if cid is None: raise ValueError("A CID must be specified") cid = str(cid).strip() if len(cid) == 0: raise ValueError("A CID must be specified") return Serializer.capture_to_json(self.__project.get_capture(cid=cid))
def get_symbol(self, sid): if sid is None: raise ValueError("A SID must be specified") sid = str(sid).strip() if len(sid) == 0: raise ValueError("A SID must be specified") return Serializer.symbol_to_json(self.__project.get_symbol(sid=sid))
def get_message(self, mid): if mid is None: raise ValueError("A MID must be specified") mid = str(mid).strip() if len(mid) == 0: raise ValueError("A MID must be specified") return Serializer.message_to_json(self.__project.get_message(mid=mid))
def get_field(self, fid): if fid is None: raise ValueError("A FID must be specified") fid = str(fid).strip() if len(fid) == 0: raise ValueError("A FID must be specified") return Serializer.field_to_json(self.__project.get_field(fid))
def get_datatype(self, tid): if tid is None: raise ValueError("A TID must be specified") tid = str(tid).strip() if len(tid) == 0: raise ValueError("A TID must be specified") return Serializer.datatype_to_json( self.__project.get_datatype(tid=tid))
def add_symbol(self, name): if name is None: raise ValueError("A name must be specified") name = str(name).strip() if len(name) == 0: raise ValueError("A name must be specified") x = Serializer.symbol_to_json(self.__project.create_symbol(name=name)) return x
def add_capture(self, name, date=None): if name is None: raise ValueError("A name must be specified") name = str(name).strip() if len(name) == 0: raise ValueError("A name must be specified") return Serializer.capture_to_json( self.__project.create_capture(name=name, date=date))
def get_domains_in_aggregate(self, aid, limit, offset): if aid is None: raise ValueError("A AID must be specified") aid = str(aid).strip() if len(aid) == 0: raise ValueError("A AID must be specified") return [ Serializer.domain_to_json(domain) for domain in self.__project.get_domains_in_aggregate( aid=aid, limit=limit, offset=offset) ]
def get_messages_in_capture(self, cid, limit, offset): if cid is None: raise ValueError("A CID must be specified") cid = str(cid).strip() if len(cid) == 0: raise ValueError("A CID must be specified") return [ Serializer.message_to_json(message) for message in self.__project.get_capture(cid).messages[offset:offset + limit] ]
def get_symbol_fields(self, sid, limit, offset): if sid is None: raise ValueError("A SID must be specified") sid = str(sid).strip() if len(sid) == 0: raise ValueError("A SID must be specified") return [ Serializer.field_to_json(field) for field in self.__project.get_symbol_fields( sid=sid, limit=limit, offset=offset) ]
def remove_domain_in_aggregate(self, aid, did): if aid is None: raise ValueError("A AID must be specified") aid = str(aid).strip() if len(aid) == 0: raise ValueError("A AID must be specified") if did is None: raise ValueError("A AID must be specified") did = str(did).strip() if len(did) == 0: raise ValueError("A DID must be specified") return Serializer.domain_to_json( self.__project.remove_domain_in_aggregate(aid=aid, did=did))
def create_domain_data(self, name, tid): if name is None: raise ValueError("A name must be specified") name = str(name).strip() if len(name) == 0: raise ValueError("A name must be specified") if tid is None: raise ValueError("A TID must be specified") tid = str(tid).strip() if len(tid) == 0: raise ValueError("A TID must be specified") return Serializer.domain_to_json( self.__project.create_domain_data(name=name, tid=tid))
def update_symbol(self, sid, name): if sid is None: raise ValueError("A SID must be specified") sid = str(sid).strip() if len(sid) == 0: raise ValueError("A SID must be specified") if name is None: raise ValueError("A name must be specified") name = str(name).strip() if len(name) == 0: raise ValueError("A name must be specified") return Serializer.symbol_to_json( self.__project.update_symbol(sid=sid, name=name))
def add_message(self, cid, data, date=None, source=None, destination=None): if cid is None: raise ValueError("A CID must be specified") if data is None: raise ValueError("A data must be specified") data = str(data).strip() if len(data) == 0: raise ValueError("A data must be specified") return Serializer.message_to_json( self.__project.create_message(cid=cid, data=data, date=date, source=source, destination=destination))
def add_field(self, name, did): if name is None: raise ValueError("A name must be specified") name = str(name).strip() if len(name) == 0: raise ValueError("A name must be specified") if did is None: raise ValueError("A DID must be specified") did = str(did).strip() if len(did) == 0: raise ValueError("A DID must be specified") x = Serializer.field_to_json( self.__project.create_field(name=name, did=did)) return x
def get_symbols(self, limit, offset): return [ Serializer.symbol_to_json(symbol) for symbol in self.__project.get_symbols(limit, offset) ]
def get_fields(self, limit, offset): return [ Serializer.field_to_json(field) for field in self.__project.get_fields(limit, offset) ]
def create_domain_aggregate(self): return Serializer.domain_to_json( self.__project.create_domain_aggregate())
def get_messages(self, limit, offset): return [ Serializer.message_to_json(message) for message in self.__project.get_messages(limit, offset) ]
def get_captures(self, limit, offset): return [ Serializer.capture_to_json(capture) for capture in self.__project.get_captures(limit, offset) ]
def create_type_raw(self, value=None, nb_byte_min=None, nb_byte_max=None): return Serializer.datatype_to_json( self.__project.create_type_raw(value=value, nb_byte_min=nb_byte_min, nb_byte_max=nb_byte_max))
def get_datatypes(self, limit, offset): return [ Serializer.datatype_to_json(domain) for domain in self.__project.get_datatypes(limit, offset) ]