private static void transformIorSettings(final ModelNode model, final ModelNode legacyValue) { for (final Property category : legacyValue.get(JacORBSubsystemConstants.DEFAULT).get(JacORBSubsystemConstants.SETTING) .asPropertyList()) { for (final Property property : category.getValue().asPropertyList()) { model.get(property.getName()).set(property.getValue()); } } } }
private ModelNode peek(ModelNode node, String... args) { for (String arg : args) { if (!node.hasDefined(arg)) { return null; } node = node.get(arg); } return node; }
/** * Returns the attribute value of the specified operation * @param operation an operation * @return an attribute value */ public static ModelNode getAttributeValue(ModelNode operation) { return operation.hasDefined(ModelDescriptionConstants.VALUE) ? operation.get(ModelDescriptionConstants.VALUE) : new ModelNode(); }
static String getAuthenticationCacheType(ModelNode node) { String type = null; if (node.hasDefined(CACHE_TYPE)) { type = node.get(CACHE_TYPE).asString(); } return type; } }
/** * Indicates whether or not this operation expects to include default values. * @param operation an operation * @return true, if default values are expected, false otherwise. */ public static boolean isIncludeDefaults(ModelNode operation) { return operation.hasDefined(ModelDescriptionConstants.INCLUDE_DEFAULTS) ? operation.get(ModelDescriptionConstants.INCLUDE_DEFAULTS).asBoolean() : true; }
@Override protected void convertAttribute(PathAddress address, String attributeName, ModelNode attributeValue, TransformationContext context) { if (!attributeValue.isDefined()) { // Workaround legacy slaves not accepting null/empty values // JBAS014704: '' is an invalid value for parameter excluded-contexts. Values must have a minimum length of 1 characters attributeValue.set(" "); } } }, Attribute.EXCLUDED_CONTEXTS.getDefinition())
@Override public ModelNode execute(JChannel channel) { return new ModelNode(0); } },
@Override protected boolean rejectAttribute(PathAddress address, String attributeName, ModelNode attributeValue, TransformationContext context) { return !attributeValue.isDefined(); } };
private boolean isConfigured(ModelNode keystore) { return keystore.hasDefined(Constants.TYPE) || keystore.hasDefined(Constants.URL) || keystore.hasDefined(Constants.PROVIDER) || keystore.hasDefined(Constants.PROVIDER_ARGUMENT); } }
/** * {@inheritDoc} */ @Override protected void populateModel(ModelNode operation, ModelNode model) throws OperationFailedException { model.setEmptyObject(); }
@Override public String getSite() { return site.asStringOrNull(); } };
@Override public ModelNode execute(JChannel channel) { return new ModelNode(0); } },