public AppInfo getApp(HttpServletRequest req, HttpServletResponse res, String appId) { UserGroupInformation callerUGI = getUser(req); final ApplicationId id = parseApplicationId(appId); ApplicationReport app = null; try { if (callerUGI == null) { GetApplicationReportRequest request = GetApplicationReportRequest.newInstance(id); app = appBaseProt.getApplicationReport(request).getApplicationReport(); } else { app = callerUGI.doAs( new PrivilegedExceptionAction<ApplicationReport> () { @Override public ApplicationReport run() throws Exception { GetApplicationReportRequest request = GetApplicationReportRequest.newInstance(id); return appBaseProt.getApplicationReport(request).getApplicationReport(); } }); } } catch (Exception e) { rewrapAndThrowException(e); } if (app == null) { throw new NotFoundException("app with id: " + appId + " not found"); } return new AppInfo(app); }
public AppInfo getApp(HttpServletRequest req, HttpServletResponse res, String appId) { UserGroupInformation callerUGI = getUser(req); final ApplicationId id = parseApplicationId(appId); ApplicationReport app = null; try { if (callerUGI == null) { GetApplicationReportRequest request = GetApplicationReportRequest.newInstance(id); app = appBaseProt.getApplicationReport(request).getApplicationReport(); } else { app = callerUGI.doAs( new PrivilegedExceptionAction<ApplicationReport> () { @Override public ApplicationReport run() throws Exception { GetApplicationReportRequest request = GetApplicationReportRequest.newInstance(id); return appBaseProt.getApplicationReport(request).getApplicationReport(); } }); } } catch (Exception e) { rewrapAndThrowException(e); } if (app == null) { throw new NotFoundException("app with id: " + appId + " not found"); } return new AppInfo(app); }
public AppInfo getApp(HttpServletRequest req, HttpServletResponse res, String appId) { UserGroupInformation callerUGI = getUser(req); final ApplicationId id = parseApplicationId(appId); ApplicationReport app = null; try { if (callerUGI == null) { GetApplicationReportRequest request = GetApplicationReportRequest.newInstance(id); app = appBaseProt.getApplicationReport(request).getApplicationReport(); } else { app = callerUGI.doAs( new PrivilegedExceptionAction<ApplicationReport> () { @Override public ApplicationReport run() throws Exception { GetApplicationReportRequest request = GetApplicationReportRequest.newInstance(id); return appBaseProt.getApplicationReport(request).getApplicationReport(); } }); } } catch (Exception e) { rewrapAndThrowException(e); } if (app == null) { throw new NotFoundException("app with id: " + appId + " not found"); } return new AppInfo(app); }