Skip to content

Commit

Permalink
Merge branch '3.9' of https://github.com/JumpMind/symmetric-ds.git in…
Browse files Browse the repository at this point in the history
…to 3.9
  • Loading branch information
jumpmind-josh committed Jan 24, 2018
2 parents 71bc0c2 + 001a1f4 commit 1dd3c01
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 38 deletions.
2 changes: 1 addition & 1 deletion symmetric-assemble/src/asciidoc/appendix/dbexport.ad
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ They are as follows:

- *--add-drop-table* : Add drop table commands to output.
- *--catalog <arg>* : Look for tables in catalog
- *--compatible <arg>* : Change export to be compatible with a given database: db2, derby, firebird, greenplum, h2, hsqldb, hsqldb2, informix, interbase, mssql, mysql, oracle, postgres, sybase.
- *--compatible <arg>* : 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 <arg>* : 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 <arg>* : 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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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();
Expand Down Expand Up @@ -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);

/**
Expand Down Expand Up @@ -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()) {
/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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
* <http://www.gnu.org/licenses/>.
*
* 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
* <http://www.gnu.org/licenses/>.
*
* 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;

Expand All @@ -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,
Expand Down Expand Up @@ -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;
}

Expand All @@ -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);
}

}

0 comments on commit 1dd3c01

Please sign in to comment.