@Override public Integer getManagementInterfaceMinorVersion() { return version != null ? version.getMinor() : null; }
@Override public Integer getManagementInterfaceMinorVersion() { return version != null ? version.getMinor() : null; }
@Override public boolean isIgnoredResourceListAvailableAtRegistration() { return version.getMajor() >= 1 && version.getMinor() >= 4; } }
@Override public boolean isIgnoredResourceListAvailableAtRegistration() { return version.getMajor() >= 1 && version.getMinor() >= 4; }
@Override public boolean isIgnoredResourceListAvailableAtRegistration() { return version.getMajor() >= 1 && version.getMinor() >= 4; }
@Override public boolean isIgnoredResourceListAvailableAtRegistration() { return version.getMajor() >= 1 && version.getMinor() >= 4; }
private static File getDmrFile(KernelServices kernelServices, ModelVersion modelVersion, String mainSubsystemName) { File file = determineTestClassesDirectory(); for (String part : kernelServices.getTestClass().getPackage().getName().split("\\.")) { file = new File(file, part); if (!file.exists()) { file.mkdir(); } } return new File(file, mainSubsystemName + "-" + modelVersion.getMajor() + "." + modelVersion.getMinor() + "." + modelVersion.getMicro() + ".dmr"); }
private static File getDmrFile(KernelServices kernelServices, ModelVersion modelVersion, String mainSubsystemName) { File file = determineTestClassesDirectory(); for (String part : kernelServices.getTestClass().getPackage().getName().split("\\.")) { file = new File(file, part); if (!file.exists()) { file.mkdir(); } } return new File(file, mainSubsystemName + "-" + modelVersion.getMajor() + "." + modelVersion.getMinor() + "." + modelVersion.getMicro() + ".dmr"); }
private static ModelNode getSubsystemDefinitionForVersion(final Class<?> classForDmrPackage, final String subsystemName, ModelVersion version) { StringBuilder key = new StringBuilder(subsystemName).append("-").append(version.getMajor()).append(".").append(version.getMinor()); key.append('.').append(version.getMicro()).append(".dmr"); InputStream is = null; try { is = classForDmrPackage.getResourceAsStream(key.toString()); if (is == null) { return null; } return ModelNode.fromStream(is); } catch (IOException e) { ControllerLogger.ROOT_LOGGER.cannotReadTargetDefinition(e); } finally { if (is != null) { try { is.close(); } catch (IOException e) { // } } } return null; }
public static ModelNode getSubsystemDefinitionForVersion(final String subsystemName, ModelVersion version) { StringBuilder key = new StringBuilder(subsystemName).append("-").append(version.getMajor()).append(".").append(version.getMinor()); key.append('.').append(version.getMicro()).append(".dmr"); InputStream is = null; try { is = TransformerRegistry.class.getResourceAsStream(key.toString()); if (is == null) { return null; } return ModelNode.fromStream(is); } catch (IOException e) { ControllerLogger.ROOT_LOGGER.cannotReadTargetDefinition(e); } finally { if (is != null) { try { is.close(); } catch (IOException e) { // } } } return null; }
public static ModelNode getSubsystemDefinitionForVersion(final Class<?> classForDmrPackage, final String subsystemName, ModelVersion version) { StringBuilder key = new StringBuilder(subsystemName).append("-").append(version.getMajor()).append(".").append(version.getMinor()); key.append('.').append(version.getMicro()).append(".dmr"); InputStream is = null; try { is = classForDmrPackage.getResourceAsStream(key.toString()); if (is == null) { return null; } return ModelNode.fromStream(is); } catch (IOException e) { ControllerLogger.ROOT_LOGGER.cannotReadTargetDefinition(e); } finally { if (is != null) { try { is.close(); } catch (IOException e) { // } } } return null; }
private static ModelNode getSubsystemDefinitionForVersion(final Class<?> classForDmrPackage, final String subsystemName, ModelVersion version) { StringBuilder key = new StringBuilder(subsystemName).append("-").append(version.getMajor()).append(".").append(version.getMinor()); key.append('.').append(version.getMicro()).append(".dmr"); InputStream is = null; try { is = classForDmrPackage.getResourceAsStream(key.toString()); if (is == null) { return null; } return ModelNode.fromStream(is); } catch (IOException e) { ControllerLogger.ROOT_LOGGER.cannotReadTargetDefinition(e); } finally { if (is != null) { try { is.close(); } catch (IOException e) { // } } } return null; }
private void removeDefaultAttributesWronglyShowingInRecursiveReadResource(ModelVersion modelVersion, KernelServices legacyServices, ModelNode legacyModel) { if (modelVersion.getMajor() == 1 && modelVersion.getMinor() < 4) { //Work around known problem where the recursice :read-resource on legacy controllers in ModelVersion < 1.4.0 //incorrectly does not propagate include-defaults=true when recursing //https://issues.jboss.org/browse/AS7-6077 checkAttributeIsActuallyDefinedAndReplaceIfNot(legacyServices, legacyModel, MANAGEMENT_SUBSYSTEM_ENDPOINT, SERVER_GROUP); checkAttributeIsActuallyDefinedAndReplaceIfNot(legacyServices, legacyModel, READ_ONLY, PATH); removeDefaultAttributesWronglyShowingInRecursiveReadResourceInSocketBindingGroup(modelVersion, legacyServices, legacyModel); } }
private void removeDefaultAttributesWronglyShowingInRecursiveReadResource(ModelVersion modelVersion, KernelServices legacyServices, ModelNode legacyModel) { if (modelVersion.getMajor() == 1 && modelVersion.getMinor() < 4) { //Work around known problem where the recursice :read-resource on legacy controllers in ModelVersion < 1.4.0 //incorrectly does not propagate include-defaults=true when recursing //https://issues.jboss.org/browse/AS7-6077 checkAttributeIsActuallyDefinedAndReplaceIfNot(legacyServices, legacyModel, MANAGEMENT_SUBSYSTEM_ENDPOINT, SERVER_GROUP); checkAttributeIsActuallyDefinedAndReplaceIfNot(legacyServices, legacyModel, READ_ONLY, PATH); removeDefaultAttributesWronglyShowingInRecursiveReadResourceInSocketBindingGroup(modelVersion, legacyServices, legacyModel); } }
private OperationTransformerRegistry getRegistryUpdater(final ModelVersion version) { int micro = version.getMicro(); for (int i = micro; i >= 0; i--) { ModelVersion currentVersion = ModelVersion.create(version.getMajor(), version.getMinor(), i); OperationTransformerRegistry current = registryUpdater.get(this, currentVersion); if (current != null) { if(micro != i && this.getClass().desiredAssertionStatus()) { ControllerLogger.MGMT_OP_LOGGER.couldNotFindTransformerRegistryFallingBack(version, currentVersion); } return current; } } return null; }
private OperationTransformerRegistry getRegistryUpdater(final ModelVersion version) { int micro = version.getMicro(); for (int i = micro; i >= 0; i--) { ModelVersion currentVersion = ModelVersion.create(version.getMajor(), version.getMinor(), i); OperationTransformerRegistry current = registryUpdater.get(this, currentVersion); if (current != null) { if(micro != i && this.getClass().desiredAssertionStatus()) { ControllerLogger.MGMT_OP_LOGGER.couldNotFindTransformerRegistryFallingBack(version, currentVersion); } return current; } } return null; }
@Override protected boolean rejectAttribute(PathAddress address, String attributeName, ModelNode attributeValue, TransformationContext context) { if (attributeValue.isDefined()) { ModelVersion version = context.getTarget().getVersion(); if (version.getMajor() == 1 && version.getMinor() == 2) { //7.1.2 has model version 1.2.0 and should have this transformation //7.1.3 has model version 1.3.0 and should not have this transformation if (attributeValue.getType() == ModelType.BOOLEAN) { return !attributeValue.asBoolean(); } else { if (!Boolean.parseBoolean(attributeValue.asString())) { return true; } } } } return false; } }, EeSubsystemRootResource.JBOSS_DESCRIPTOR_PROPERTY_REPLACEMENT);
private static DomainHostExcludeRegistry.VersionKey getVersionKey(OperationContext context, ModelNode model) throws OperationFailedException { ModelNode release = HOST_RELEASE.resolveModelAttribute(context, model); if (release.isDefined()) { KnownRelease kr = KnownRelease.fromName(release.asString()); ModelVersion modelVersion = kr.kernelAPIVersion.getModelVersion(); return new DomainHostExcludeRegistry.VersionKey(modelVersion.getMajor(), modelVersion.getMinor(), modelVersion.getMicro()); } else { int major = MANAGEMENT_MAJOR_VERSION.resolveModelAttribute(context, model).asInt(); int minor = MANAGEMENT_MINOR_VERSION.resolveModelAttribute(context, model).asInt(); ModelNode micro = MANAGEMENT_MICRO_VERSION.resolveModelAttribute(context, model); return new DomainHostExcludeRegistry.VersionKey(major, minor, micro.asIntOrNull()); } }
private static DomainHostExcludeRegistry.VersionKey getVersionKey(OperationContext context, ModelNode model) throws OperationFailedException { ModelNode release = HOST_RELEASE.resolveModelAttribute(context, model); if (release.isDefined()) { KnownRelease kr = KnownRelease.fromName(release.asString()); ModelVersion modelVersion = kr.kernelAPIVersion.getModelVersion(); return new DomainHostExcludeRegistry.VersionKey(modelVersion.getMajor(), modelVersion.getMinor(), modelVersion.getMicro()); } else { int major = MANAGEMENT_MAJOR_VERSION.resolveModelAttribute(context, model).asInt(); int minor = MANAGEMENT_MINOR_VERSION.resolveModelAttribute(context, model).asInt(); ModelNode micro = MANAGEMENT_MICRO_VERSION.resolveModelAttribute(context, model); return new DomainHostExcludeRegistry.VersionKey(major, minor, micro.asIntOrNull()); } }
/** * {@inheritDoc} */ @Override public void initialize(final ExtensionContext context) { final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, MGMT_API_VERSION.getMajor(), MGMT_API_VERSION.getMinor(), MGMT_API_VERSION.getMicro()); ManagementResourceRegistration registration = subsystem.registerSubsystemModel(KeycloakSubsystemDefinition.INSTANCE); ManagementResourceRegistration secureDeploymentRegistration = registration.registerSubModel(SecureDeploymentDefinition.INSTANCE); ManagementResourceRegistration serviceProviderRegistration = secureDeploymentRegistration.registerSubModel(ServiceProviderDefinition.INSTANCE); serviceProviderRegistration.registerSubModel(KeyDefinition.INSTANCE); ManagementResourceRegistration idpRegistration = serviceProviderRegistration.registerSubModel(IdentityProviderDefinition.INSTANCE); idpRegistration.registerSubModel(KeyDefinition.INSTANCE); subsystem.registerXMLElementWriter(PARSER); } }