@Test public void test1ValidateConfig() { xAssetService.validateConfig(vXAsset); }
public void validateConfig(VXAsset vObj) { HashMap<String, Object> configrationMap = null; if (vObj.getAssetType() == AppConstants.ASSET_HDFS) { TypeReference<HashMap<String, Object>> typeRef = new TypeReference <HashMap<String, Object>>() {}; try { configrationMap = JsonUtilsV2.getMapper().readValue(vObj.getConfig(), typeRef); } catch (Exception e) { logger.error("Error in config json", e); } if (configrationMap != null) { String fs_default_name = configrationMap.get("fs.default.name") .toString(); if (fs_default_name.isEmpty()) { throw restErrorUtil.createRESTException( "serverMsg.fsDefaultNameEmptyError", MessageEnums.INVALID_INPUT_DATA, null, "fs.default.name", vObj.toString()); } } } }
XAssetService extends XAssetServiceBase<XXAsset, VXAsset> { public void validateConfig(VXAsset vObj) { HashMap<String, Object> configrationMap = null; if (vObj.getAssetType() == AppConstants.ASSET_HDFS) { TypeReference<HashMap<String, Object>> typeRef = new TypeReference <HashMap<String, Object>>() {}; try { configrationMap = JsonUtilsV2.getMapper().readValue(vObj.getConfig(), typeRef); } catch (Exception e) { logger.error("Error in config json", e); } if (configrationMap != null) { String fs_default_name = configrationMap.get("fs.default.name") .toString(); if (fs_default_name.isEmpty()) { throw restErrorUtil.createRESTException( "serverMsg.fsDefaultNameEmptyError", MessageEnums.INVALID_INPUT_DATA, null, "fs.default.name", vObj.toString()); } } } } }
XAssetService extends XAssetServiceBase<XXAsset, VXAsset> { public void validateConfig(VXAsset vObj) { HashMap<String, Object> configrationMap = null; if (vObj.getAssetType() == AppConstants.ASSET_HDFS) { TypeReference<HashMap<String, Object>> typeRef = new TypeReference <HashMap<String, Object>>() {}; try { configrationMap = JsonUtilsV2.getMapper().readValue(vObj.getConfig(), typeRef); } catch (Exception e) { logger.error("Error in config json", e); } if (configrationMap != null) { String fs_default_name = configrationMap.get("fs.default.name") .toString(); if (fs_default_name.isEmpty()) { throw restErrorUtil.createRESTException( "serverMsg.fsDefaultNameEmptyError", MessageEnums.INVALID_INPUT_DATA, null, "fs.default.name", vObj.toString()); } } } } XAssetService(); }
XAssetService extends XAssetServiceBase<XXAsset, VXAsset> { public void validateConfig(VXAsset vObj) { HashMap<String, Object> configrationMap = null; if (vObj.getAssetType() == AppConstants.ASSET_HDFS) { TypeReference<HashMap<String, Object>> typeRef = new TypeReference <HashMap<String, Object>>() {}; try { configrationMap = JsonUtilsV2.getMapper().readValue(vObj.getConfig(), typeRef); } catch (Exception e) { logger.error("Error in config json", e); } if (configrationMap != null) { String fs_default_name = configrationMap.get("fs.default.name") .toString(); if (fs_default_name.isEmpty()) { throw restErrorUtil.createRESTException( "serverMsg.fsDefaultNameEmptyError", MessageEnums.INVALID_INPUT_DATA, null, "fs.default.name", vObj.toString()); } } } } XAssetService(); void validateConfig(VXAsset vObj); List<XXTrxLog> getTransactionLog(VXAsset vResource, String action); List<XXTrxLog> getTransactionLog(VXAsset vObj, XXAsset mObj, String action); String getConfigWithEncryptedPassword(String config,boolean isForced); String getConfigWithDecryptedPassword(String config); }
XAssetService extends XAssetServiceBase<XXAsset, VXAsset> { public void validateConfig(VXAsset vObj) { HashMap<String, Object> configrationMap = null; if (vObj.getAssetType() == AppConstants.ASSET_HDFS) { TypeReference<HashMap<String, Object>> typeRef = new TypeReference <HashMap<String, Object>>() {}; try { configrationMap = JsonUtilsV2.getMapper().readValue(vObj.getConfig(), typeRef); } catch (Exception e) { logger.error("Error in config json", e); } if (configrationMap != null) { String fs_default_name = configrationMap.get("fs.default.name") .toString(); if (fs_default_name.isEmpty()) { throw restErrorUtil.createRESTException( "serverMsg.fsDefaultNameEmptyError", MessageEnums.INVALID_INPUT_DATA, null, "fs.default.name", vObj.toString()); } } } } XAssetService(); void validateConfig(VXAsset vObj); List<XXTrxLog> getTransactionLog(VXAsset vResource, String action); List<XXTrxLog> getTransactionLog(VXAsset vObj, XXAsset mObj, String action); String getConfigWithEncryptedPassword(String config,boolean isForced); String getConfigWithDecryptedPassword(String config);  }