public JiraRepository(IJiraSoapClient client, Uri baseUri, TimeSpan cacheExpiryPeriod, IStatusMap statusMap) { this.client = client; this.baseUri = baseUri; this.cacheExpiryPeriod = cacheExpiryPeriod; this.token = this.client.login("name", "password"); this.statuses = this.client.getStatuses(this.token); this.statusMap = statusMap; }
/// <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); } }