Skip to content

Commit

Permalink
0003367: Remote node replacing Master Node User
Browse files Browse the repository at this point in the history
  • Loading branch information
maxwellpettit committed Jan 22, 2018
1 parent e325bd9 commit 1fe2cf0
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 26 deletions.
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 @@ -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
@@ -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 1fe2cf0

Please sign in to comment.