Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How disconnect after making connection createWithBasicHttpAuthentication

sudheer test February 3, 2014

Is there any way to disconnect after making succesfull conection? because my scritp is waiting for the termincation and I can't use System.exit(0) in my java code. I am looking for simmilar command connection.disconnect(); in HttpDefaultClient. in JRJC

Here is my code:-

JiraRestClientFactory factory = new AsynchronousJiraRestClientFactory(); 
URI uri = new URI(JIRA_URL);
 JiraRestClient client = factory.createWithBasicHttpAuthentication(uri, JIRA_ADMIN_USERNAME, JIRA_ADMIN_PASSWORD);
Promise<Issue> promise = client.getIssueClient().getIssue(jiraId);
Issue issue = promise.claim(); issueStatus = issue.getStatus().getName();

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Aleksander Mierzwicki
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 2, 2014

Use .close method on JiraRestClient instance when you are about to throw out that instance (ideally using try finally block). Note that this was not avaiable until 2.0.0-m8 (or something close to that version) - please use latest version of JRJC (about 2.0.0-m25).

There is example usage of JRJC - https://bitbucket.org/atlassian/jira-rest-java-client/src/bd758b52f53978033bdd0d8071edd75d7bdcc607/test/src/test/java/samples/ExampleCreateIssuesAsynchronous.java

0 votes
sudheer test February 17, 2014

Able to resolve this by importing com.atlassian.jira.rest.client.api instead of com.atlassian.jira.rest.client

TAGS
AUG Leaders

Atlassian Community Events