Skip to content

Commit

Permalink
0005430: Android not implemented exception when sym_monitor syncs
Browse files Browse the repository at this point in the history
  • Loading branch information
erilong committed Aug 30, 2022
1 parent 92612ee commit 3f9b7ec
Show file tree
Hide file tree
Showing 4 changed files with 157 additions and 13 deletions.
@@ -0,0 +1,140 @@
/**
* 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.android;

import java.util.List;

import org.jumpmind.symmetric.ISymmetricEngine;
import org.jumpmind.symmetric.model.Monitor;
import org.jumpmind.symmetric.model.MonitorEvent;
import org.jumpmind.symmetric.model.Notification;
import org.jumpmind.symmetric.service.IMonitorService;

public class AndroidMonitorService implements IMonitorService {
public AndroidMonitorService(ISymmetricEngine engine) {
}

@Override
public void update() {
}

@Override
public List<Monitor> getMonitors() {
return null;
}

@Override
public List<Monitor> getActiveMonitorsForNode(String nodeGroupId, String externalId) {
return null;
}

@Override
public List<Monitor> getActiveMonitorsForNodeFromDb(String nodeGroupId, String externalId) {
return null;
}

@Override
public void deleteMonitor(String notificationId) {
}

@Override
public void saveMonitor(Monitor monitor) {
}

@Override
public void saveMonitorAsCopy(Monitor monitor) {
}

@Override
public void renameMonitor(String oldId, Monitor monitor) {
}

@Override
public List<MonitorEvent> getMonitorEvents() {
return null;
}

@Override
public List<MonitorEvent> getMonitorEventsFiltered(int limit, String type, int severityLevel, String nodeId, Boolean isResolved) {
return null;
}

@Override
public void saveMonitorEvent(MonitorEvent notificationEvent) {
}

@Override
public void deleteMonitorEvent(MonitorEvent event) {
}

@Override
public void updateMonitorEventAsResolved(MonitorEvent event) {
}

@Override
public List<Notification> getNotifications() {
return null;
}

@Override
public List<Notification> getActiveNotificationsForNode(String nodeGroupId, String externalId) {
return null;
}

@Override
public List<Notification> getActiveNotificationsForNodeFromDb(String nodeGroupId, String externalId) {
return null;
}

@Override
public void saveNotification(Notification notification) {
}

@Override
public void saveNotificationAsCopy(Notification notification) {
}

@Override
public void renameNotification(String oldId, Notification notification) {
}

@Override
public void deleteNotification(String notificationId) {
}

@Override
public void flushMonitorCache() {
}

@Override
public void flushNotificationCache() {
}

@Override
public List<Monitor> getActiveMonitorsUnresolvedForNode(String nodeGroupId, String externalId) {
return null;
}

@Override
public List<Monitor> getActiveMonitorsUnresolvedForNodeFromDb(String nodeGroupId, String externalId) {
return null;
}
}
Expand Up @@ -25,7 +25,6 @@
import java.util.List;
import java.util.Properties;

import org.apache.commons.lang3.NotImplementedException;
import org.jumpmind.db.platform.IDatabasePlatform;
import org.jumpmind.extension.IProgressListener;
import org.jumpmind.properties.TypedProperties;
Expand Down Expand Up @@ -141,6 +140,11 @@ protected IFileSyncService buildFileSyncService() {
return new AndroidFileSyncService(this);
}

@Override
protected IMonitorService buildMonitorService(ISymmetricDialect symmetricDialect) {
return new AndroidMonitorService(this);
}

@Override
protected IClusterService createClusterService() {
return new AndroidClusterService(parameterService, symmetricDialect, nodeService);
Expand Down Expand Up @@ -221,8 +225,4 @@ public File snapshot(IProgressListener listener) {
public List<File> listSnapshots() {
return new ArrayList<>(0);
}

public IMonitorService getMonitorService() {
throw new NotImplementedException();
}
}
Expand Up @@ -67,9 +67,7 @@
import org.jumpmind.symmetric.job.JobManager;
import org.jumpmind.symmetric.security.INodePasswordFilter;
import org.jumpmind.symmetric.service.IExtensionService;
import org.jumpmind.symmetric.service.IMonitorService;
import org.jumpmind.symmetric.service.impl.ClientExtensionService;
import org.jumpmind.symmetric.service.impl.MonitorService;
import org.jumpmind.symmetric.service.impl.NodeService;
import org.jumpmind.symmetric.statistic.IStatisticManager;
import org.jumpmind.symmetric.statistic.StatisticManager;
Expand Down Expand Up @@ -97,7 +95,6 @@ public class ClientSymmetricEngine extends AbstractSymmetricEngine {
protected Properties properties;
protected DataSource dataSource;
protected ApplicationContext springContext;
protected IMonitorService monitorService;

/**
* @param dataSource
Expand Down Expand Up @@ -197,7 +194,6 @@ protected void init() {
SymmetricUtils.logNotices();
}
super.init();
this.monitorService = new MonitorService(this, symmetricDialect);
this.dataSource = platform.getDataSource();
PropertySourcesPlaceholderConfigurer configurer = new PropertySourcesPlaceholderConfigurer();
configurer.setProperties(parameterService.getAllParameters());
Expand Down Expand Up @@ -515,8 +511,4 @@ public void clearCaches() {
monitorService.flushMonitorCache();
monitorService.flushNotificationCache();
}

public IMonitorService getMonitorService() {
return monitorService;
}
}
Expand Up @@ -85,6 +85,7 @@
import org.jumpmind.symmetric.service.IInitialLoadService;
import org.jumpmind.symmetric.service.ILoadFilterService;
import org.jumpmind.symmetric.service.IMailService;
import org.jumpmind.symmetric.service.IMonitorService;
import org.jumpmind.symmetric.service.INodeCommunicationService;
import org.jumpmind.symmetric.service.INodeService;
import org.jumpmind.symmetric.service.IOfflinePullService;
Expand Down Expand Up @@ -116,6 +117,7 @@
import org.jumpmind.symmetric.service.impl.InitialLoadService;
import org.jumpmind.symmetric.service.impl.LoadFilterService;
import org.jumpmind.symmetric.service.impl.MailService;
import org.jumpmind.symmetric.service.impl.MonitorService;
import org.jumpmind.symmetric.service.impl.NodeCommunicationService;
import org.jumpmind.symmetric.service.impl.NodeService;
import org.jumpmind.symmetric.service.impl.OfflinePullService;
Expand Down Expand Up @@ -196,6 +198,7 @@ abstract public class AbstractSymmetricEngine implements ISymmetricEngine {
protected IMailService mailService;
protected IContextService contextService;
protected IUpdateService updateService;
protected IMonitorService monitorService;
protected ICacheManager cacheManager;
protected Date lastRestartTime = null;

Expand Down Expand Up @@ -333,6 +336,7 @@ protected void init() {
this.fileSyncService = buildFileSyncService();
this.fileSyncExtractorService = new FileSyncExtractorService(this);
this.mailService = new MailService(parameterService, securityService, symmetricDialect);
this.monitorService = buildMonitorService(symmetricDialect);
String updateServiceClassName = properties.get(ParameterConstants.UPDATE_SERVICE_CLASS);
if (updateServiceClassName == null) {
this.updateService = new UpdateService(this);
Expand Down Expand Up @@ -386,6 +390,10 @@ protected INodeCommunicationService buildNodeCommunicationService(IClusterServic
return new NodeCommunicationService(clusterService, nodeService, parameterService, configurationService, symmetricDialect);
}

protected IMonitorService buildMonitorService(ISymmetricDialect symmetricDialect) {
return new MonitorService(this, symmetricDialect);
}

abstract protected IStagingManager createStagingManager();

abstract protected IStatisticManager createStatisticManager();
Expand Down Expand Up @@ -1217,6 +1225,10 @@ public IUpdateService getUpdateService() {
return updateService;
}

public IMonitorService getMonitorService() {
return monitorService;
}

@Override
public String getNodeId() {
return getNodeService().findIdentityNodeId();
Expand Down

0 comments on commit 3f9b7ec

Please sign in to comment.