def METHOD_NAME(self, connector, reason):
    self.currentCaseId += 1
    if self.currentCaseId <= self.endCaseId:
        self.resource = "/runCase?case={}&agent={}".format(self.currentCaseId, self.agent)
        connector.connect()
    elif self.updateReports:
        self.resource = "/updateReports?agent={}".format(self.agent)
        self.updateReports = False
        connector.connect()
    else:
        reactor.stop()