示例#1
0
        /// <summary>
        /// Create a client that connects with a JIRA server with specified dependencies.
        /// </summary>
        public Jira(IJqlExpressionVisitor translator,
                    IJiraSoapClient jiraService,
                    IFileSystem fileSystem,
                    JiraCredentials credentials = null,
                    string accessToken          = null,
                    JiraCache cache             = null)
        {
            _provider    = new JiraQueryProvider(translator, this);
            _jiraService = jiraService;
            _fileSystem  = fileSystem;
            _token       = accessToken;
            _credentials = credentials;
            _restClient  = jiraService as IJiraRestClient;
            _cache       = cache ?? new JiraCache();

            this.MaxIssuesPerRequest = DEFAULT_MAX_ISSUES_PER_REQUEST;
            this.Debug = false;

            if (_restClient == null && !String.IsNullOrEmpty(jiraService.Url))
            {
                var options = new JiraRestClient.Options()
                {
                    Url = jiraService.Url,
                    RestClientSettings = new JiraRestClientSettings(),
                    GetCurrentJiraFunc = () => this
                };

                if (this._credentials != null)
                {
                    options.Username = _credentials.UserName;
                    options.Password = _credentials.Password;
                }

                this._restClient = new JiraRestClient(options);
            }
        }
示例#2
0
 public JiraQueryProvider(IJqlExpressionVisitor translator, IIssueService issues)
 {
     _translator = translator;
     _issues     = issues;
 }
 public JiraQueryProvider(IJqlExpressionVisitor translator, Jira jiraInstance)
 {
     _translator = translator;
     _jiraServer = jiraInstance;
 }