This repository has been archived by the owner on Dec 29, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extracted appropriate interfaces. Removed Nito.AsyncEx dependency. Wo…
…rkItemStore pooling works now properly.
- Loading branch information
1 parent
0f9e546
commit 15f03d1
Showing
9 changed files
with
269 additions
and
220 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// <copyright file="IGlobalList.cs" company="Joerg Battermann"> | ||
// (c) 2012 Joerg Battermann. | ||
// License: Microsoft Public License (Ms-PL). For details see https://github.com/jbattermann/JB.Tfs.Common/blob/master/LICENSE | ||
// </copyright> | ||
// <author>Joerg Battermann</author> | ||
|
||
namespace JB.Tfs.Common | ||
{ | ||
using System.Collections.Generic; | ||
using System.Xml; | ||
|
||
public interface IGlobalList | ||
{ | ||
/// <summary> | ||
/// Gets the name. | ||
/// </summary> | ||
string Name { get; } | ||
|
||
/// <summary> | ||
/// Gets the values. | ||
/// </summary> | ||
IEnumerable<string> Values { get; } | ||
|
||
/// <summary> | ||
/// Gets the global list item values. | ||
/// </summary> | ||
/// <param name="globalListXmlElement">The global list XML element.</param> | ||
/// <returns></returns> | ||
IEnumerable<string> GetGlobalListItemValues(XmlElement globalListXmlElement); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// <copyright file="IGlobalListCollection.cs" company="Joerg Battermann"> | ||
// (c) 2012 Joerg Battermann. | ||
// License: Microsoft Public License (Ms-PL). For details see https://github.com/jbattermann/JB.Tfs.Common/blob/master/LICENSE | ||
// </copyright> | ||
// <author>Joerg Battermann</author> | ||
|
||
namespace JB.Tfs.Common | ||
{ | ||
using System.Collections.Generic; | ||
using Microsoft.TeamFoundation.WorkItemTracking.Client; | ||
|
||
public interface IGlobalListCollection : IEnumerable<GlobalList> | ||
{ | ||
/// <summary> | ||
/// Saves the data to the team foundation server. | ||
/// </summary> | ||
void Save(WorkItemStore workItemStore); | ||
|
||
/// <summary> | ||
/// Refreshes the data from the team foundation server. | ||
/// </summary> | ||
void Refresh(WorkItemStore workItemStore); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// <copyright file="IPooledWorkItemStore.cs" company="Joerg Battermann"> | ||
// (c) 2012 Joerg Battermann. | ||
// License: Microsoft Public License (Ms-PL). For details see https://github.com/jbattermann/JB.Tfs.Common/blob/master/LICENSE | ||
// </copyright> | ||
// <author>Joerg Battermann</author> | ||
|
||
namespace JB.Tfs.Common | ||
{ | ||
using System; | ||
using Microsoft.TeamFoundation.WorkItemTracking.Client; | ||
|
||
public interface IPooledWorkItemStore : IDisposable | ||
{ | ||
/// <summary> | ||
/// Gets the work item store. | ||
/// </summary> | ||
WorkItemStore WorkItemStore { get; } | ||
|
||
/// <summary> | ||
/// Gets the parent work item store connection pool. | ||
/// </summary> | ||
WorkItemStoreConnectionPool WorkItemStoreConnectionPool { get; } | ||
|
||
/// <summary> | ||
/// Tries to release the underlying WorkItemStore back to pool. Cannot be used safely anymore afterwards. | ||
/// </summary> | ||
/// <param name="retryAttempts">The retry attempts.</param> | ||
/// <returns>True if successful, otherwise false.</returns> | ||
bool TryRelease(int retryAttempts = 0); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// <copyright file="IWorkItemStoreConnectionPool.cs" company="Joerg Battermann"> | ||
// (c) 2012 Joerg Battermann. | ||
// License: Microsoft Public License (Ms-PL). For details see https://github.com/jbattermann/JB.Tfs.Common/blob/master/LICENSE | ||
// </copyright> | ||
// <author>Joerg Battermann</author> | ||
|
||
namespace JB.Tfs.Common | ||
{ | ||
using System; | ||
|
||
public interface IWorkItemStoreConnectionPool : IDisposable | ||
{ | ||
/// <summary> | ||
/// Increases the size of the pool. | ||
/// </summary> | ||
/// <param name="increaseBy">The amount of stores to increase the pool by.</param> | ||
void IncreasePoolSize(int increaseBy = 1); | ||
|
||
/// <summary> | ||
/// Decreases the size of the pool. | ||
/// </summary> | ||
/// <param name="decreaseBy">The amount of stores to decrease the pool by.</param> | ||
void DecreasePoolSize(int decreaseBy = 1); | ||
|
||
/// <summary> | ||
/// Tries to get and reserve an avalable, pooled <see cref="T:Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore"/>. | ||
/// Important: Use the using(..) construct or call .Dispose() when done to release the work item store back to the pool. | ||
/// </summary> | ||
/// <returns></returns> | ||
PooledWorkItemStore TryGetWorkItemStore(); | ||
|
||
/// <summary> | ||
/// Gets the used work item stores count. | ||
/// </summary> | ||
/// <returns></returns> | ||
int GetUsedWorkItemStoresCount(); | ||
|
||
/// <summary> | ||
/// Gets the available work item stores count. | ||
/// </summary> | ||
/// <returns></returns> | ||
int GetAvailableWorkItemStoresCount(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.