[KEYCLOAK-19102] Replace usages of deprecated setAllowNull(boolean) calls in the adapters subsystems with setRequired(boolean)

- WildFly will remove deprecated APIs, code needs to be changed before the next WildFly upgrade.
This commit is contained in:
Stefan Guilhen 2021-09-21 12:18:25 -03:00 committed by Hynek Mlnařík
parent 10e425315f
commit 271033c3a4
7 changed files with 11 additions and 11 deletions

View file

@ -60,25 +60,25 @@ public class IdentityProviderDefinition extends SimpleResourceDefinition {
private static final ObjectTypeAttributeDefinition SINGLE_SIGN_ON = private static final ObjectTypeAttributeDefinition SINGLE_SIGN_ON =
ObjectTypeAttributeDefinition.Builder.of(Constants.Model.SINGLE_SIGN_ON, ObjectTypeAttributeDefinition.Builder.of(Constants.Model.SINGLE_SIGN_ON,
SingleSignOnDefinition.ATTRIBUTES) SingleSignOnDefinition.ATTRIBUTES)
.setAllowNull(false) .setRequired(true)
.build(); .build();
private static final ObjectTypeAttributeDefinition SINGLE_LOGOUT = private static final ObjectTypeAttributeDefinition SINGLE_LOGOUT =
ObjectTypeAttributeDefinition.Builder.of(Constants.Model.SINGLE_LOGOUT, ObjectTypeAttributeDefinition.Builder.of(Constants.Model.SINGLE_LOGOUT,
SingleLogoutDefinition.ATTRIBUTES) SingleLogoutDefinition.ATTRIBUTES)
.setAllowNull(false) .setRequired(true)
.build(); .build();
private static final ObjectTypeAttributeDefinition ALLOWED_CLOCK_SKEW = private static final ObjectTypeAttributeDefinition ALLOWED_CLOCK_SKEW =
ObjectTypeAttributeDefinition.Builder.of(Constants.Model.ALLOWED_CLOCK_SKEW, ObjectTypeAttributeDefinition.Builder.of(Constants.Model.ALLOWED_CLOCK_SKEW,
AllowedClockSkew.ATTRIBUTES) AllowedClockSkew.ATTRIBUTES)
.setAllowNull(true) .setRequired(false)
.build(); .build();
private static final ObjectTypeAttributeDefinition HTTP_CLIENT = private static final ObjectTypeAttributeDefinition HTTP_CLIENT =
ObjectTypeAttributeDefinition.Builder.of(Constants.Model.HTTP_CLIENT, ObjectTypeAttributeDefinition.Builder.of(Constants.Model.HTTP_CLIENT,
HttpClientDefinition.ATTRIBUTES) HttpClientDefinition.ATTRIBUTES)
.setAllowNull(true) .setRequired(false)
.build(); .build();
static final SimpleAttributeDefinition[] ATTRIBUTES = {SIGNATURES_REQUIRED, SIGNATURE_ALGORITHM, SIGNATURE_CANONICALIZATION_METHOD, METADATA_URL}; static final SimpleAttributeDefinition[] ATTRIBUTES = {SIGNATURES_REQUIRED, SIGNATURE_ALGORITHM, SIGNATURE_CANONICALIZATION_METHOD, METADATA_URL};

View file

@ -64,7 +64,7 @@ public class KeyDefinition extends SimpleResourceDefinition {
static final ObjectTypeAttributeDefinition KEY_STORE = static final ObjectTypeAttributeDefinition KEY_STORE =
ObjectTypeAttributeDefinition.Builder.of(Constants.Model.KEY_STORE, ObjectTypeAttributeDefinition.Builder.of(Constants.Model.KEY_STORE,
KeyStoreDefinition.ALL_ATTRIBUTES) KeyStoreDefinition.ALL_ATTRIBUTES)
.setAllowNull(true) .setRequired(false)
.build(); .build();
static final SimpleAttributeDefinition[] ATTRIBUTES = {SIGNING, ENCRYPTION}; static final SimpleAttributeDefinition[] ATTRIBUTES = {SIGNING, ENCRYPTION};

View file

@ -93,7 +93,7 @@ public class ServiceProviderDefinition extends SimpleResourceDefinition {
static final ListAttributeDefinition ROLE_ATTRIBUTES = static final ListAttributeDefinition ROLE_ATTRIBUTES =
new StringListAttributeDefinition.Builder(Constants.Model.ROLE_ATTRIBUTES) new StringListAttributeDefinition.Builder(Constants.Model.ROLE_ATTRIBUTES)
.setAllowNull(true) .setRequired(false)
.build(); .build();
static final SimpleAttributeDefinition ROLE_MAPPINGS_PROVIDER_ID = static final SimpleAttributeDefinition ROLE_MAPPINGS_PROVIDER_ID =

View file

@ -27,6 +27,6 @@ public class ModulesListAttributeBuilder extends StringListAttributeDefinition.B
public ModulesListAttributeBuilder() { public ModulesListAttributeBuilder() {
super("modules"); super("modules");
setAllowExpression(true); setAllowExpression(true);
setAllowNull(true); setRequired(false);
} }
} }

View file

@ -31,7 +31,7 @@ public class ProvidersListAttributeBuilder extends StringListAttributeDefinition
provider.add("classpath:${jboss.home.dir}/providers/*"); provider.add("classpath:${jboss.home.dir}/providers/*");
this.defaultValue = provider; this.defaultValue = provider;
setAllowExpression(true); setAllowExpression(true);
setAllowNull(true); setRequired(false);
} }
} }

View file

@ -39,7 +39,7 @@ public class ProviderResourceDefinition extends SimpleResourceDefinition {
new SimpleAttributeDefinitionBuilder("enabled", ModelType.BOOLEAN, true) new SimpleAttributeDefinitionBuilder("enabled", ModelType.BOOLEAN, true)
.setAllowExpression(true) .setAllowExpression(true)
.setDefaultValue(new ModelNode(true)) .setDefaultValue(new ModelNode(true))
.setAllowNull(false) .setRequired(true)
.setRestartAllServices() .setRestartAllServices()
.build(); .build();

View file

@ -58,7 +58,7 @@ public class ThemeResourceDefinition extends SimpleResourceDefinition {
new SimpleAttributeDefinitionBuilder("cacheThemes", ModelType.BOOLEAN, true) new SimpleAttributeDefinitionBuilder("cacheThemes", ModelType.BOOLEAN, true)
.setAllowExpression(true) .setAllowExpression(true)
.setDefaultValue(new ModelNode(true)) .setDefaultValue(new ModelNode(true))
.setAllowNull(false) .setRequired(true)
.setRestartAllServices() .setRestartAllServices()
.build(); .build();
@ -66,7 +66,7 @@ public class ThemeResourceDefinition extends SimpleResourceDefinition {
new SimpleAttributeDefinitionBuilder("cacheTemplates", ModelType.BOOLEAN, true) new SimpleAttributeDefinitionBuilder("cacheTemplates", ModelType.BOOLEAN, true)
.setAllowExpression(true) .setAllowExpression(true)
.setDefaultValue(new ModelNode(true)) .setDefaultValue(new ModelNode(true))
.setAllowNull(false) .setRequired(true)
.setRestartAllServices() .setRestartAllServices()
.build(); .build();