コード例 #1
0
 def getUnchecked(self, key):
     if (self.get(key=key) != None):
         return self.m_convertorJsonToPb.converjsontoPBProper(
             response=self.get(key=key), instanceType=worker_pb2.WorkerPb())
     else:
         self.set(key=key,
                  value=self.m_convertorPbToJson.converPbtojsonString(
                      builder=self.m_workerService.get(id=key)))
     return self.m_convertorJsonToPb.converjsontoPBProper(
         response=self.get(key=key), instanceType=worker_pb2.WorkerPb())
コード例 #2
0
 def getEntityId(self):
     workerPb = self.m_queryExecutor.get(id=self.id,
                                         table=Tables.WORKER_DATA.name)
     if (workerPb != None):
         self.builder = self.m_converterJsonToPb.converjsontoPBProper(
             response=workerPb, instanceType=worker_pb2.WorkerPb())
     self.controlFlow(currentState=States.DONE)
コード例 #3
0
 def workerResponse(self, workerResp):
     self.workerlist.clear()
     workerSearchResponse = WorkerSearchResponsePb()
     workerSearchResponse.summary.totalHits = len(workerResp)
     for index, worker in enumerate(workerResp):
         # workerSearchResponse.results.add()
         try:
             self.workerlist.append(
                 self.m_converterJsonToPb.converjsontoPBProper(
                     response=worker[0],
                     instanceType=worker_pb2.WorkerPb()))
         except ValueError:
             pass
     workerSearchResponse.results.extend(self.workerlist)
     return workerSearchResponse
コード例 #4
0
 def updateWorker(builder):
     service = WorkerService()
     m_converter = ConvertJSONToPb()
     builder = m_converter.converjsontoPBProper(
         response=builder, instanceType=worker_pb2.WorkerPb())
     return service.update(id=builder.dbInfo.id, builder=builder)