Skip to content
This repository was archived by the owner on Dec 12, 2018. It is now read-only.

Commit 8c81dcc

Browse files
committed
Merge remote-tracking branch 'origin/1.3.x' into 1.3.x
2 parents af83c15 + 94925b3 commit 8c81dcc

File tree

117 files changed

+4797
-121
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+4797
-121
lines changed

api/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<parent>
2222
<groupId>com.stormpath.sdk</groupId>
2323
<artifactId>stormpath-sdk-root</artifactId>
24-
<version>1.2.1-SNAPSHOT</version>
24+
<version>1.2.2-SNAPSHOT</version>
2525
<relativePath>../pom.xml</relativePath>
2626
</parent>
2727

api/src/main/java/com/stormpath/sdk/application/ApplicationOptions.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,14 @@ public interface ApplicationOptions<T> extends AccountStoreOptions<T> {
7979
* @since 1.0.0
8080
*/
8181
T withWebConfig();
82+
83+
/**
84+
* Ensures that when retrieving an Application, the Application's {@link Application#getSamlPolicy() samlPolicy}
85+
* is also retrieved in the same request. This enhances performance by leveraging a single request to retrieve multiple
86+
* related resources you know you will use.
87+
*
88+
* @return this instance for method chaining.
89+
* @since 1.3.0
90+
*/
91+
T withSamlPolicy();
8292
}

api/src/main/java/com/stormpath/sdk/lang/Strings.java

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
package com.stormpath.sdk.lang;
1717

1818
import java.nio.charset.Charset;
19+
import java.nio.charset.StandardCharsets;
1920
import java.util.ArrayList;
2021
import java.util.Arrays;
2122
import java.util.Collection;
@@ -1264,4 +1265,34 @@ public static String arrayToCommaDelimitedString(Object[] arr) {
12641265
return arrayToDelimitedString(arr, ",");
12651266
}
12661267

1268+
/**
1269+
* Calls {@link String#getBytes(Charset)}
1270+
*
1271+
* @param string The string to encode (if null, return null).
1272+
* @param charset The {@link Charset} to encode the <code>String</code>
1273+
* @return the encoded bytes
1274+
* @since 1.2.1
1275+
*/
1276+
private static byte[] getBytes(final String string, final Charset charset) {
1277+
if (string == null) {
1278+
return null;
1279+
}
1280+
return string.getBytes(charset);
1281+
}
1282+
1283+
/**
1284+
* Encodes the given string into a sequence of bytes using the UTF-8 charset, storing the result into a new byte
1285+
* array.
1286+
*
1287+
* @param string the String to encode, may be <code>null</code>
1288+
* @return encoded bytes, or <code>null</code> if the input string was <code>null</code>
1289+
* @throws NullPointerException Thrown if {@link StandardCharsets#UTF_8} is not initialized, which should never happen since it is
1290+
* required by the Java platform specification.
1291+
* @see <a href="http://download.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html">Standard charsets</a>
1292+
* @since 1.2.1
1293+
*/
1294+
public static byte[] getBytesUtf8(final String string) {
1295+
return getBytes(string, StandardCharsets.UTF_8);
1296+
}
1297+
12671298
}

api/src/main/java/com/stormpath/sdk/phone/Phone.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public interface Phone extends Resource, Saveable, Deletable, Auditable {
5252

5353
/**
5454
* Sets the phone's name.
55-
* @param name he phone's name.
55+
* @param name the phone's name.
5656
*
5757
* @return this instance for method chaining.
5858
*/
@@ -67,7 +67,7 @@ public interface Phone extends Resource, Saveable, Deletable, Auditable {
6767

6868
/**
6969
* Sets the phone's description.
70-
* @param description he phone's description.
70+
* @param description the phone's description.
7171
*
7272
* @return this instance for method chaining.
7373
*/

api/src/main/java/com/stormpath/sdk/phone/Phones.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ public static EqualsExpressionFactory verificationStatus() {
229229
* Phones.where(<b>Phones.createdAt()</b>.matches("[,2014-04-05T12:00:00]");
230230
* </pre>
231231
* The above example invokes the returned factory's <code>matches("[,2014-04-05T12:00:00]"))</code> method. This
232-
* produces a name-specific {@link Criterion} which is added to the criteria query (via the
232+
* produces a createdAt-specific {@link Criterion} which is added to the criteria query (via the
233233
* {@link #where(Criterion) where} method).
234234
* <pre>
235235
* For example, the following code is equivalent:
@@ -254,7 +254,7 @@ public static DateExpressionFactory createdAt(){
254254
* Phones.where(<b>Phones.modifiedAt()</b>.matches("[,2014-04-05T12:00:00]");
255255
* </pre>
256256
* The above example invokes the returned factory's <code>matches("[,2014-04-05T12:00:00]"))</code> method. This
257-
* produces a name-specific {@link Criterion} which is added to the criteria query (via the
257+
* produces a modifiedAt-specific {@link Criterion} which is added to the criteria query (via the
258258
* {@link #where(Criterion) where} method).
259259
* <pre>
260260
* For example, the following code is equivalent:
@@ -279,12 +279,12 @@ private static DateExpressionFactory newDateExpressionFactory(String propName) {
279279
}
280280

281281
/**
282-
* Creates a new {@link com.stormpath.sdk.phone.CreatePhoneRequestBuilder CreatePhoneRequestBuilder}
282+
* Creates a new {@link com.stormpath.sdk.phone.CreatePhoneRequestBuilder createPhoneRequestBuilder}
283283
* instance reflecting the specified {@link com.stormpath.sdk.phone.Phone} instance. The builder can be used to customize any
284284
* creation request options as necessary.
285285
*
286286
* @param phone the phone to create a new record for within Stormpath
287-
* @return a new {@link com.stormpath.sdk.phone.CreatePhoneRequestBuilder CreatePhoneRequestBuilder}
287+
* @return a new {@link com.stormpath.sdk.phone.CreatePhoneRequestBuilder createPhoneRequestBuilder}
288288
* instance reflecting the specified {@link com.stormpath.sdk.phone.Phone} instance.
289289
** @see com.stormpath.sdk.account.Account#createPhone(CreatePhoneRequest)
290290
*

api/src/main/java/com/stormpath/sdk/saml/AttributeStatementMappingRules.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515
*/
1616
package com.stormpath.sdk.saml;
1717

18+
import com.stormpath.sdk.resource.Deletable;
1819
import com.stormpath.sdk.resource.Resource;
20+
import com.stormpath.sdk.resource.Saveable;
1921

20-
import java.util.Collection;
2122
import java.util.Set;
2223

2324
/**
@@ -31,7 +32,7 @@
3132
*
3233
* @since 1.0.RC8
3334
*/
34-
public interface AttributeStatementMappingRules extends Resource, Set<AttributeStatementMappingRule> {
35+
public interface AttributeStatementMappingRules extends Resource, Set<AttributeStatementMappingRule>, Saveable, Deletable{
3536

3637
/**
3738
* Removes the {@link AttributeStatementMappingRule}(s) identified by {@code ruleNames}.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*
2+
* Copyright 2016 Stormpath, Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.stormpath.sdk.saml;
17+
18+
19+
/**
20+
* Represents an attempt to create a new {@link RegisteredSamlServiceProvider} record in Stormpath.
21+
*
22+
* @see com.stormpath.sdk.tenant.Tenant#createRegisterdSamlServiceProvider(RegisteredSamlServiceProvider)
23+
* @since 1.3.0
24+
*/
25+
public interface CreateRegisteredSamlServiceProviderRequest {
26+
27+
/**
28+
* Returns the RegisteredSamlServiceProvider instance for which a new record will be created in Stormpath.
29+
*
30+
* @return the RegisteredSamlServiceProvider instance for which a new record will be created in Stormpath.
31+
*/
32+
RegisteredSamlServiceProvider getRegisteredSamlServiceProvider();
33+
34+
/**
35+
* Returns true in case RegisteredSamlServiceProvider has options.
36+
*
37+
* @return true in case RegisteredSamlServiceProvider has options.
38+
*/
39+
boolean hasRegisteredSamlServiceProviderOptions();
40+
41+
/**
42+
* Returns the {@link RegisteredSamlServiceProviderOptions}.
43+
*
44+
* @return {@link RegisteredSamlServiceProviderOptions}.
45+
*/
46+
RegisteredSamlServiceProviderOptions getRegisteredSamlServiceProviderOptions() throws IllegalStateException;
47+
48+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* Copyright 2016 Stormpath, Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.stormpath.sdk.saml;
17+
18+
/**
19+
* A Builder to construct {@link CreateRegisteredSamlServiceProviderRequest}s.
20+
*
21+
* @see com.stormpath.sdk.tenant.Tenant#createRegisterdSamlServiceProvider(RegisteredSamlServiceProvider)
22+
* @since 1.3.0
23+
*/
24+
public interface CreateRegisteredSamlServiceProviderRequestBuilder {
25+
26+
/**
27+
* Ensures that after a RegisteredSamlServiceProvider is created, the creation response is retrieved with the specified registeredSamlServiceProvider's
28+
* options. This enhances performance by leveraging a single request to retrieve multiple related
29+
* resources you know you will use.
30+
*
31+
* @return the builder instance for method chaining.
32+
* @throws IllegalArgumentException if {@code options} is null.
33+
*/
34+
CreateRegisteredSamlServiceProviderRequestBuilder withResponseOptions(RegisteredSamlServiceProviderOptions options) throws IllegalArgumentException;
35+
36+
/**
37+
* Creates a new {@code CreateRegisteredSamlServiceProviderRequest} instance based on the current builder state.
38+
*
39+
* @return a new {@code CreateRegisteredSamlServiceProviderRequest} instance based on the current builder state.
40+
*/
41+
CreateRegisteredSamlServiceProviderRequest build();
42+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*
2+
* Copyright 2016 Stormpath, Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.stormpath.sdk.saml;
17+
18+
19+
/**
20+
* Represents an attempt to create a new {@link SamlServiceProviderRegistration} record in Stormpath.
21+
*
22+
* @see com.stormpath.sdk.saml.SamlIdentityProvider#createSamlServiceProviderRegistration(CreateSamlServiceProviderRegistrationRequest)
23+
* @since 1.3.0
24+
*/
25+
public interface CreateSamlServiceProviderRegistrationRequest {
26+
27+
/**
28+
* Returns the SamlServiceProviderRegistration instance for which a new record will be created in Stormpath.
29+
*
30+
* @return the SamlServiceProviderRegistration instance for which a new record will be created in Stormpath.
31+
*/
32+
SamlServiceProviderRegistration getSamlServiceProviderRegistration();
33+
34+
/**
35+
* Returns true in case SamlServiceProviderRegistration has options.
36+
*
37+
* @return true in case SamlServiceProviderRegistration has options.
38+
*/
39+
boolean hasSamlServiceProviderRegistrationOptions();
40+
41+
/**
42+
* Returns the {@link SamlServiceProviderRegistrationOptions}.
43+
*
44+
* @return {@link SamlServiceProviderRegistrationOptions}.
45+
*/
46+
SamlServiceProviderRegistrationOptions getSamlServiceProviderRegistrationOptions() throws IllegalStateException;
47+
48+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* Copyright 2016 Stormpath, Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.stormpath.sdk.saml;
17+
18+
/**
19+
* A Builder to construct {@link CreateSamlServiceProviderRegistrationRequest}s.
20+
*
21+
* @see com.stormpath.sdk.saml.SamlIdentityProvider#createSamlServiceProviderRegistration(CreateSamlServiceProviderRegistrationRequest)
22+
* @since 1.3.0
23+
*/
24+
public interface CreateSamlServiceProviderRegistrationRequestBuilder {
25+
26+
/**
27+
* Ensures that after a SamlServiceProviderRegistration is created, the creation response is retrieved with the specified samlServiceProviderRegistration's
28+
* options. This enhances performance by leveraging a single request to retrieve multiple related
29+
* resources you know you will use.
30+
*
31+
* @return the builder instance for method chaining.
32+
* @throws IllegalArgumentException if {@code options} is null.
33+
*/
34+
CreateSamlServiceProviderRegistrationRequestBuilder withResponseOptions(SamlServiceProviderRegistrationOptions options) throws IllegalArgumentException;
35+
36+
/**
37+
* Creates a new {@code CreateSamlServiceProviderRegistrationRequest} instance based on the current builder state.
38+
*
39+
* @return a new {@code CreateSamlServiceProviderRegistrationRequest} instance based on the current builder state.
40+
*/
41+
CreateSamlServiceProviderRegistrationRequest build();
42+
}

0 commit comments

Comments
 (0)