Package com.atlassian.jira.rest.client.internal.async

Examples of com.atlassian.jira.rest.client.internal.async.AsynchronousJiraRestClientFactory


    public RestJiraClient(URI serverUri, String username, String password) {
        final URI baseUri = UriBuilder.fromUri(serverUri).path("/rest/api/latest").build();
        final HttpClient httpClient =
            new AsynchronousHttpClientFactory().createClient(serverUri, new BasicHttpAuthenticationHandler(username,
                    password));
        jiraRestClient = new AsynchronousJiraRestClientFactory().create(serverUri, httpClient);
        userRestClient = new OesbAsynchronousUserRestClient(baseUri, httpClient);
    }
View Full Code Here


        return AliveState.ONLINE;
    }

    @Override
    public Authentication authenticate(String username, Credentials credentials) throws AuthenticationException {
        JiraRestClientFactory restClientFactory = new AsynchronousJiraRestClientFactory();
        String givenPassword = ((Password) credentials).getValue();
        JiraRestClient restClient =
            restClientFactory.createWithBasicHttpAuthentication(ServerConfig.serverUri, username, givenPassword);
        try {
            restClient.getSessionClient().getCurrentSession().claim();
        } catch (Exception e) {
            // statuscode 401: missing user or wrong pass. 403: forbidden (e.g.captcha required)
            throw new AuthenticationException(e);
View Full Code Here

public class ExampleCreateIssuesAsynchronous {

  private static URI jiraServerUri = URI.create("http://localhost:2990/jira");

  public static void main(String[] args) throws IOException {
    final AsynchronousJiraRestClientFactory factory = new AsynchronousJiraRestClientFactory();
    final JiraRestClient restClient = factory.createWithBasicHttpAuthentication(jiraServerUri, "admin", "admin");

    try {
      final List<Promise<BasicIssue>> promises = Lists.newArrayList();
      final IssueRestClient issueClient = restClient.getIssueClient();
View Full Code Here

  private static boolean quiet = false;

  public static void main(String[] args) throws URISyntaxException, JSONException, IOException {
    parseArgs(args);

    final AsynchronousJiraRestClientFactory factory = new AsynchronousJiraRestClientFactory();
    final JiraRestClient restClient = factory.createWithBasicHttpAuthentication(jiraServerUri, "admin", "admin");
    try {
      final int buildNumber = restClient.getMetadataClient().getServerInfo().claim().getBuildNumber();

      // first let's get and print all visible projects (only jira4.3+)
      if (buildNumber >= ServerVersionConstants.BN_JIRA_4_3) {
View Full Code Here

  protected void setAdmin() {
    setClient(TestConstants.ADMIN_USERNAME, TestConstants.ADMIN_PASSWORD);
  }

  protected void setClient(String username, String password) {
    final JiraRestClientFactory clientFactory = new AsynchronousJiraRestClientFactory();
    client = clientFactory.create(jiraUri, new BasicHttpAuthenticationHandler(username, password));
  }
View Full Code Here

    final JiraRestClientFactory clientFactory = new AsynchronousJiraRestClientFactory();
    client = clientFactory.create(jiraUri, new BasicHttpAuthenticationHandler(username, password));
  }

  protected void setAnonymousMode() {
    final JiraRestClientFactory clientFactory = new AsynchronousJiraRestClientFactory();
    client = clientFactory.create(jiraUri, new AnonymousAuthenticationHandler());
  }
View Full Code Here

  protected void setAdmin() {
    setClient(TestConstants.ADMIN_USERNAME, TestConstants.ADMIN_PASSWORD);
  }

  protected void setClient(String username, String password) {
    final JiraRestClientFactory clientFactory = new AsynchronousJiraRestClientFactory();
    client = clientFactory.create(jiraUri, new BasicHttpAuthenticationHandler(username, password));
  }
View Full Code Here

    final JiraRestClientFactory clientFactory = new AsynchronousJiraRestClientFactory();
    client = clientFactory.create(jiraUri, new BasicHttpAuthenticationHandler(username, password));
  }

  protected void setAnonymousMode() {
    final JiraRestClientFactory clientFactory = new AsynchronousJiraRestClientFactory();
    client = clientFactory.create(jiraUri, new AnonymousAuthenticationHandler());
  }
View Full Code Here

TOP

Related Classes of com.atlassian.jira.rest.client.internal.async.AsynchronousJiraRestClientFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.