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

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


        return getRestClient().getIssueClient().getIssue(bugIdentifier);
    }
   
   
    private JiraRestClient setupJiraClient(String url) throws URISyntaxException {
        JiraRestClientFactory factory = new AsynchronousJiraRestClientFactory();
        final JiraRestClient restClient = factory.createWithBasicHttpAuthentication(new URI(url), "rhq-bot", "123456");
        return restClient;
    }
View Full Code Here


  public static Status ignore(final JiraIgnore annotation) {
    if (annotation == null) {
      return Status.NOT_TRACKING;
    }
    try {
      JiraRestClientFactory factory = new AsynchronousJiraRestClientFactory();
      JiraRestClient restClient = factory
          .createWithBasicHttpAuthentication(new URI(annotation.server()), getUserName(), getPassword());
      try {
        Issue issue = restClient.getIssueClient().getIssue(annotation.issue()).get();
        if (!issue.getStatus().getName().equalsIgnoreCase("CLOSED")) {
          return Status.OPEN;
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

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 {
    parseArgs(args);

    final AsynchronousJiraRestClientFactory factory = new AsynchronousJiraRestClientFactory();
    final JiraRestClient restClient = factory.createWithBasicHttpAuthentication(jiraServerUri, "admin", "admin");
    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) {
      final Iterable<BasicProject> allProjects = restClient.getProjectClient().getAllProjects().claim();
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

        intro.append("**********************************************************************************************\r\n");
        System.out.println(intro.toString());

        // Construct the JRJC client
        System.out.println(String.format("Logging in to %s with username '%s' and password '%s'", JIRA_URL, JIRA_ADMIN_USERNAME, JIRA_ADMIN_PASSWORD));
        JiraRestClientFactory factory = new AsynchronousJiraRestClientFactory();
        URI uri = new URI(JIRA_URL);
        JiraRestClient client = factory.createWithBasicHttpAuthentication(uri, JIRA_ADMIN_USERNAME, JIRA_ADMIN_PASSWORD);

        // Invoke the JRJC Client
        Promise<User> promise = client.getUserClient().getUser("admin");
        User user = promise.claim();

View Full Code Here

        // the Atlassian Plugin SDK. If this is not the case in your JIRA instance, you will need to change these values.
        final String jiraUser = "admin";
        final String jiraPassword = "admin";

        // Setup the JRJC
        JiraRestClientFactory factory = new AsynchronousJiraRestClientFactory();
        URI jiraServerUri;
        try
        {
            jiraServerUri = new URI(jiraBaseURL);
        }
        catch (URISyntaxException e)
        {
            throw new ServletException("Could not understand the JIRA Base URL: " + e.getMessage(), e);
        }

        JiraRestClient client = factory.createWithBasicHttpAuthentication(jiraServerUri, jiraUser, jiraPassword);
        String userToRetrieve = userManager.getRemoteUsername();
        if (StringUtils.isBlank(userToRetrieve))
            userToRetrieve = jiraUser;

        Promise<User> promise = client.getUserClient().getUser(userToRetrieve);
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.