public void Connect() { try { connection = CreateConnection(configuration); apiMethods = new FavroApiFacade(connection, logger); var organization = configuration.GetValue(KEY_ORGANIZATION); organizationInfo = apiMethods.GetOrganization(organization); if (organizationInfo != null) { connection.OrganizationId = organizationInfo.OrganizationId; organizationShortName = GetOrganizationShortName(); } else { throw new InvalidOperationException("The organization info couldn't be retrieved from Favro, check your user and password"); } } catch (Exception e) { // If the plugin is not well configured the previous code throws exceptions, but // we can't throw an expection in this method because in other case Plastic can't work // properly and both the preferences dialog and the branch explorer can't be opened until // this plugin is uninstalled logger.Error(e.Message); } }
public void Connect() { connection = CreateConnection(configuration); var organization = configuration.GetValue(KEY_ORGANIZATION); connection.OrganizationId = organization; apiMethods = new FavroApiFacade(connection, logger); organizationInfo = apiMethods.GetOrganization(organization); organizationShortName = GetOrganizationShortName(); }
public bool TestConnection(IssueTrackerConfiguration configuration) { var testConnection = CreateConnection(configuration); var testMethods = new FavroApiFacade(testConnection, logger); try { return(testMethods.GetOrganization(testConnection.OrganizationId) != null); } catch (Exception) { // When the plugin is not well configured the previous call throws an exception // In that case return false return(false); } }
public void Disconnect() { connection = null; apiMethods = null; }