Examples of JiraRestClientFactory


Examples of com.atlassian.jira.rest.client.JiraRestClientFactory

        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

Examples of com.atlassian.jira.rest.client.JiraRestClientFactory

  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

Examples of com.atlassian.jira.rest.client.JiraRestClientFactory

        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

Examples of com.atlassian.jira.rest.client.JiraRestClientFactory

        // 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

Examples of com.atlassian.jira.rest.client.api.JiraRestClientFactory

  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

Examples of com.atlassian.jira.rest.client.api.JiraRestClientFactory

    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

Examples of com.atlassian.jira.rest.client.api.JiraRestClientFactory

  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

Examples of com.atlassian.jira.rest.client.api.JiraRestClientFactory

    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

Examples of com.atlassian.jira.rest.client.api.JiraRestClientFactory

        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

Examples of com.atlassian.jira.rest.client.api.JiraRestClientFactory

  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
TOP
Copyright © 2018 www.massapi.com. 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.