Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WFLY-19078 [Community] - Update the elytron-oidc-client subsystem par…
…ser to enumerate schema versions
- Loading branch information
1 parent
6308993
commit 8988494
Showing
27 changed files
with
1,970 additions
and
543 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
33 changes: 33 additions & 0 deletions
33
...ent/src/main/java/org/wildfly/extension/elytron/oidc/ElytronOidcClientSubsystemModel.java
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,33 @@ | ||
/* | ||
* Copyright The WildFly Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.wildfly.extension.elytron.oidc; | ||
|
||
import org.jboss.as.controller.ModelVersion; | ||
import org.jboss.as.controller.SubsystemModel; | ||
|
||
/** | ||
* Enumeration of elytron-oidc-client subsystem model versions. | ||
* @author <a href="mailto:prpaul@redhat.com">Prarthona Paul</a> | ||
*/ | ||
|
||
enum ElytronOidcClientSubsystemModel implements SubsystemModel { | ||
VERSION_1_0_0(1, 0, 0), | ||
VERSION_2_0_0(2, 0, 0), | ||
VERSION_3_0_0_COMMUNITY(3, 0, 0), | ||
; | ||
static final ElytronOidcClientSubsystemModel CURRENT = VERSION_2_0_0; | ||
|
||
private final ModelVersion version; | ||
|
||
ElytronOidcClientSubsystemModel(int major, int minor, int micro) { | ||
this.version = ModelVersion.create(major, minor, micro); | ||
} | ||
|
||
@Override | ||
public ModelVersion getVersion() { | ||
return this.version; | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
...src/main/java/org/wildfly/extension/elytron/oidc/ElytronOidcClientSubsystemRegistrar.java
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,38 @@ | ||
/* | ||
* Copyright The WildFly Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.wildfly.extension.elytron.oidc; | ||
|
||
import org.jboss.as.controller.PathElement; | ||
import org.jboss.as.controller.ResourceDefinition; | ||
import org.jboss.as.controller.ResourceRegistration; | ||
import org.jboss.as.controller.SubsystemRegistration; | ||
import org.jboss.as.controller.descriptions.ParentResourceDescriptionResolver; | ||
import org.jboss.as.controller.descriptions.SubsystemResourceDescriptionResolver; | ||
import org.jboss.as.controller.registry.ManagementResourceRegistration; | ||
import org.wildfly.subsystem.resource.ManagementResourceRegistrar; | ||
import org.wildfly.subsystem.resource.ManagementResourceRegistrationContext; | ||
import org.wildfly.subsystem.resource.ResourceDescriptor; | ||
import org.wildfly.subsystem.resource.SubsystemResourceDefinitionRegistrar; | ||
|
||
/** | ||
* @author <a href="mailto:prpaul@redhat.com">Prarthona Paul</a> | ||
*/ | ||
|
||
public class ElytronOidcClientSubsystemRegistrar implements SubsystemResourceDefinitionRegistrar { | ||
|
||
static final String NAME = "elytron-oidc-client"; | ||
static final PathElement PATH = SubsystemResourceDefinitionRegistrar.pathElement(NAME); | ||
static final ParentResourceDescriptionResolver RESOLVER = new SubsystemResourceDescriptionResolver(NAME, ElytronOidcClientSubsystemRegistrar.class); | ||
|
||
@Override | ||
public ManagementResourceRegistration register(SubsystemRegistration parent, ManagementResourceRegistrationContext context) { | ||
parent.setHostCapable(); | ||
ManagementResourceRegistration registration = parent.registerSubsystemModel(ResourceDefinition.builder(ResourceRegistration.of(PATH), RESOLVER).build()); | ||
ResourceDescriptor descriptor = ResourceDescriptor.builder(RESOLVER).build(); | ||
ManagementResourceRegistrar.of(descriptor).register(registration); | ||
return registration; | ||
} | ||
} |
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
Oops, something went wrong.