Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
0001575: Offline data synchronization
- Loading branch information
Showing
22 changed files
with
1,124 additions
and
10 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
46 changes: 46 additions & 0 deletions
46
symmetric-client/src/main/java/org/jumpmind/symmetric/job/OfflinePullJob.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,46 @@ | ||
/** | ||
* 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.job; | ||
|
||
import org.jumpmind.symmetric.ISymmetricEngine; | ||
import org.jumpmind.symmetric.service.ClusterConstants; | ||
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; | ||
|
||
/* | ||
* Background job that pulls data from remote nodes and then loads it. | ||
*/ | ||
public class OfflinePullJob extends AbstractJob { | ||
|
||
public OfflinePullJob(ISymmetricEngine engine, ThreadPoolTaskScheduler taskScheduler) { | ||
super("job.offline.pull", false, engine.getParameterService().is("start.offline.pull.job"), | ||
engine, taskScheduler); | ||
} | ||
|
||
@Override | ||
public void doJob(boolean force) throws Exception { | ||
engine.getOfflinePullService().pullData(force); | ||
} | ||
|
||
public String getClusterLockName() { | ||
return ClusterConstants.OFFLINE_PULL; | ||
} | ||
|
||
} |
48 changes: 48 additions & 0 deletions
48
symmetric-client/src/main/java/org/jumpmind/symmetric/job/OfflinePushJob.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,48 @@ | ||
/** | ||
* 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.job; | ||
|
||
import org.jumpmind.symmetric.ISymmetricEngine; | ||
import org.jumpmind.symmetric.service.ClusterConstants; | ||
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; | ||
|
||
/* | ||
* Background job that is responsible for pushing data to linked nodes. | ||
*/ | ||
public class OfflinePushJob extends AbstractJob { | ||
|
||
public OfflinePushJob(ISymmetricEngine engine, ThreadPoolTaskScheduler taskScheduler) { | ||
super("job.offline.push", true, engine.getParameterService().is("start.offline.push.job"), engine, | ||
taskScheduler); | ||
} | ||
|
||
@Override | ||
public void doJob(boolean force) throws Exception { | ||
if (engine != null) { | ||
engine.getOfflinePushService().pushData(force).getDataProcessedCount(); | ||
} | ||
} | ||
|
||
public String getClusterLockName() { | ||
return ClusterConstants.OFFLINE_PUSH; | ||
} | ||
|
||
} |
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
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
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
35 changes: 35 additions & 0 deletions
35
symmetric-core/src/main/java/org/jumpmind/symmetric/service/IOfflinePullService.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,35 @@ | ||
/** | ||
* 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.service; | ||
|
||
import org.jumpmind.symmetric.model.Node; | ||
import org.jumpmind.symmetric.model.NodeGroupLinkAction; | ||
import org.jumpmind.symmetric.model.RemoteNodeStatuses; | ||
|
||
/** | ||
* Service API that is responsible for pulling data from the list of configured | ||
* {@link Node}s that are configured to {@link NodeGroupLinkAction#W} | ||
*/ | ||
public interface IOfflinePullService { | ||
|
||
public RemoteNodeStatuses pullData(boolean force); | ||
|
||
} |
35 changes: 35 additions & 0 deletions
35
symmetric-core/src/main/java/org/jumpmind/symmetric/service/IOfflinePushService.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,35 @@ | ||
/** | ||
* 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.service; | ||
|
||
import org.jumpmind.symmetric.model.Node; | ||
import org.jumpmind.symmetric.model.NodeGroupLinkAction; | ||
import org.jumpmind.symmetric.model.RemoteNodeStatuses; | ||
|
||
/** | ||
* Service API that is responsible for pushing data to the list of configured | ||
* {@link Node}s that are configured to {@link NodeGroupLinkAction#P} | ||
*/ | ||
public interface IOfflinePushService extends IOfflineDetectorService { | ||
|
||
public RemoteNodeStatuses pushData(boolean force); | ||
|
||
} |
Oops, something went wrong.