Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SYMMETRICDS-173 - offline watchdog only monitors direct children. nod…
…e security is now deleted on server for an offline node. New sync disabled return code is sent to the client. Default client handling is to remove node identity to allow re-registration. Integration test added.
- Loading branch information
1 parent
a92f8ba
commit 5108b21
Showing
25 changed files
with
400 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
symmetric/src/main/java/org/jumpmind/symmetric/io/DefaultOfflineClientListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* | ||
* SymmetricDS is an open source database synchronization solution. | ||
* | ||
* Copyright (C) Chris Henson <chenson42@users.sourceforge.net> | ||
* | ||
* This library 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 3 of the License, or (at your option) any later version. | ||
* | ||
* This library 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 library; if not, see | ||
* <http://www.gnu.org/licenses/>. | ||
*/ | ||
package org.jumpmind.symmetric.io; | ||
|
||
import org.jumpmind.symmetric.common.logging.ILog; | ||
import org.jumpmind.symmetric.common.logging.LogFactory; | ||
import org.jumpmind.symmetric.model.Node; | ||
import org.jumpmind.symmetric.service.IParameterService; | ||
import org.jumpmind.symmetric.service.impl.NodeService; | ||
|
||
public class DefaultOfflineClientListener implements IOfflineClientListener { | ||
protected ILog log = LogFactory.getLog(getClass()); | ||
protected IParameterService parameterService; | ||
|
||
|
||
private NodeService nodeService; | ||
|
||
|
||
public void busy(Node remoteNode) { | ||
log.warn("TransportFailedConnectionBusy"); | ||
} | ||
|
||
public void notAuthenticated(Node remoteNode) { | ||
log.warn("AuthenticationFailed"); | ||
} | ||
|
||
public void offline(Node remoteNode) { | ||
log.warn("TransportFailedConnectionUnavailable", | ||
(remoteNode.getSyncUrl() == null ? parameterService.getRegistrationUrl() : remoteNode | ||
.getSyncUrl())); | ||
} | ||
|
||
public void syncDisabled(Node remoteNode) { | ||
log.warn("SyncDisabledException"); | ||
nodeService.deleteIdentity(); | ||
} | ||
|
||
public boolean isAutoRegister() { | ||
return true; | ||
} | ||
|
||
public void setNodeService(NodeService nodeService) { | ||
this.nodeService = nodeService; | ||
} | ||
|
||
public void setParameterService(IParameterService parameterService) { | ||
this.parameterService = parameterService; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
symmetric/src/main/java/org/jumpmind/symmetric/service/IOfflineDetectorService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
package org.jumpmind.symmetric.service; | ||
|
||
import org.jumpmind.symmetric.io.IOfflineListener; | ||
import org.jumpmind.symmetric.io.IOfflineClientListener; | ||
|
||
public interface IOfflineDetectorService { | ||
|
||
public void addOfflineListener(IOfflineListener listener); | ||
public void addOfflineListener(IOfflineClientListener listener); | ||
|
||
public boolean removeOfflineListener(IOfflineListener listener); | ||
public boolean removeOfflineListener(IOfflineClientListener listener); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.