/// <param name="zkDeployForm">
		/// 
		/// @return </param>
		public virtual ConfigFullModel verify(ZkDeployForm zkDeployForm)
		{

			//
			// app
			//
			if (zkDeployForm.AppId == null)
			{
				throw new FieldException("app is empty", null);
			}

			App app = appMgr.getById(zkDeployForm.AppId);
			if (app == null)
			{
				throw new FieldException("app " + zkDeployForm.AppId + " doesn't exist in db.", null);
			}

			//
			// env
			//
			if (zkDeployForm.EnvId == null)
			{
				throw new FieldException("app is empty", null);
			}

			Env env = envMgr.getById(zkDeployForm.EnvId);
			if (env == null)
			{
				throw new FieldException("env " + zkDeployForm.EnvId + " doesn't exist in db.", null);
			}

			//
			// version
			//
			if (StringUtils.isEmpty(zkDeployForm.Version))
			{
				throw new FieldException("version is empty", null);
			}

			return new ConfigFullModel(app, env, zkDeployForm.Version, "");
		}
Example #2
0
		/// <summary>
		/// 获取ZK 部署情况
		/// </summary>
		/// <param name="zkDeployForm">
		/// 
		/// @return </param>
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @RequestMapping(value = "/zkdeploy", method = org.springframework.web.bind.annotation.RequestMethod.GET) @ResponseBody public com.baidu.dsp.common.vo.JsonObjectBase getZkDeployInfo(@Valid com.baidu.disconf.web.service.zookeeper.form.ZkDeployForm zkDeployForm)
		public virtual JsonObjectBase getZkDeployInfo(ZkDeployForm zkDeployForm)
		{

			LOG.info(zkDeployForm.ToString());

			ConfigFullModel configFullModel = zkDeployValidator.verify(zkDeployForm);

			string data = zkDeployMgr.getDeployInfo(configFullModel.App.Name, configFullModel.Env.Name, zkDeployForm.Version);

			return buildSuccess("hostInfo", data);
		}