public static List<UserEmailEntity> getUserMail(Config config, String siteId, String userId) { List<UserEmailEntity> result = new ArrayList<>(); String url = "http://" + config.getString(Constants.HOST_PATH) + ":" + config.getInt(Constants.PORT_PATH) + config.getString(Constants.CONTEXT_PATH) + Constants.ANALYZER_PATH + Constants.USER_META_ROOT_PATH + "/" + siteId + "/" + URLEncoder.encode(userId); InputStream is = null; try { is = InputStreamUtils.getInputStream(url, null, org.apache.eagle.jpm.util.Constants.CompressionType.NONE); LOG.info("get user meta from {}", url); result = ((RESTResponse<List<UserEmailEntity>>) OBJ_MAPPER.readValue(is, new TypeReference<RESTResponse<List<UserEmailEntity>>>() { })).getData(); } catch (Exception e) { LOG.warn("failed to get user meta from {}", url, e); } finally { org.apache.eagle.jpm.util.Utils.closeInputStream(is); } return result; }
public static List<JobMetaEntity> getJobMeta(Config config, String siteId, String jobDefId) { List<JobMetaEntity> result = new ArrayList<>(); String url = "http://" + config.getString(Constants.HOST_PATH) + ":" + config.getInt(Constants.PORT_PATH) + config.getString(Constants.CONTEXT_PATH) + Constants.ANALYZER_PATH + Constants.JOB_META_ROOT_PATH + "/" + siteId + "/" + URLEncoder.encode(jobDefId); InputStream is = null; try { is = InputStreamUtils.getInputStream(url, null, org.apache.eagle.jpm.util.Constants.CompressionType.NONE); LOG.info("get job meta from {}", url); result = ((RESTResponse<List<JobMetaEntity>>) OBJ_MAPPER.readValue(is, new TypeReference<RESTResponse<List<JobMetaEntity>>>() { })).getData(); } catch (Exception e) { LOG.warn("failed to get job meta from {}", url, e); } finally { org.apache.eagle.jpm.util.Utils.closeInputStream(is); } return result; }
return false; } finally { Utils.closeInputStream(is);
return false; } finally { Utils.closeInputStream(is);
continue; } finally { Utils.closeInputStream(is);
return false; } finally { Utils.closeInputStream(is);
return false; } finally { Utils.closeInputStream(is);