Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/console/console.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Newtonsoft.Json.5.0.6\lib\net40\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="SimpleRESTServices, Version=1.1.2.0, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="SimpleRESTServices, Version=1.1.3.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\SimpleRESTServices.1.1.2.0\lib\net40\SimpleRESTServices.dll</HintPath>
<HintPath>..\packages\SimpleRESTServices.1.1.3.0\lib\net40\SimpleRESTServices.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand Down
2 changes: 1 addition & 1 deletion src/console/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="5.0.6" targetFramework="net40" />
<package id="SimpleRESTServices" version="1.1.2.0" targetFramework="net40" />
<package id="SimpleRESTServices" version="1.1.3.0" targetFramework="net40" />
</packages>
36 changes: 35 additions & 1 deletion src/corelib/Providers/Rackspace/ProviderBase`1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ public abstract class ProviderBase<TProvider>
/// </summary>
protected readonly IHttpResponseCodeValidator ResponseCodeValidator;

/// <summary>
/// This is the backing field for <see cref="ConnectionLimit"/>.
/// </summary>
private int? _connectionLimit;

/// <summary>
/// Initializes a new instance of the <see cref="ProviderBase{TProvider}"/> class using
/// the specified default identity, identity provider, and REST service implementation,
Expand Down Expand Up @@ -73,6 +78,28 @@ protected ProviderBase(CloudIdentity defaultIdentity, IIdentityProvider identit
ResponseCodeValidator = httpStatusCodeValidator ?? HttpResponseCodeValidator.Default;
}

/// <summary>
/// Gets or sets the maximum number of connections allowed on the <see cref="ServicePoint"/>
/// objects used for requests. If the value is <c>null</c>, the connection limit value for the
/// <see cref="ServicePoint"/> object is not altered.
/// </summary>
/// <exception cref="ArgumentOutOfRangeException">If <paramref name="value"/> is less than or equal to 0.</exception>
public int? ConnectionLimit
{
get
{
return _connectionLimit;
}

set
{
if (value <= 0)
throw new ArgumentOutOfRangeException("value");

_connectionLimit = value;
}
}

/// <summary>
/// Execute a REST request with an <see cref="object"/> body and strongly-typed result.
/// </summary>
Expand Down Expand Up @@ -469,7 +496,14 @@ protected virtual RequestSettings BuildDefaultRequestSettings(IEnumerable<HttpSt
if(non200SuccessCodes != null)
non200SuccessCodesAggregate.AddRange(non200SuccessCodes);

return new JsonRequestSettings { RetryCount = 2, RetryDelay = TimeSpan.FromMilliseconds(200), Non200SuccessCodes = non200SuccessCodesAggregate, UserAgent = UserAgentGenerator.UserAgent };
return new JsonRequestSettings
{
RetryCount = 2,
RetryDelay = TimeSpan.FromMilliseconds(200),
Non200SuccessCodes = non200SuccessCodesAggregate,
UserAgent = UserAgentGenerator.UserAgent,
ConnectionLimit = ConnectionLimit,
};
}

/// <summary>
Expand Down
4 changes: 2 additions & 2 deletions src/corelib/corelib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Newtonsoft.Json.5.0.6\lib\net40\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="SimpleRESTServices, Version=1.1.2.0, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="SimpleRESTServices, Version=1.1.3.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\SimpleRESTServices.1.1.2.0\lib\net40\SimpleRESTServices.dll</HintPath>
<HintPath>..\packages\SimpleRESTServices.1.1.3.0\lib\net40\SimpleRESTServices.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand Down
2 changes: 1 addition & 1 deletion src/corelib/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="5.0.6" targetFramework="net40" />
<package id="SimpleRESTServices" version="1.1.2.0" targetFramework="net40" />
<package id="SimpleRESTServices" version="1.1.3.0" targetFramework="net40" />
</packages>
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>SimpleRESTServices</id>
<version>1.1.2.0</version>
<version>1.1.3.0</version>
<title>SimpleRESTServices</title>
<authors>Alan Quillin</authors>
<owners>Alan Quillin</owners>
<licenseUrl>https://github.com/JSIStudios/SimpleRestServices/wiki/License</licenseUrl>
<projectUrl>https://github.com/JSIStudios/SimpleRestServices</projectUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<description>A simple set of client side and server side REST helpers</description>
<releaseNotes>https://github.com/JSIStudios/SimpleRestServices/wiki/v1.1.2.0</releaseNotes>
<releaseNotes>https://github.com/JSIStudios/SimpleRestServices/wiki/v1.1.3.0</releaseNotes>
<copyright>Copyright © JSI Studios 2013</copyright>
<tags>REST REST_client</tags>
<dependencies>
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,13 @@
Internet resource.
</summary>
</member>
<member name="P:JSIStudios.SimpleRESTServices.Client.RequestSettings.ConnectionLimit">
<summary>
Gets or sets the maximum number of connections allowed on the <see cref="T:System.Net.ServicePoint" /> object
used for the request. If the value is <c>null</c>, the connection limit value for the
<see cref="T:System.Net.ServicePoint" /> object is not altered.
</summary>
</member>
<member name="P:JSIStudios.SimpleRESTServices.Client.RequestSettings.ContentLength">
<summary>
Gets or sets the value of the Content-Length HTTP header.
Expand Down Expand Up @@ -1830,93 +1837,6 @@
Gets the default <see cref="T:JSIStudios.SimpleRESTServices.Client.RequestSettings" /> to use for requests sent from this service.
</summary>
</member>
<member name="M:JSIStudios.SimpleRESTServices.Client.Json.JsonRestServices.Execute(System.Uri,JSIStudios.SimpleRESTServices.Client.HttpMethod,System.Func{System.Net.HttpWebResponse,System.Boolean,JSIStudios.SimpleRESTServices.Client.Response},System.String,System.Collections.Generic.Dictionary{System.String,System.String},System.Collections.Generic.Dictionary{System.String,System.String},JSIStudios.SimpleRESTServices.Client.RequestSettings)">
<summary>
Executes a REST request with a string <paramref name="body" /> and user-defined
callback function for constructing the resulting <see cref="T:JSIStudios.SimpleRESTServices.Client.Response" /> object.
</summary>
<param name="url">The base URI.</param>
<param name="method">The HTTP method to use for the request.</param>
<param name="responseBuilderCallback">A user-specified function used to construct the resulting <see cref="T:JSIStudios.SimpleRESTServices.Client.Response" />
object from the <see cref="T:System.Net.HttpWebResponse" /> and a Boolean value specifying whether or not a <see cref="T:System.Net.WebException" />
was thrown during the request. If this value is <c>null</c>, this method is equivalent to calling
<see cref="M:JSIStudios.SimpleRESTServices.Client.IRestService.Execute(System.Uri,JSIStudios.SimpleRESTServices.Client.HttpMethod,System.String,System.Collections.Generic.Dictionary{System.String,System.String},System.Collections.Generic.Dictionary{System.String,System.String},JSIStudios.SimpleRESTServices.Client.RequestSettings)" />.</param>
<param name="body">The body of the request. If the value is <c>null</c>, the request is sent without a body.</param>
<param name="headers">
A collection of custom HTTP headers to include with the request. If the value is
<c>null</c>, no custom headers are added to the HTTP request.
</param>
<param name="queryStringParameters">
A collection of parameters to add to the query string portion of the request URI.
If the value is <c>null</c>, no parameters are added to the query string.
</param>
<param name="settings">
The settings to use for the request. If the value is <c>null</c>, an implementation-specific
set of default settings will be used for the request.
</param>
<returns>Returns a <see cref="T:JSIStudios.SimpleRESTServices.Client.Response" /> object containing the HTTP status code, headers,
and body from the REST response.</returns>
<exception cref="T:System.ArgumentNullException">If <paramref name="url" /> is <c>null</c>.</exception>
<exception cref="T:System.NotSupportedException">If <paramref name="method" /> is not supported by the service.</exception>
</member>
<member name="M:JSIStudios.SimpleRESTServices.Client.Json.JsonRestServices.Stream(System.Uri,JSIStudios.SimpleRESTServices.Client.HttpMethod,System.Func{System.Net.HttpWebResponse,System.Boolean,JSIStudios.SimpleRESTServices.Client.Response},System.IO.Stream,System.Int32,System.Int64,System.Collections.Generic.Dictionary{System.String,System.String},System.Collections.Generic.Dictionary{System.String,System.String},JSIStudios.SimpleRESTServices.Client.RequestSettings,System.Action{System.Int64})">
<summary>
Executes a REST request with a <see cref="T:System.IO.Stream" /><paramref name="content" />
and user-defined callback function for constructing the resulting <see cref="T:JSIStudios.SimpleRESTServices.Client.Response" />
object.
</summary>
<param name="url">The base URI.</param>
<param name="method">The HTTP method to use for the request.</param>
<param name="responseBuilderCallback">A user-specified function used to construct the resulting <see cref="T:JSIStudios.SimpleRESTServices.Client.Response" />
object from the <see cref="T:System.Net.HttpWebResponse" /> and a Boolean value specifying whether or not a <see cref="T:System.Net.WebException" />
was thrown during the request. If this value is <c>null</c>, this method is equivalent to calling
<see cref="M:JSIStudios.SimpleRESTServices.Client.RestServiceBase.Stream(System.Uri,JSIStudios.SimpleRESTServices.Client.HttpMethod,System.IO.Stream,System.Int32,System.Int64,System.Collections.Generic.Dictionary{System.String,System.String},System.Collections.Generic.Dictionary{System.String,System.String},JSIStudios.SimpleRESTServices.Client.RequestSettings,System.Action{System.Int64})" />.</param>
<param name="content">A stream providing the body of the request.</param>
<param name="bufferSize">
The size of the buffer used for copying data from <paramref name="content" /> to the
HTTP request stream.
</param>
<param name="maxReadLength">
The maximum number of bytes to send with the request. This parameter is optional.
If the value is 0, the request will include all data from <paramref name="content" />.
</param>
<param name="headers">
A collection of custom HTTP headers to include with the request. This parameter is
optional. If the value is <c>null</c>, no custom headers are added to the HTTP request.
</param>
<param name="queryStringParameters">
A collection of parameters to add to the query string portion of the request URI.
This parameter is optional. If the value is <c>null</c>, no parameters are added
to the query string.
</param>
<param name="settings">
The settings to use for the request. This parameters is optional. If the value is
<c>null</c>, an implementation-specific set of default settings will be used for the request.
</param>
<param name="progressUpdated">
A user-defined callback function for reporting progress of the send operation.
This parameter is optional. If the value is <c>null</c>, the method does not report
progress updates to the caller.
</param>
<param name="contents">
<markup>
<include item="SMCMissingParamTag">
<parameter>param</parameter>
<parameter>contents</parameter>
<parameter>M:JSIStudios.SimpleRESTServices.Client.Json.JsonRestServices.Stream(System.Uri,JSIStudios.SimpleRESTServices.Client.HttpMethod,System.Func{System.Net.HttpWebResponse,System.Boolean,JSIStudios.SimpleRESTServices.Client.Response},System.IO.Stream,System.Int32,System.Int64,System.Collections.Generic.Dictionary{System.String,System.String},System.Collections.Generic.Dictionary{System.String,System.String},JSIStudios.SimpleRESTServices.Client.RequestSettings,System.Action{System.Int64})</parameter>
</include>
</markup>
</param>
<returns>Returns a <see cref="T:JSIStudios.SimpleRESTServices.Client.Response" /> object containing the HTTP status code, headers,
and body from the REST response.</returns>
<exception cref="T:System.ArgumentNullException">
If <paramref name="url" /> is <c>null</c>.
<para>-or-</para><para>If <paramref name="content" /> is <c>null</c>.</para></exception>
<exception cref="T:System.ArgumentOutOfRangeException">
If <paramref name="bufferSize" /> is less than or equal to zero.
<para>-or-</para><para>If <paramref name="maxReadLength" /> is less than zero.</para></exception>
<exception cref="T:System.NotSupportedException">If <paramref name="method" /> is not supported by the service.</exception>
</member>
<member name="T:JSIStudios.SimpleRESTServices.Client.Json.JsonStringSerializer">
<summary>
Provides a default implementation of <see cref="T:JSIStudios.SimpleRESTServices.Client.IStringSerializer" /> using JSON for
Expand Down
4 changes: 2 additions & 2 deletions src/testing/integration/integration.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\SSH.NET.2013.4.7\lib\net40\Renci.SshNet.dll</HintPath>
</Reference>
<Reference Include="SimpleRESTServices, Version=1.1.2.0, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="SimpleRESTServices, Version=1.1.3.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\SimpleRESTServices.1.1.2.0\lib\net40\SimpleRESTServices.dll</HintPath>
<HintPath>..\..\packages\SimpleRESTServices.1.1.3.0\lib\net40\SimpleRESTServices.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
Expand Down
2 changes: 1 addition & 1 deletion src/testing/integration/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<packages>
<package id="Moq" version="4.0.10827" targetFramework="net40" />
<package id="Newtonsoft.Json" version="5.0.6" targetFramework="net40" />
<package id="SimpleRESTServices" version="1.1.2.0" targetFramework="net40" />
<package id="SimpleRESTServices" version="1.1.3.0" targetFramework="net40" />
<package id="SSH.NET" version="2013.4.7" targetFramework="net40" />
</packages>
2 changes: 1 addition & 1 deletion src/testing/unit/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
<packages>
<package id="Moq" version="4.0.10827" targetFramework="net40" />
<package id="Newtonsoft.Json" version="5.0.6" targetFramework="net40" />
<package id="SimpleRESTServices" version="1.1.2.0" targetFramework="net40" />
<package id="SimpleRESTServices" version="1.1.3.0" targetFramework="net40" />
</packages>
4 changes: 2 additions & 2 deletions src/testing/unit/unit.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Newtonsoft.Json.5.0.6\lib\net40\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="SimpleRESTServices, Version=1.1.2.0, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="SimpleRESTServices, Version=1.1.3.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\SimpleRESTServices.1.1.2.0\lib\net40\SimpleRESTServices.dll</HintPath>
<HintPath>..\..\packages\SimpleRESTServices.1.1.3.0\lib\net40\SimpleRESTServices.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
Expand Down