Ejemplo n.º 1
0
        protected override Yield Stop(Result result) {

            // clear settings
            _password = null;
            _username = null;
            _jira = null;
            yield return Coroutine.Invoke(base.Stop, new Result());
            result.Return();
        }
Ejemplo n.º 2
0
        protected override Yield Start(XDoc config, Result result) {
            yield return Coroutine.Invoke(base.Start, config, new Result());

            // read configuration settings
            _username = config["username"].AsText;
            if (string.IsNullOrEmpty(_username)) {
                throw new ArgumentException(MISSING_FIELD_ERROR, "username");
            }
            _password = config["password"].AsText;
            if (string.IsNullOrEmpty(_password)) {
                throw new ArgumentException(MISSING_FIELD_ERROR, "password");
            }
            _uri = config["jira-uri"].AsUri;
            if (_uri == null) {
                throw new ArgumentException(MISSING_FIELD_ERROR, "jira-uri");
            }

            _jiraTokenDuration = TimeSpan.FromMinutes(config["jira-session-timeout-mins"].AsInt ?? DEFAULT_LOGIN_TTL);

            // initialize web-service
            _jira = new JiraSoapServiceService();
            _jira.Url = _uri.At("rpc", "soap", "jirasoapservice-v2").ToString();
            result.Return();
        }