Sfoglia il codice sorgente

Z991239-6383 #comment feat: 下线升级旧接口

Signed-Off-By: commit-hook
刘文涛80174520 2 mesi fa
parent
commit
50a4bb7430

+ 4 - 65
Module/mod_UpgradeMgr/mod_UpgradeMgr.cpp

@@ -64,7 +64,7 @@ namespace Task
 					return;
 				}
 				else {
-					DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("InitFSMTask")("init new upgradeTaskMgr FSM succ");
+					DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM).setAPI("InitFSMTask")("init new upgradeTaskMgr FSM succ");
 					Mgr->m_initSucc = true;
 				}
 
@@ -218,7 +218,7 @@ void CUpgradeMgrEntity::OnStarted()
 	if (pFunc->GetSysVar("UIState", strValue) == Error_Succeed && strValue.Compare("M") ==0)
 	{
 		// 已经进入首页状态
-		DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("system page isStartup 1");
+		DbgWithLink(LOG_LEVEL_DEBUG,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("system page isStartup 1");
 		m_bStartUp =true;
 	}		
 	else
@@ -230,7 +230,7 @@ void CUpgradeMgrEntity::OnStarted()
 			LogWarn(Severity_Middle, rc, ERR_WRAN_REGIST_SYS_VAR_FAIL, CSimpleStringA::Format("RegistSysVarEvent UIState  is fail,%d",(int)rc).GetData());
 			m_testResult=Error_InvalidState;//自检失败
 		}else{
-			DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("RegistSysVarEvent UIState succ");
+			DbgWithLink(LOG_LEVEL_DEBUG,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("RegistSysVarEvent UIState succ");
 		}
 
 	}
@@ -267,7 +267,7 @@ void CUpgradeMgrEntity::OnSysVarEvent(const char *pszKey, const char *pszValue,c
 	if(strcmp("UIState",pszKey)==0){
 		if(!m_bStartUp){
 			if (strcmp(pszValue, "M") ==0){
-				DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("system page isStartup 2");
+				DbgWithLink(LOG_LEVEL_DEBUG,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("system page isStartup 2");
 				m_bStartUp = true;				
 			}
 		}
@@ -317,44 +317,6 @@ char CUpgradeMgrEntity::GetInstallStateVal(const InstallStateEnum enumVal)
 	return ' ';  // error
 }
 
-//新状态机不处理
-ErrorCodeEnum CUpgradeMgrEntity::RegistLocalPack(const CSimpleStringA &strPackFile)
-{
-	if(m_initSucc){
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("RegistLocalPack new UpgradeMgr is not deal with");
-		return Error_NotImpl;
-	}else{
-		DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("initFSM is not end");
-		return Error_Pending;//状态机还未启动
-	}
-	
-}
-
-//新状态机不处理
-DWORD CUpgradeMgrEntity::RegistManualPack(const CSimpleStringA &strPackFile)
-{
-	if(m_initSucc){
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("RegistManualPack new UpgradeMgr is not deal with");
-		return UPGRADE_MGR_NOT_IMPLEMENT;
-	}else{
-		DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("initFSM is not end");
-		return Error_Pending;//状态机还未启动
-	}
-}
-
-
-//新状态机不处理
-ErrorCodeEnum CUpgradeMgrEntity::CancelUpdate(const CSimpleStringA &strPackFile)
-{
-	if(m_initSucc){
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("CancelUpdate new UpgradeMgr is not deal with");
-		return Error_NotImpl;
-	}else{
-		DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("initFSM is not end");
-		return Error_Pending;//状态机还未启动
-	}
-}
-
 //新状态机处理
 ErrorCodeEnum CUpgradeMgrEntity::RollbackUpdate(const CSimpleStringA &strVersion)
 {
@@ -439,34 +401,11 @@ ErrorCodeEnum CUpgradeMgrEntity::RollbackUpdate(const CSimpleStringA &strVersion
 	}
 }
 
-//新状态机不处理
-DWORD CUpgradeMgrEntity::GetManualPacks(CSimpleStringA &strManualPacks)
-{	
-	if(m_initSucc){
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("GetManualPacks new UpgradeMgr is not deal with");
-		return UPGRADE_MGR_NOT_IMPLEMENT;
-	}else{
-		DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("initFSM is not end");
-		return Error_Pending;//状态机还未启动
-	}
-}
-
 CServerSessionBase* CUpgradeMgrEntity::OnNewSession(const char* /*pszRemoteEntityName*/, const char * /*pszParam*/)
 {
 	return new CUpgradeMgrSession(this);
 }
 
-//新状态机不处理
-ErrorCodeEnum CUpgradeMgrEntity::SwitchUpgrade(const CSimpleStringA &strPack)
-{
-	if(m_initSucc){
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("SwitchUpgrade new UpgradeMgr is not deal with");
-		return Error_NotImpl;
-	}else{
-		DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("initFSM is not end");
-		return Error_Pending;//状态机还未启动
-	}
-}
 
 //新状态机处理
 ErrorCodeEnum CUpgradeMgrEntity::GetUpgradeState(bool &bInstalling, CSimpleStringA &strPackFile, CSimpleStringA &strExecID,

+ 3 - 58
Module/mod_UpgradeMgr/mod_UpgradeMgr.h

@@ -52,12 +52,10 @@ public:
 	virtual void OnSysVarEvent(const char *pszKey, const char *pszValue,const char *pszOldValue,const char *pszEntityName);
 	static char GetInstallStateVal(const InstallStateEnum enumVal);
 	
-	ErrorCodeEnum RegistLocalPack(const CSimpleStringA &strPackFile);
-	DWORD RegistManualPack(const CSimpleStringA &strPackFile);
-	DWORD GetManualPacks(CSimpleStringA &strManualPacks);
-	ErrorCodeEnum CancelUpdate(const CSimpleStringA &strPackName);
+	
+
 	ErrorCodeEnum RollbackUpdate(const CSimpleStringA &strVersion);
-	ErrorCodeEnum SwitchUpgrade(const CSimpleStringA &strPack);
+	
 	ErrorCodeEnum GetUpgradeState(bool &bInstalling, CSimpleStringA &strPackFile, CSimpleStringA &strExecID,
 		char &nInstallState, bool &bSysInstall, bool &bLightPack, CSimpleStringA &strNewVersion);
 	//检测active文件是否被锁
@@ -98,36 +96,6 @@ public:
 	CUpgradeMgrSession(CUpgradeMgrEntity *pEntity) : m_pEntity(pEntity) {}
 	virtual ~CUpgradeMgrSession() {}
 
-	virtual void Handle_RegistLocalPack(SpReqAnsContext<UpgradeMgrService_RegistLocalPack_Req, UpgradeMgrService_RegistLocalPack_Ans>::Pointer ctx)
-	{
-		DbgToBeidou(ctx->link, __FUNCTION__)();
-		ErrorCodeEnum rc = m_pEntity->RegistLocalPack(ctx->Req.strPackFile);
-		ctx->Answer(rc);
-	}
-
-	virtual void Handle_RegistManualPack(SpReqAnsContext<UpgradeMgrService_RegistManualPack_Req, UpgradeMgrService_RegistManualPack_Ans>::Pointer ctx)
-	{
-		LOG_FUNCTION();
-		DbgToBeidou(ctx->link, __FUNCTION__)();
-		DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("RegistManualPack received!");
-		DWORD dwRet = 0;
-		CSimpleStringA strErrmsg="RegistManualPack new UpgradeMgr is not deal with";
-		
-		dwRet = m_pEntity->RegistManualPack(ctx->Req.strPackFile);
-
-		ctx->Ans.Errcode = dwRet;
-		ctx->Ans.ErrMsg = strErrmsg;
-		ctx->Answer(Error_Succeed);
-	}
-
-	virtual void Handle_CancelUpdate(SpReqAnsContext<UpgradeMgrService_CancelUpdate_Req, UpgradeMgrService_CancelUpdate_Ans>::Pointer ctx)
-	{
-		DbgToBeidou(ctx->link, __FUNCTION__)();
-		DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("CancelUpdate received!");
-		ErrorCodeEnum rc = m_pEntity->CancelUpdate(ctx->Req.strPackFile);
-		ctx->Answer(rc);
-	}
-
 	virtual void Handle_RollbackUpdate(SpReqAnsContext<UpgradeMgrService_RollbackUpdate_Req, UpgradeMgrService_RollbackUpdate_Ans>::Pointer ctx)
 	{
 		DbgToBeidou(ctx->link, __FUNCTION__)();
@@ -145,29 +113,6 @@ public:
 		ctx->Answer(rc);
 	}
 
-	virtual void Handle_SwitchUpgrade(SpReqAnsContext<UpgradeMgrService_SwitchUpgrade_Req, UpgradeMgrService_SwitchUpgrade_Ans>::Pointer ctx)
-	{
-		DbgToBeidou(ctx->link, __FUNCTION__)();
-		DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("SwitchUpgrade received!");
-		auto rc = m_pEntity->SwitchUpgrade(ctx->Req.strPackFile);
-		ctx->Answer(rc);
-	}
-
-	virtual void Handle_GetManualPacks(SpReqAnsContext<UpgradeMgrService_GetManualPacks_Req, UpgradeMgrService_GetManualPacks_Ans>::Pointer ctx)
-	{
-		LOG_FUNCTION();
-		DbgToBeidou(ctx->link, __FUNCTION__)();
-		DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("GetManualPacks received!");
-		DWORD dwRet = 0;
-		CSimpleStringA strErrmsg= "GetManualPacks new UpgradeMgr is not deal with";
-		CSimpleStringA strPackList="";
-		dwRet = m_pEntity->GetManualPacks(strPackList);
-
-		ctx->Ans.Errcode = dwRet;
-		ctx->Ans.ErrMsg = strErrmsg;
-		ctx->Answer(Error_Succeed);
-	}
-
 private:
 	CUpgradeMgrEntity *m_pEntity;
 };