from core.comm.TDSResponse import TDSResponse
from core.comm.TDSRequest import TDSRequest
from core.core.client import client
from core.core.config import config
from core.core.task import task
from core.core.node import node

taskResultRepositoryObj = taskResultRepository()
clientRepositoryObj = clientRepository()
nodeRepositoryObj = nodeRepository()
taskRepositoryObj = taskRepository()
TDSResponseObj = TDSResponse()
TDSRequestObj = TDSRequest()
configObj = config()
clientObj = client()
nodeObj = node()
taskObj = task()


class clientController:
    # It will process the request in respect to the commands
    # It is the first point of execution in coordinator side
    def processRequest(self, TDSRequest):
        if (TDSRequest.head['method'] == 'client-queueTask'):
            response = self.processQueueRequest(TDSRequest)
        elif (TDSRequest.head['method'] == 'client-queryTask'):
            response = self.processQueryRequest(TDSRequest)
        elif (TDSRequest.head['method'] == 'client-resultTask'):
            response = self.processResultRequest(TDSRequest)
        else:
            logging.exception(
Exemple #2
0
 def geTaskPath(self, TDSRequest):
     fileName = node().prepareFileName(TDSRequest)
     node().saveFile(TDSRequest, fileName)
     filePath = os.path.abspath(fileName)
     logging.info("Task file strored at: " + filePath)
     return filePath