def setName (self, name): self.mySetNameGuard.crashIfInitDone() self.myName=name self._log.setInstance(name) for logFunc in self._log("init").debug2Func(): logFunc("Initialized") TrxPhase.setLogger(self._log) self.mySetNameGuard.initDone()
def handleTrxElementCommitPrivateValueSet(self, trxElement, keyDepth): for logFunc in self._log( "handle-trx-element-commit-private-value-set-details" ).debug2Func(): logFunc( "trx-details: element-key-path=%s, element-op-code=%s, keyDepth=%s", trxElement.getKeyPath(), trxElement.getOpCode(), keyDepth) phase = TrxPhase(TrxPhase.kCommit, TrxPhase.kPrivate) res = self.notifyPhase(phase) if (res != ReturnCodes.kOk): for logFunc in self._log( "handle-trx-element-commit-private-value-set-failed" ).errorFunc(): logFunc( "handle-trx-commit-private-value-set-failed: element-key-path=%s, element-op-code=%s, keyDepth=%s, res=%s", trxElement.getKeyPath(), trxElement.getOpCode(), keyDepth, res) return ReturnCodes.kGeneralError return ReturnCodes.kOk
def handleTrxElementPreparePublicValueSet(self, trxElement, keyDepth): for logFunc in self._log( "handle-trx-element-prepare-public-value-set-details" ).debug2Func(): logFunc( "trx-details: element-key-path=%s, element-op-code=%s, keyDepth=%s", trxElement.getKeyPath(), trxElement.getOpCode(), keyDepth) phase = TrxPhase(TrxPhase.kPrepare, TrxPhase.kPublic) res = self.notifyPhase(phase) if (res != ReturnCodes.kOk): for logFunc in self._log( "handle-trx-element-prepare-public-value-set-failed" ).noticeFunc(): logFunc( "handle-trx-prepare-public-value-set-failed: element-key-path=%s, element-op-code=%s, keyDepth=%s, res=%s", trxElement.getKeyPath(), trxElement.getOpCode(), keyDepth, res) return ReturnCodes.kGeneralError return ReturnCodes.kOk
def handleTrxElementAbortPublicValueSet(self, trxElement, keyDepth): for logFunc in self._log( "handle-trx-element-abort-public-value-set-details" ).debug2Func(): logFunc( "trx-details: element-key-path=%s, element-op-code=%s, keyDepth=%s", trxElement.getKeyPath(), trxElement.getOpCode(), keyDepth) phase = TrxPhase(TrxPhase.kAbort, TrxPhase.kPublic) res = self.notifyPhase(phase) if (res != ReturnCodes.kOk): for logFunc in self._log( "handle-trx-element-abort-public-value-set-failed" ).errorFunc(): logFunc("handle-trx-abort-public-value-set-failed - fatal: element-key-path=%s, "\ "element-op-code=%s, keyDepth=%s, res=%s", trxElement.getKeyPath(), trxElement.getOpCode(), keyDepth, res) a.infra.process.processFatal("abort public value set failed") return ReturnCodes.kGeneralError return ReturnCodes.kOk
def getPrepareProgressStage(self): prepareStage = TrxProgress( TrxPhase(TrxPhase.kPrepare, self.myTrxPhase.getBlinkyPhase()), self.myProgressStage) return prepareStage
def internalAbortPublicCreate(self): for logFunc in self._log("internal-abort-public-create").debug2Func(): logFunc("internalAbortPublicCreate() called") return self.notifyPhase(TrxPhase(TrxPhase.kAbort, TrxPhase.kPublic))
def internalCommitPublicCreate(self): for logFunc in self._log("internal-commit-public-create").debug2Func(): logFunc("internalCommitPublicCreate() called") self.notifyPhase(TrxPhase(TrxPhase.kCommit, TrxPhase.kPublic))
def internalCommitPrivateCreate(self): for logFunc in self._log( "internal-commit-private-create").debug2Func(): logFunc("internalCommitPrivateCreate() called") return self.notifyPhase(TrxPhase(TrxPhase.kCommit, TrxPhase.kPrivate))
def internalPreparePublicCreate(self): for logFunc in self._log( "internal-prepare-public-create").debug2Func(): logFunc("internalPreparePublicCreate() called") return self.notifyPhase(TrxPhase(TrxPhase.kPrepare, TrxPhase.kPublic))