00001 # MIT License 00002 # 00003 # Copyright (c) <2015> <Ikergune, Etxetar> 00004 # 00005 # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files 00006 # (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, 00007 # publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 00008 # subject to the following conditions: 00009 # 00010 # The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 00011 # 00012 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00013 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE 00014 # FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 00015 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 00016 00017 00018 class Ipublisher: 00019 ## \brief Interface for content publisher 00020 def createContent(topic, datatype, data, isPrimitive=False): 00021 ## \brief Format the data into FIROS format 00022 # \param topic name 00023 # \param topic type 00024 # \param topic value 00025 raise Exception('Method not implemented') 00026 00027 def publish(contex_id, datatype, attributes=[]): 00028 ## \brief Publish data of an entity 00029 # \param entity name 00030 # \param entity type 00031 # \param entity attributes 00032 raise Exception('Method not implemented') 00033 00034 def publishMap(self, context_id, attributes=[]): 00035 ## \brief Publish data of an entity in context broker 00036 # \param map topic name 00037 # \param map connections 00038 raise Exception('Method not implemented') 00039 00040 def publishMsg(attributes=[]): 00041 ## \brief Publish message structures 00042 # \param entity attributes 00043 raise Exception('Method not implemented') 00044 00045 00046 class Isubscriber: 00047 ## \brief Interface for content listener 00048 def subscribe(self, namespace, data_type, robot): 00049 ## \brief Subscribe to entities' changes 00050 # \param entity name 00051 # \param entity type 00052 # \param robot object 00053 raise Exception('Method not implemented') 00054 00055 def disconnect(self, namespace): 00056 ## \brief Delete subscription by namespace 00057 # \param entity name 00058 raise Exception('Method not implemented') 00059 00060 def disconnectAll(self): 00061 ## \brief Delete all subscriptions 00062 raise Exception('Method not implemented') 00063 00064 def deleteEntity(self, namespace, data_type): 00065 ## \brief Delete entity from content publisher 00066 # \param entity name 00067 # \param entity type 00068 raise Exception('Method not implemented') 00069 00070 def parseData(self, data): 00071 ## \brief Parse the received data 00072 # \param data 00073 raise Exception('Method not implemented') 00074 00075 def _generateSubscription(self, namespace, data_type="Robot", topics=[]): 00076 ## \brief Generate subscription message 00077 # \param entity name 00078 # \param entity type 00079 # \param entity's topics 00080 raise Exception('Method not implemented') 00081 00082 00083 class IqueryBuilder: 00084 ## \brief Content publisher query builder 00085 def findById(self, id): 00086 ## \brief Search entity data by its name 00087 # \param entity name 00088 raise Exception('Method not implemented')