diff --git a/symmetric-assemble/src/asciidoc/appendix/dbexport.ad b/symmetric-assemble/src/asciidoc/appendix/dbexport.ad index c4b25d58a5..14dc8199e3 100644 --- a/symmetric-assemble/src/asciidoc/appendix/dbexport.ad +++ b/symmetric-assemble/src/asciidoc/appendix/dbexport.ad @@ -29,7 +29,7 @@ They are as follows: - *--add-drop-table* : Add drop table commands to output. - *--catalog * : Look for tables in catalog -- *--compatible * : Change export to be compatible with a given database: db2, derby, firebird, greenplum, h2, hsqldb, hsqldb2, informix, interbase, mssql, mysql, oracle, postgres, sybase. +- *--compatible * : Change export to be compatible with a given database: db2, db2zos, derby, firebird, greenplum, h2, hsqldb, hsqldb2, informix, interbase, mssql, mysql, oracle, postgres, sybase. - *--debug* : Print debug information in logging. - *--dir * : Indicate a directory to use for the export of files. If the directory is specified, then a file per table will be written to the directory. - *-e, --engine * : The name of a configured engine. The name should correspond to an engine.name setting in one of the properties files in the engines directory. diff --git a/symmetric-client/src/main/resources/symmetric-messages.properties b/symmetric-client/src/main/resources/symmetric-messages.properties index 44635d60a6..ba9875da83 100644 --- a/symmetric-client/src/main/resources/symmetric-messages.properties +++ b/symmetric-client/src/main/resources/symmetric-messages.properties @@ -121,7 +121,7 @@ SymAdmin.Option.force=Force triggers to regenerate even if no change is detected SymAdmin.Option.out=Write output to file SymAdmin.Option.reverse=Reverse initial load from client to server -DbExport.Option.compatible=Change export to be compatible with given database: db2, derby, firebird, greenplum, h2, hsqldb, hsqldb2, informix, interbase, mssql, mysql, oracle, postgres, sybase. +DbExport.Option.compatible=Change export to be compatible with given database: db2, db2zos, derby, firebird, greenplum, h2, hsqldb, hsqldb2, informix, interbase, mssql, mysql, oracle, postgres, sybase. DbExport.Option.add-drop-table=Add drop table commands to output. DbExport.Option.no-create-info=Do not write statements to create tables. DbExport.Option.no-indices=Do not write statements to create indices. diff --git a/symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/DataLoaderService.java b/symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/DataLoaderService.java index 3a85414e22..0c29f0e96d 100644 --- a/symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/DataLoaderService.java +++ b/symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/DataLoaderService.java @@ -258,6 +258,7 @@ public void loadDataFromPull(Node remote, RemoteNodeStatus status) throws IOExce Node local = nodeService.findIdentity(); if (local == null) { local = new Node(this.parameterService, symmetricDialect); + local.setDeploymentType(engine.getDeploymentType()); } try { NodeSecurity localSecurity = nodeService.findNodeSecurity(local.getNodeId(), true); diff --git a/symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/RegistrationService.java b/symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/RegistrationService.java index 85f1580107..0f4d5e7faa 100644 --- a/symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/RegistrationService.java +++ b/symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/RegistrationService.java @@ -123,8 +123,9 @@ public Node registerPullOnlyNode(String externalId, String nodeGroupId, node.setNodeGroupId(nodeGroupId); node.setDatabaseType(databaseType); node.setDatabaseVersion(databaseVersion); - - node = processRegistration(node, null, null, true, Constants.DEPLOYMENT_TYPE_REST); + node.setDeploymentType(Constants.DEPLOYMENT_TYPE_REST); + + node = processRegistration(node, null, null, true); if (node.isSyncEnabled()) { //set the node as registered as we have no @@ -144,7 +145,7 @@ protected void extractConfiguration(OutputStream out, Node registeredNode) { } protected Node processRegistration(Node nodePriorToRegistration, String remoteHost, - String remoteAddress, boolean isRequestedRegistration, String deploymentType) + String remoteAddress, boolean isRequestedRegistration) throws IOException { Node processedNode = new Node(); @@ -227,14 +228,11 @@ protected Node processRegistration(Node nodePriorToRegistration, String remoteHo } foundNode.setSyncEnabled(true); - if (Constants.DEPLOYMENT_TYPE_REST.equalsIgnoreCase(deploymentType)) { - foundNode.setSymmetricVersion(null); - foundNode.setDeploymentType(deploymentType); - } foundNode.setSyncUrl(nodePriorToRegistration.getSyncUrl()); foundNode.setDatabaseType(nodePriorToRegistration.getDatabaseType()); foundNode.setDatabaseVersion(nodePriorToRegistration.getDatabaseVersion()); foundNode.setSymmetricVersion(nodePriorToRegistration.getSymmetricVersion()); + foundNode.setDeploymentType(nodePriorToRegistration.getDeploymentType()); nodeService.save(foundNode); /** @@ -277,7 +275,7 @@ public boolean registerNode(Node nodePriorToRegistration, String remoteHost, throws IOException { Node processedNode = processRegistration(nodePriorToRegistration, remoteHost, - remoteAddress, isRequestedRegistration, null); + remoteAddress, isRequestedRegistration); if (processedNode.isSyncEnabled()) { /* diff --git a/symmetric-core/src/main/java/org/jumpmind/symmetric/transport/http/HttpTransportManager.java b/symmetric-core/src/main/java/org/jumpmind/symmetric/transport/http/HttpTransportManager.java index c4c7a53365..e21c5d01cc 100644 --- a/symmetric-core/src/main/java/org/jumpmind/symmetric/transport/http/HttpTransportManager.java +++ b/symmetric-core/src/main/java/org/jumpmind/symmetric/transport/http/HttpTransportManager.java @@ -284,6 +284,7 @@ public static String buildRegistrationUrl(String baseUrl, Node node) throws IOEx append(builder, WebConstants.DATABASE_TYPE, node.getDatabaseType()); append(builder, WebConstants.DATABASE_VERSION, node.getDatabaseVersion()); append(builder, WebConstants.SYMMETRIC_VERSION, node.getSymmetricVersion()); + append(builder, WebConstants.DEPLOYMENT_TYPE, node.getDeploymentType()); append(builder, WebConstants.HOST_NAME, AppUtils.getHostName()); append(builder, WebConstants.IP_ADDRESS, AppUtils.getIpAddress()); return builder.toString(); diff --git a/symmetric-core/src/main/java/org/jumpmind/symmetric/web/WebConstants.java b/symmetric-core/src/main/java/org/jumpmind/symmetric/web/WebConstants.java index fe017ff5a3..754e8f8d53 100644 --- a/symmetric-core/src/main/java/org/jumpmind/symmetric/web/WebConstants.java +++ b/symmetric-core/src/main/java/org/jumpmind/symmetric/web/WebConstants.java @@ -124,6 +124,8 @@ public class WebConstants { public static final String DATABASE_TYPE = "databaseType"; public static final String DATABASE_VERSION = "databaseVersion"; + + public static final String DEPLOYMENT_TYPE = "deploymentType"; public static final String SECURITY_TOKEN = "securityToken"; diff --git a/symmetric-db/src/main/java/org/jumpmind/db/platform/DdlBuilderFactory.java b/symmetric-db/src/main/java/org/jumpmind/db/platform/DdlBuilderFactory.java index 0dbd815301..12bbae7534 100644 --- a/symmetric-db/src/main/java/org/jumpmind/db/platform/DdlBuilderFactory.java +++ b/symmetric-db/src/main/java/org/jumpmind/db/platform/DdlBuilderFactory.java @@ -56,7 +56,7 @@ private DdlBuilderFactory() { * @return the associated ddl builder */ public static final IDdlBuilder createDdlBuilder(String databaseName) { - if (DatabaseNamesConstants.DB2.equals(databaseName)) { + if (DatabaseNamesConstants.DB2.equals(databaseName) || DatabaseNamesConstants.DB2ZOS.equalsIgnoreCase(databaseName)) { return new Db2DdlBuilder(); } else if (DatabaseNamesConstants.DERBY.equalsIgnoreCase(databaseName)) { return new DerbyDdlBuilder(); diff --git a/symmetric-io/src/main/java/org/jumpmind/symmetric/io/data/DbExport.java b/symmetric-io/src/main/java/org/jumpmind/symmetric/io/data/DbExport.java index 709350b583..f4a70486ff 100644 --- a/symmetric-io/src/main/java/org/jumpmind/symmetric/io/data/DbExport.java +++ b/symmetric-io/src/main/java/org/jumpmind/symmetric/io/data/DbExport.java @@ -65,7 +65,7 @@ public enum Format { }; public enum Compatible { - DB2, DERBY, FIREBIRD, FIREBIRD_DIALECT1, GREENPLUM, H2, HSQLDB, HSQLDB2, INFORMIX, INTERBASE, MSSQL, MSSQL2000, MSSQL2005, MSSQL2008, MYSQL, ORACLE, POSTGRES, SYBASE, SQLITE, MARIADB, ASE, SQLANYWHERE, REDSHIFT, VOLTDB, NUODB, TIBERO, GENERIC + DB2, DB2ZOS, DERBY, FIREBIRD, FIREBIRD_DIALECT1, GREENPLUM, H2, HSQLDB, HSQLDB2, INFORMIX, INTERBASE, MSSQL, MSSQL2000, MSSQL2005, MSSQL2008, MYSQL, ORACLE, POSTGRES, SYBASE, SQLITE, MARIADB, ASE, SQLANYWHERE, REDSHIFT, VOLTDB, NUODB, TIBERO, GENERIC }; private Format format = Format.SQL; diff --git a/symmetric-server/src/main/java/org/jumpmind/symmetric/web/RegistrationUriHandler.java b/symmetric-server/src/main/java/org/jumpmind/symmetric/web/RegistrationUriHandler.java index 623012aa86..3e12ee88a7 100644 --- a/symmetric-server/src/main/java/org/jumpmind/symmetric/web/RegistrationUriHandler.java +++ b/symmetric-server/src/main/java/org/jumpmind/symmetric/web/RegistrationUriHandler.java @@ -1,25 +1,25 @@ -/** - * Licensed to JumpMind Inc under one or more contributor - * license agreements. See the NOTICE file distributed - * with this work for additional information regarding - * copyright ownership. JumpMind Inc licenses this file - * to you under the GNU General Public License, version 3.0 (GPLv3) - * (the "License"); you may not use this file except in compliance - * with the License. - * - * You should have received a copy of the GNU General Public License, - * version 3.0 (GPLv3) along with this library; if not, see - * . - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.jumpmind.symmetric.web; - +/** + * Licensed to JumpMind Inc under one or more contributor + * license agreements. See the NOTICE file distributed + * with this work for additional information regarding + * copyright ownership. JumpMind Inc licenses this file + * to you under the GNU General Public License, version 3.0 (GPLv3) + * (the "License"); you may not use this file except in compliance + * with the License. + * + * You should have received a copy of the GNU General Public License, + * version 3.0 (GPLv3) along with this library; if not, see + * . + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.jumpmind.symmetric.web; + import java.io.IOException; import java.io.OutputStream; @@ -33,12 +33,12 @@ import org.jumpmind.symmetric.service.IRegistrationService; import org.jumpmind.symmetric.service.RegistrationRedirectException; import org.jumpmind.symmetric.transport.http.HttpTransportManager; - + /** * Handler that delegates to the {@link IRegistrationService} */ public class RegistrationUriHandler extends AbstractUriHandler { - + private IRegistrationService registrationService; public RegistrationUriHandler( IParameterService parameterService, @@ -74,6 +74,7 @@ private Node transform(HttpServletRequest req) { node.setSchemaVersion(ServletUtils.getParameter(req, WebConstants.SCHEMA_VERSION)); node.setDatabaseType(ServletUtils.getParameter(req, WebConstants.DATABASE_TYPE)); node.setDatabaseVersion(ServletUtils.getParameter(req, WebConstants.DATABASE_VERSION)); + node.setDeploymentType(ServletUtils.getParameter(req, WebConstants.DEPLOYMENT_TYPE)); return node; } @@ -93,8 +94,8 @@ protected String getIpAddress(HttpServletRequest req) { return ipAdddress; } - protected boolean registerNode(Node node, String remoteHost, String remoteAddress, OutputStream outputStream) throws IOException { - return registrationService.registerNode(node, remoteHost, remoteAddress, outputStream, true); + protected boolean registerNode(Node node, String remoteHost, String remoteAddress, OutputStream outputStream) throws IOException { + return registrationService.registerNode(node, remoteHost, remoteAddress, outputStream, true); } }