[ https://issues.apache.org/jira/browse/GOBBLIN-1137?focusedWorklogId=429663&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-429663 ]
ASF GitHub Bot logged work on GOBBLIN-1137: ------------------------------------------- Author: ASF GitHub Bot Created on: 01/May/20 21:21 Start Date: 01/May/20 21:21 Worklog Time Spent: 10m Work Description: arjun4084346 commented on a change in pull request #2976: URL: https://github.com/apache/incubator-gobblin/pull/2976#discussion_r418743177 ########## File path: gobblin-modules/gobblin-azkaban/src/main/java/org/apache/gobblin/service/modules/orchestration/AzkabanMultiCallables.java ########## @@ -415,4 +415,42 @@ public AzkabanClientStatus call() } } } + + /** + * A callable that will get the list of proxy users from a project on Azkaban. + */ + @Builder + static class GetProxyUserCallable implements Callable<AzkabanClientStatus> { + private AzkabanClient client; + private String projectName; + private boolean invalidSession = false; + + @Override + public AzkabanClientStatus call() + throws AzkabanClientException { + try (Closer closer = Closer.create()) { + client.refreshSession(this.invalidSession); + List<NameValuePair> nvps = new ArrayList<>(); + nvps.add(new BasicNameValuePair(AzkabanClientParams.AJAX, "getProxyUsers")); + nvps.add(new BasicNameValuePair(AzkabanClientParams.SESSION_ID, client.sessionId)); + nvps.add(new BasicNameValuePair(AzkabanClientParams.PROJECT, projectName)); + + Header contentType = new BasicHeader(HttpHeaders.CONTENT_TYPE, "application/x-www-form-urlencoded"); + Header requestType = new BasicHeader("X-Requested-With", "XMLHttpRequest"); + + HttpGet httpGet = new HttpGet(client.url + "/manager?" + URLEncodedUtils.format(nvps, "UTF-8")); + httpGet.setHeaders(new Header[]{contentType, requestType}); + + CloseableHttpResponse response = client.httpClient.execute(httpGet); + closer.register(response); + Map<String, String> map = AzkabanClient.handleResponse(response); + return new AzkabanGetProxyUsersStatus(new AzkabanGetProxyUsersStatus.ProxyUsers(map)); + } catch (InvalidSessionException e) { + this.invalidSession = true; Review comment: should not all Callables in this class call themselves at least one more time when they get InvalidSessionException ? ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 429663) Time Spent: 40m (was: 0.5h) > Add API for getting list of proxy users from an azkaban project > --------------------------------------------------------------- > > Key: GOBBLIN-1137 > URL: https://issues.apache.org/jira/browse/GOBBLIN-1137 > Project: Apache Gobblin > Issue Type: Improvement > Reporter: Jack Moseley > Priority: Major > Time Spent: 40m > Remaining Estimate: 0h > -- This message was sent by Atlassian Jira (v8.3.4#803005)