@Override protected void validateUpdatedModel(final OperationContext context, final Resource resource) throws OperationFailedException { final ModelNode model = resource.getModel(); if (!context.getProcessType().equals(ProcessType.HOST_CONTROLLER)) { final List<String> propertiesToReject = new LinkedList<String>(); for (final AttributeDefinition attribute : JacORBSubsystemDefinitions.ON_OFF_ATTRIBUTES_TO_REJECT) { if (model.hasDefined(attribute.getName()) && model.get(attribute.getName()).equals(JacORBSubsystemDefinitions.DEFAULT_ENABLED_PROPERTY)) { propertiesToReject.add(attribute.getName()); } } for (final AttributeDefinition attribute : JacORBSubsystemDefinitions.ATTRIBUTES_TO_REJECT) { if (model.hasDefined(attribute.getName())) { propertiesToReject.add(attribute.getName()); } } if (!propertiesToReject.isEmpty()) { throw JacORBLogger.ROOT_LOGGER.cannotEmulateProperties(propertiesToReject); } } }
@Override protected void populateModel(final OperationContext context, final ModelNode operation, final Resource resource) throws OperationFailedException { final ModelNode model = resource.getModel(); for (AttributeDefinition attr : attributes) { attr.validateAndSet(operation, model); } ConfigValidator.validateConfig(context, TransformUtils.transformModel(model)); final boolean adminOnly = context.getRunningMode() == RunningMode.ADMIN_ONLY; final boolean hostController = context.getProcessType().equals(ProcessType.HOST_CONTROLLER); // in case of unsupported configuration parameters: // in admin mode they are all logged as warning to enable fixes before migrate operation // standalone server in normal mode is shutted down with exception as it is unable to run with specified configuration // domain controller in normal mode works normally - it may send old parameters to legacy hosts - such configuration is // valid if (adminOnly || !hostController) { final List<String> unsupportedProperites = TransformUtils.validateDeprecatedProperites(model); if(!unsupportedProperites.isEmpty()) { if (adminOnly) { final String warning = JacORBLogger.ROOT_LOGGER.cannotEmulatePropertiesWarning(unsupportedProperites); JacORBLogger.ROOT_LOGGER.warn(warning); } else { throw JacORBLogger.ROOT_LOGGER.cannotEmulateProperties(unsupportedProperites); } } } }
@Override protected void validateUpdatedModel(final OperationContext context, final Resource resource) throws OperationFailedException { final ModelNode model = resource.getModel(); if (!context.getProcessType().equals(ProcessType.HOST_CONTROLLER)) { final List<String> propertiesToReject = new LinkedList<String>(); for (final AttributeDefinition attribute : JacORBSubsystemDefinitions.ON_OFF_ATTRIBUTES_TO_REJECT) { if (model.hasDefined(attribute.getName()) && model.get(attribute.getName()).equals(JacORBSubsystemDefinitions.DEFAULT_ENABLED_PROPERTY)) { propertiesToReject.add(attribute.getName()); } } for (final AttributeDefinition attribute : JacORBSubsystemDefinitions.ATTRIBUTES_TO_REJECT) { if (model.hasDefined(attribute.getName())) { propertiesToReject.add(attribute.getName()); } } if (!propertiesToReject.isEmpty()) { throw JacORBLogger.ROOT_LOGGER.cannotEmulateProperties(propertiesToReject); } } }
@Override protected void populateModel(final OperationContext context, final ModelNode operation, final Resource resource) throws OperationFailedException { final ModelNode model = resource.getModel(); for (AttributeDefinition attr : attributes) { attr.validateAndSet(operation, model); } ConfigValidator.validateConfig(context, TransformUtils.transformModel(model)); final boolean adminOnly = context.getRunningMode() == RunningMode.ADMIN_ONLY; final boolean hostController = context.getProcessType().equals(ProcessType.HOST_CONTROLLER); // in case of unsupported configuration parameters: // in admin mode they are all logged as warning to enable fixes before migrate operation // standalone server in normal mode is shutted down with exception as it is unable to run with specified configuration // domain controller in normal mode works normally - it may send old parameters to legacy hosts - such configuration is // valid if (adminOnly || !hostController) { final List<String> unsupportedProperites = TransformUtils.validateDeprecatedProperites(model); if(!unsupportedProperites.isEmpty()) { if (adminOnly) { final String warning = JacORBLogger.ROOT_LOGGER.cannotEmulatePropertiesWarning(unsupportedProperites); JacORBLogger.ROOT_LOGGER.warn(warning); } else { throw JacORBLogger.ROOT_LOGGER.cannotEmulateProperties(unsupportedProperites); } } } }