Skip to content

Commit 90cd373

Browse files
committed
Merge pull request #202 from sharwell/default-regions
Default regions
2 parents ec85a83 + 6cacad8 commit 90cd373

File tree

7 files changed

+219
-110
lines changed

7 files changed

+219
-110
lines changed

src/corelib/Providers/Rackspace/CloudBlockStorageProvider.cs

Lines changed: 37 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -62,80 +62,94 @@ public class CloudBlockStorageProvider : ProviderBase<IBlockStorageProvider>, IB
6262

6363
/// <summary>
6464
/// Initializes a new instance of the <see cref="CloudFilesProvider"/> class with
65-
/// no default identity, and the default identity provider and REST service implementation.
65+
/// no default identity or region, and the default identity provider and REST
66+
/// service implementation.
6667
/// </summary>
6768
public CloudBlockStorageProvider()
68-
: this(null, null, null) { }
69+
: this(null, null, null, null) { }
6970

7071
/// <summary>
7172
/// Initializes a new instance of the <see cref="CloudFilesProvider"/> class with
72-
/// the specified default identity, and the default identity provider and REST service
73-
/// implementation.
73+
/// the specified default identity, no default region, and the default identity
74+
/// provider and REST service implementation.
7475
/// </summary>
7576
/// <param name="identity">The default identity to use for calls that do not explicitly specify an identity. If this value is <c>null</c>, no default identity is available so all calls must specify an explicit identity.</param>
7677
public CloudBlockStorageProvider(CloudIdentity identity)
77-
: this(identity, null, null) { }
78+
: this(identity, null, null, null) { }
7879

7980
/// <summary>
8081
/// Initializes a new instance of the <see cref="CloudFilesProvider"/> class with
81-
/// no default identity, the default identity provider, and the specified REST service
82-
/// implementation.
82+
/// no default identity or region, the default identity provider, and the specified
83+
/// REST service implementation.
8384
/// </summary>
8485
/// <param name="restService">The implementation of <see cref="IRestService"/> to use for executing REST requests. If this value is <c>null</c>, the provider will use a new instance of <see cref="JsonRestServices"/>.</param>
8586
public CloudBlockStorageProvider(IRestService restService)
86-
: this(null, restService) { }
87+
: this(null, null, null, restService) { }
8788

8889
/// <summary>
8990
/// Initializes a new instance of the <see cref="CloudFilesProvider"/> class with
90-
/// no default identity, the specified identity provider, and the default REST service
91-
/// implementation.
91+
/// no default identity or region, the specified identity provider, and the default
92+
/// REST service implementation.
9293
/// </summary>
9394
/// <param name="identityProvider">The identity provider to use for authenticating requests to this provider. If this value is <c>null</c>, a new instance of <see cref="CloudIdentityProvider"/> is created with no default identity.</param>
9495
public CloudBlockStorageProvider(IIdentityProvider identityProvider)
95-
: this(null, identityProvider, null) { }
96+
: this(null, null, identityProvider, null) { }
9697

9798
/// <summary>
9899
/// Initializes a new instance of the <see cref="CloudFilesProvider"/> class with
99-
/// the specified default identity and identity provider, and the default REST service
100-
/// implementation.
100+
/// the specified default identity and identity provider, no default region, and
101+
/// the default REST service implementation.
101102
/// </summary>
102103
/// <param name="identity">The default identity to use for calls that do not explicitly specify an identity. If this value is <c>null</c>, no default identity is available so all calls must specify an explicit identity.</param>
103104
/// <param name="identityProvider">The identity provider to use for authenticating requests to this provider. If this value is <c>null</c>, a new instance of <see cref="CloudIdentityProvider"/> is created using <paramref name="identity"/> as the default identity.</param>
104105
public CloudBlockStorageProvider(CloudIdentity identity, IIdentityProvider identityProvider)
105-
: this(identity, identityProvider, null) { }
106+
: this(identity, null, identityProvider, null) { }
106107

107108
/// <summary>
108109
/// Initializes a new instance of the <see cref="CloudFilesProvider"/> class with
109-
/// the specified default identity and REST service implementation, and the default
110-
/// identity provider.
110+
/// the specified default identity and REST service implementation, no default region,
111+
/// and the default identity provider.
111112
/// </summary>
112113
/// <param name="identity">The default identity to use for calls that do not explicitly specify an identity. If this value is <c>null</c>, no default identity is available so all calls must specify an explicit identity.</param>
113114
/// <param name="restService">The implementation of <see cref="IRestService"/> to use for executing REST requests. If this value is <c>null</c>, the provider will use a new instance of <see cref="JsonRestServices"/>.</param>
114115
public CloudBlockStorageProvider(CloudIdentity identity, IRestService restService)
115-
: this(identity, null, restService) { }
116+
: this(identity, null, null, restService) { }
116117

117118
/// <summary>
118119
/// Initializes a new instance of the <see cref="CloudFilesProvider"/> class with
119-
/// the specified default identity, identity provider, and REST service implementation.
120+
/// the specified default identity, no default region, and the specified identity
121+
/// provider and REST service implementation.
120122
/// </summary>
121123
/// <param name="identity">The default identity to use for calls that do not explicitly specify an identity. If this value is <c>null</c>, no default identity is available so all calls must specify an explicit identity.</param>
122124
/// <param name="identityProvider">The identity provider to use for authenticating requests to this provider. If this value is <c>null</c>, a new instance of <see cref="CloudIdentityProvider"/> is created using <paramref name="identity"/> as the default identity.</param>
123125
/// <param name="restService">The implementation of <see cref="IRestService"/> to use for executing REST requests. If this value is <c>null</c>, the provider will use a new instance of <see cref="JsonRestServices"/>.</param>
124126
public CloudBlockStorageProvider(CloudIdentity identity, IIdentityProvider identityProvider, IRestService restService)
125-
: this(identity, identityProvider, restService, CloudBlockStorageValidator.Default) { }
127+
: this(identity, null, identityProvider, restService) { }
126128

127129
/// <summary>
128130
/// Initializes a new instance of the <see cref="CloudFilesProvider"/> class with
129-
/// no default identity, and the default identity provider, REST service implementation,
130-
/// and block storage validator.
131+
/// the specified default identity, default region, identity provider, and REST service implementation.
131132
/// </summary>
132133
/// <param name="identity">The default identity to use for calls that do not explicitly specify an identity. If this value is <c>null</c>, no default identity is available so all calls must specify an explicit identity.</param>
134+
/// <param name="defaultRegion">The default region to use for calls that do not explicitly specify a region. If this value is <c>null</c>, the default region for the user will be used; otherwise if the service uses region-specific endpoints all calls must specify an explicit region.</param>
135+
/// <param name="identityProvider">The identity provider to use for authenticating requests to this provider. If this value is <c>null</c>, a new instance of <see cref="CloudIdentityProvider"/> is created using <paramref name="identity"/> as the default identity.</param>
136+
/// <param name="restService">The implementation of <see cref="IRestService"/> to use for executing REST requests. If this value is <c>null</c>, the provider will use a new instance of <see cref="JsonRestServices"/>.</param>
137+
public CloudBlockStorageProvider(CloudIdentity identity, string defaultRegion, IIdentityProvider identityProvider, IRestService restService)
138+
: this(identity, defaultRegion, identityProvider, restService, CloudBlockStorageValidator.Default) { }
139+
140+
/// <summary>
141+
/// Initializes a new instance of the <see cref="CloudFilesProvider"/> class with
142+
/// the specified default identity, default region, identity provider, REST service
143+
/// implementation, and block storage validator.
144+
/// </summary>
145+
/// <param name="identity">The default identity to use for calls that do not explicitly specify an identity. If this value is <c>null</c>, no default identity is available so all calls must specify an explicit identity.</param>
146+
/// <param name="defaultRegion">The default region to use for calls that do not explicitly specify a region. If this value is <c>null</c>, the default region for the user will be used; otherwise if the service uses region-specific endpoints all calls must specify an explicit region.</param>
133147
/// <param name="identityProvider">The identity provider to use for authenticating requests to this provider. If this value is <c>null</c>, a new instance of <see cref="CloudIdentityProvider"/> is created with no default identity.</param>
134148
/// <param name="restService">The implementation of <see cref="IRestService"/> to use for executing REST requests. If this value is <c>null</c>, the provider will use a new instance of <see cref="JsonRestServices"/>.</param>
135149
/// <param name="cloudBlockStorageValidator">The <see cref="IBlockStorageValidator"/> to use for validating requests to this service.</param>
136150
/// <exception cref="ArgumentNullException">If <paramref name="cloudBlockStorageValidator"/> is <c>null</c>.</exception>
137-
internal CloudBlockStorageProvider(CloudIdentity identity, IIdentityProvider identityProvider, IRestService restService, IBlockStorageValidator cloudBlockStorageValidator)
138-
: base(identity, identityProvider, restService)
151+
internal CloudBlockStorageProvider(CloudIdentity identity, string defaultRegion, IIdentityProvider identityProvider, IRestService restService, IBlockStorageValidator cloudBlockStorageValidator)
152+
: base(identity, defaultRegion, identityProvider, restService)
139153
{
140154
if (cloudBlockStorageValidator == null)
141155
throw new ArgumentNullException("cloudBlockStorageValidator");

0 commit comments

Comments
 (0)