diff --git a/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/AttributeConstants.java b/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/AttributeConstants.java index 82f47c2fb25c..937e22fc590e 100644 --- a/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/AttributeConstants.java +++ b/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/AttributeConstants.java @@ -37,19 +37,36 @@ public class AttributeConstants { private AttributeConstants() { } - static final ModelNode DEFAULT_DISABLED_PROPERTY = new ModelNode().set("off"); + static final ModelNode FALSE_PROPERTY = new ModelNode().set("false"); - static final ModelNode DEFAULT_ENABLED_PROPERTY = new ModelNode().set("on"); + static final ModelNode TRUE_PROPERTY = new ModelNode().set("true"); + + static final ModelNode NONE_PROPERTY = new ModelNode().set("none"); static final ParameterValidator SSL_CONFIG_VALIDATOR = new EnumValidator(SSLConfigValue.class, true, false); - static final ParameterValidator ON_OFF_VALIDATOR = new EnumValidator( - TransactionsAllowedValues.class, true, false, TransactionsAllowedValues.ON, TransactionsAllowedValues.OFF); + static final ParameterValidator TRUE_FALSE_VALIDATOR = new EnumValidator( + TrueFalse.class, true, false, TrueFalse.TRUE, TrueFalse.FALSE); static final SensitivityClassification IIOP_SECURITY = new SensitivityClassification(IIOPExtension.SUBSYSTEM_NAME, "iiop-security", false, false, true); static final SensitiveTargetAccessConstraintDefinition IIOP_SECURITY_DEF = new SensitiveTargetAccessConstraintDefinition( IIOP_SECURITY); + + private static enum TrueFalse { + TRUE("true"), FALSE("false"); + + private String value; + + private TrueFalse(String value) { + this.value = value; + } + + @Override + public String toString() { + return this.value; + } + } } diff --git a/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/Constants.java b/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/Constants.java index 3d82f89ad5ba..9931d3fbfb0f 100644 --- a/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/Constants.java +++ b/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/Constants.java @@ -59,8 +59,11 @@ private Constants() { public static final String NAMING = "naming"; public static final String NAMING_EXPORT_CORBALOC = "export-corbaloc"; public static final String NAMING_ROOT_CONTEXT = "root-context"; + public static final String NONE = "none"; public static final String IDENTITY = "identity"; public static final String SECURITY = "security"; + public static final String SPEC = "spec"; + public static final String FULL = "full"; public static final String SECURITY_SUPPORT_SSL = "support-ssl"; public static final String SECURITY_SECURITY_DOMAIN = "security-domain"; public static final String SECURITY_ADD_COMP_VIA_INTERCEPTOR = "add-component-via-interceptor"; diff --git a/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/IIOPSubsystemAdd.java b/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/IIOPSubsystemAdd.java index adafa9e7e156..fc75c694f20b 100644 --- a/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/IIOPSubsystemAdd.java +++ b/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/IIOPSubsystemAdd.java @@ -302,15 +302,14 @@ private void setupInitializers(Properties props) { String installSecurity = (String) props.remove(Constants.ORB_INIT_SECURITY); if (installSecurity.equalsIgnoreCase(Constants.CLIENT)) { orbInitializers.addAll(Arrays.asList(IIOPInitializer.SECURITY_CLIENT.getInitializerClasses())); - } else if (installSecurity.equalsIgnoreCase(Constants.IDENTITY) - || installSecurity.equalsIgnoreCase("on")) { + } else if (installSecurity.equalsIgnoreCase(Constants.IDENTITY)) { orbInitializers.addAll(Arrays.asList(IIOPInitializer.SECURITY_IDENTITY.getInitializerClasses())); } String installTransaction = (String) props.remove(Constants.ORB_INIT_TRANSACTIONS); - if (installTransaction.equalsIgnoreCase("on")) { + if (installTransaction.equalsIgnoreCase(Constants.FULL)) { orbInitializers.addAll(Arrays.asList(IIOPInitializer.TRANSACTIONS.getInitializerClasses())); - } else if (installTransaction.equalsIgnoreCase("spec")) { + } else if (installTransaction.equalsIgnoreCase(Constants.SPEC)) { orbInitializers.addAll(Arrays.asList(IIOPInitializer.SPEC_TRANSACTIONS.getInitializerClasses())); } @@ -330,7 +329,7 @@ private void setupInitializers(Properties props) { * security domain has been specified). */ private void setupSSLFactories(final Properties props) throws OperationFailedException { - boolean supportSSL = "on".equalsIgnoreCase(props.getProperty(Constants.SECURITY_SUPPORT_SSL)); + boolean supportSSL = "true".equalsIgnoreCase(props.getProperty(Constants.SECURITY_SUPPORT_SSL)); if (supportSSL) { // if SSL is to be used, check if a security domain has been specified. diff --git a/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/InitializersAdd.java b/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/InitializersAdd.java deleted file mode 100644 index 467affca0175..000000000000 --- a/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/InitializersAdd.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014, Red Hat, Inc., and individual contributors - * as indicated by the @author tags. See the copyright.txt file in the - * distribution for a full listing of individual contributors. - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ - -package org.wildfly.iiop.openjdk; - -import java.util.Collection; - -import org.jboss.as.controller.AbstractAddStepHandler; -import org.jboss.as.controller.AttributeDefinition; -import org.jboss.as.controller.OperationFailedException; -import org.jboss.dmr.ModelNode; - -/** - * @author Tomasz Adamski - */ -final class InitializersAdd extends AbstractAddStepHandler { - - protected InitializersAdd(final Collection attributes) { - super(attributes); - } - - @Override - protected void populateModel(ModelNode operation, ModelNode model) throws OperationFailedException { - super.populateModel(operation, model); - if (model.hasDefined(InitializersDefinition.SECURITY.getName()) - && "on".equals(model.get(InitializersDefinition.SECURITY.getName()).asString())) { - model.get(InitializersDefinition.SECURITY.getName()).set(Constants.IDENTITY); - } - } -} diff --git a/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/InitializersDefinition.java b/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/InitializersDefinition.java index 337034621805..56b2a23bd8b1 100644 --- a/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/InitializersDefinition.java +++ b/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/InitializersDefinition.java @@ -27,6 +27,7 @@ import java.util.Collections; import java.util.List; +import org.jboss.as.controller.AbstractAddStepHandler; import org.jboss.as.controller.AttributeDefinition; import org.jboss.as.controller.PersistentResourceDefinition; import org.jboss.as.controller.ReloadRequiredRemoveStepHandler; @@ -42,14 +43,14 @@ public class InitializersDefinition extends PersistentResourceDefinition { protected static final AttributeDefinition SECURITY = new SimpleAttributeDefinitionBuilder( Constants.ORB_INIT_SECURITY, ModelType.STRING, true) - .setDefaultValue(AttributeConstants.DEFAULT_DISABLED_PROPERTY) + .setDefaultValue(AttributeConstants.NONE_PROPERTY) .setValidator(new EnumValidator(SecurityAllowedValues.class, true, false)) .setFlags(AttributeAccess.Flag.RESTART_ALL_SERVICES).setAllowExpression(true) .addAccessConstraint(AttributeConstants.IIOP_SECURITY_DEF).build(); protected static final AttributeDefinition TRANSACTIONS = new SimpleAttributeDefinitionBuilder( Constants.ORB_INIT_TRANSACTIONS, ModelType.STRING, true) - .setDefaultValue(AttributeConstants.DEFAULT_DISABLED_PROPERTY) + .setDefaultValue(AttributeConstants.NONE_PROPERTY) .setValidator(new EnumValidator(TransactionsAllowedValues.class, true, false)) .setFlags(AttributeAccess.Flag.RESTART_ALL_SERVICES).setAllowExpression(true).build(); @@ -60,7 +61,7 @@ public class InitializersDefinition extends PersistentResourceDefinition { private InitializersDefinition() { super(IIOPExtension.PATH_INITIALIZERS, IIOPExtension.getResourceDescriptionResolver(Constants.ORB, Constants.ORB_INIT), - new InitializersAdd(ATTRIBUTES), ReloadRequiredRemoveStepHandler.INSTANCE); + new AbstractAddStepHandler(ATTRIBUTES), ReloadRequiredRemoveStepHandler.INSTANCE); } @Override diff --git a/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/NamingDefinition.java b/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/NamingDefinition.java index 4a76156d0fad..319dec032993 100644 --- a/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/NamingDefinition.java +++ b/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/NamingDefinition.java @@ -48,7 +48,7 @@ public class NamingDefinition extends PersistentResourceDefinition { protected static final AttributeDefinition EXPORT_CORBALOC = new SimpleAttributeDefinitionBuilder( Constants.NAMING_EXPORT_CORBALOC, ModelType.STRING, true) - .setDefaultValue(AttributeConstants.DEFAULT_ENABLED_PROPERTY).setValidator(AttributeConstants.ON_OFF_VALIDATOR) + .setDefaultValue(AttributeConstants.TRUE_PROPERTY).setValidator(AttributeConstants.TRUE_FALSE_VALIDATOR) .setFlags(AttributeAccess.Flag.RESTART_ALL_SERVICES).setAllowExpression(true).build(); private static final List ATTRIBUTES = Collections.unmodifiableList(Arrays.asList( diff --git a/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/SecurityAllowedValues.java b/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/SecurityAllowedValues.java index cf823606c01d..68253bc9601d 100644 --- a/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/SecurityAllowedValues.java +++ b/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/SecurityAllowedValues.java @@ -32,10 +32,8 @@ enum SecurityAllowedValues { IDENTITY("identity"), - //legacy alias for 'identity' - ON("on"), - OFF("off"), - CLIENT("client"); + CLIENT("client"), + NONE("none"); private String name; diff --git a/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/SecurityDefinition.java b/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/SecurityDefinition.java index 6ae1b40eb5f9..97cbd3f5a22a 100644 --- a/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/SecurityDefinition.java +++ b/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/SecurityDefinition.java @@ -44,8 +44,8 @@ public class SecurityDefinition extends PersistentResourceDefinition { public static final AttributeDefinition SUPPORT_SSL = new SimpleAttributeDefinitionBuilder( Constants.SECURITY_SUPPORT_SSL, ModelType.STRING, true) - .setDefaultValue(AttributeConstants.DEFAULT_DISABLED_PROPERTY) - .setValidator(AttributeConstants.ON_OFF_VALIDATOR) + .setDefaultValue(AttributeConstants.FALSE_PROPERTY) + .setValidator(AttributeConstants.TRUE_FALSE_VALIDATOR) .setFlags(AttributeAccess.Flag.RESTART_ALL_SERVICES) .setAllowExpression(true) .addAccessConstraint(AttributeConstants.IIOP_SECURITY_DEF) @@ -60,8 +60,8 @@ public class SecurityDefinition extends PersistentResourceDefinition { public static final AttributeDefinition ADD_COMPONENT_INTERCEPTOR = new SimpleAttributeDefinitionBuilder( Constants.SECURITY_ADD_COMP_VIA_INTERCEPTOR, ModelType.STRING, true) - .setDefaultValue(AttributeConstants.DEFAULT_ENABLED_PROPERTY) - .setValidator(AttributeConstants.ON_OFF_VALIDATOR) + .setDefaultValue(AttributeConstants.TRUE_PROPERTY) + .setValidator(AttributeConstants.TRUE_FALSE_VALIDATOR) .setFlags(AttributeAccess.Flag.RESTART_ALL_SERVICES) .setAllowExpression(true) .addAccessConstraint(AttributeConstants.IIOP_SECURITY_DEF) diff --git a/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/TransactionsAllowedValues.java b/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/TransactionsAllowedValues.java index d05b21466a38..cdadd5f3881c 100644 --- a/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/TransactionsAllowedValues.java +++ b/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/TransactionsAllowedValues.java @@ -31,7 +31,7 @@ */ enum TransactionsAllowedValues { - ON("on"), OFF("off"), SPEC("spec"); + FULL("full"), NONE("none"), SPEC("spec"); private String name; diff --git a/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/naming/BindingIteratorImpl.java b/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/naming/BindingIteratorImpl.java index 7d170fb7bdc9..2f9a44bf8f19 100644 --- a/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/naming/BindingIteratorImpl.java +++ b/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/naming/BindingIteratorImpl.java @@ -1,25 +1,28 @@ package org.wildfly.iiop.openjdk.naming; /* - * JBoss, Home of Professional Open Source. - * Copyright 2011, Red Hat, Inc., and individual contributors - * as indicated by the @author tags. See the copyright.txt file in the - * distribution for a full listing of individual contributors. + * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ import org.omg.CORBA.UserException; diff --git a/iiop-openjdk/src/main/resources/schema/jboss-as-iiop-openjdk_1_0.xsd b/iiop-openjdk/src/main/resources/schema/jboss-as-iiop-openjdk_1_0.xsd index 4cb4eb583550..ebe3a0aefe98 100644 --- a/iiop-openjdk/src/main/resources/schema/jboss-as-iiop-openjdk_1_0.xsd +++ b/iiop-openjdk/src/main/resources/schema/jboss-as-iiop-openjdk_1_0.xsd @@ -99,23 +99,23 @@ The orbInitializersConfigType specifies the attributes used to configure the ORB initializers. * security: indicates whether the security (SAS and CSIv2) initializers should be installed. There are three possibilities: - client - The client interceptor will be installed. Remote calls from this server will propagate - by sending the current username and password identity - The server will just send the current username. The recieving server must trust this server. - off - Security interceptors are not installed + client - The client interceptor will be installed. Remote calls from this server will propagate + by sending the current username and password + none - Security interceptors are not installed * transactions: indicates which transaction initializers should be installed. There are three possibilities: - on - This requires JTS to be enabled in the transactions subsystem config, and will enable full transaction + full - This requires JTS to be enabled in the transactions subsystem config, and will enable full transaction interaoprability with other JBoss AS instances. spec - This does not require JTS to be enabled, but will install the minimum set of transaction interceptors required for EJB spec compliance. These interceptors detect an incoming transaction and throw an exception if the invocation should be run in the incoming transaction context. - off - No transaction initalizers will be installed. + none - No transaction initalizers will be installed. ]]> - - + + @@ -126,12 +126,12 @@ * root-context: the naming service root context. * export-corbaloc: indicates whether the root context should be exported as corbaloc::address:port/NameService - (on) or not (off). + (true) or not (false). ]]> - + @@ -156,9 +156,9 @@ ]]> - + - + @@ -300,7 +300,7 @@ - + - - + + @@ -321,8 +321,8 @@ - - + + @@ -336,7 +336,7 @@ - + diff --git a/iiop-openjdk/src/test/resources/org/wildfly/iiop/openjdk/expressions-1.0.xml b/iiop-openjdk/src/test/resources/org/wildfly/iiop/openjdk/expressions-1.0.xml index b78a83e77a99..ea192fac88e1 100644 --- a/iiop-openjdk/src/test/resources/org/wildfly/iiop/openjdk/expressions-1.0.xml +++ b/iiop-openjdk/src/test/resources/org/wildfly/iiop/openjdk/expressions-1.0.xml @@ -3,8 +3,8 @@ - - + diff --git a/iiop-openjdk/src/test/resources/org/wildfly/iiop/openjdk/subsystem-1.0-security-client.xml b/iiop-openjdk/src/test/resources/org/wildfly/iiop/openjdk/subsystem-1.0-security-client.xml index e3aac376d7b4..db0b53a585e4 100644 --- a/iiop-openjdk/src/test/resources/org/wildfly/iiop/openjdk/subsystem-1.0-security-client.xml +++ b/iiop-openjdk/src/test/resources/org/wildfly/iiop/openjdk/subsystem-1.0-security-client.xml @@ -4,8 +4,8 @@ - - + diff --git a/iiop-openjdk/src/test/resources/org/wildfly/iiop/openjdk/subsystem-1.0-security-identity.xml b/iiop-openjdk/src/test/resources/org/wildfly/iiop/openjdk/subsystem-1.0-security-identity.xml index e3aac376d7b4..db0b53a585e4 100644 --- a/iiop-openjdk/src/test/resources/org/wildfly/iiop/openjdk/subsystem-1.0-security-identity.xml +++ b/iiop-openjdk/src/test/resources/org/wildfly/iiop/openjdk/subsystem-1.0-security-identity.xml @@ -4,8 +4,8 @@ - - + diff --git a/iiop-openjdk/src/test/resources/org/wildfly/iiop/openjdk/subsystem-1.0.xml b/iiop-openjdk/src/test/resources/org/wildfly/iiop/openjdk/subsystem-1.0.xml index 4825e465e07b..3b3eee26b02e 100644 --- a/iiop-openjdk/src/test/resources/org/wildfly/iiop/openjdk/subsystem-1.0.xml +++ b/iiop-openjdk/src/test/resources/org/wildfly/iiop/openjdk/subsystem-1.0.xml @@ -4,8 +4,8 @@ - - + - diff --git a/testsuite/integration/src/test/xslt/enableJTS.xsl b/testsuite/integration/src/test/xslt/enableJTS.xsl index 52e068d9d54f..f36b7df58009 100644 --- a/testsuite/integration/src/test/xslt/enableJTS.xsl +++ b/testsuite/integration/src/test/xslt/enableJTS.xsl @@ -23,7 +23,7 @@ - on + full client