100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps
Java asset-managementbuildingdashboarddataplatformdevice-managementedge-computingenergyenergy-managementenergy-monitorfleet-managementfleet-telematicsiotiot-applicationiot-platformmodbusmqttmqtt-brokerota-updaterules-enginesmartcity
Added ModelIgnore annotation and marked unmaintained agents to the ignore list
Rich Turner73212f67234d
diff --git a/agent/src/main/java/org/openremote/agent/protocol/artnet/ArtnetAgent.java b/agent/src/main/java/org/openremote/agent/protocol/artnet/ArtnetAgent.javaindex aec8fae03..98efeca55 100644--- a/agent/src/main/java/org/openremote/agent/protocol/artnet/ArtnetAgent.java+++ b/agent/src/main/java/org/openremote/agent/protocol/artnet/ArtnetAgent.java@@ -22,9 +22,12 @@ package org.openremote.agent.protocol.artnet;import org.openremote.agent.protocol.io.IoAgent;import org.openremote.model.asset.agent.AgentDescriptor;import org.openremote.model.asset.agent.AgentLink;+import org.openremote.model.util.ModelIgnore;import javax.persistence.Entity;++@ModelIgnore@Entitypublic class ArtnetAgent extends IoAgent<ArtnetAgent, ArtnetProtocol, AgentLink.Default> {diff --git a/agent/src/main/java/org/openremote/agent/protocol/controller/ControllerAgent.java b/agent/src/main/java/org/openremote/agent/protocol/controller/ControllerAgent.javaindex ea99280eb..6368fbb58 100644--- a/agent/src/main/java/org/openremote/agent/protocol/controller/ControllerAgent.java+++ b/agent/src/main/java/org/openremote/agent/protocol/controller/ControllerAgent.java@@ -22,6 +22,7 @@ package org.openremote.agent.protocol.controller;import org.openremote.model.asset.agent.Agent;import org.openremote.model.asset.agent.AgentDescriptor;import org.openremote.model.asset.agent.AgentLink;+import org.openremote.model.util.ModelIgnore;import org.openremote.model.value.AttributeDescriptor;import org.openremote.model.value.ValueType;@@ -30,6 +31,7 @@ import java.util.List;import java.util.Map;import java.util.Optional;+@ModelIgnore@Entitypublic class ControllerAgent extends Agent<ControllerAgent, ControllerProtocol, ControllerAgent.ControllerAgentLink> {diff --git a/agent/src/main/java/org/openremote/agent/protocol/tradfri/TradfriAgent.java b/agent/src/main/java/org/openremote/agent/protocol/tradfri/TradfriAgent.javaindex 7da403ab3..05d982002 100644--- a/agent/src/main/java/org/openremote/agent/protocol/tradfri/TradfriAgent.java+++ b/agent/src/main/java/org/openremote/agent/protocol/tradfri/TradfriAgent.java@@ -22,12 +22,14 @@ package org.openremote.agent.protocol.tradfri;import org.openremote.model.asset.agent.Agent;import org.openremote.model.asset.agent.AgentDescriptor;import org.openremote.model.asset.agent.AgentLink;+import org.openremote.model.util.ModelIgnore;import org.openremote.model.value.AttributeDescriptor;import org.openremote.model.value.ValueType;import javax.persistence.Entity;import java.util.Optional;+@ModelIgnore@Entitypublic class TradfriAgent extends Agent<TradfriAgent, TradfriProtocol, AgentLink.Default> {diff --git a/agent/src/main/java/org/openremote/agent/protocol/zwave/NettyConnectionManager.java b/agent/src/main/java/org/openremote/agent/protocol/zwave/NettyConnectionManager.javaindex b407a3d04..02da66233 100644--- a/agent/src/main/java/org/openremote/agent/protocol/zwave/NettyConnectionManager.java+++ b/agent/src/main/java/org/openremote/agent/protocol/zwave/NettyConnectionManager.java@@ -25,16 +25,16 @@ import org.openremote.protocol.zwave.port.ZWavePortConfiguration;public class NettyConnectionManager extends DefaultZWConnectionManager {- public static NettyConnectionManager create(ZWavePortConfiguration configuration, ZWSerialIoClient messageProcessor) {+ public static NettyConnectionManager create(ZWavePortConfiguration configuration, ZWaveSerialIoClient messageProcessor) {NettyConnectionManager mgr = new NettyConnectionManager(configuration, messageProcessor);mgr.createControllerAPI();mgr.addShutdownHook();return mgr;}- private final ZWSerialIoClient ioClient;+ private final ZWaveSerialIoClient ioClient;- protected NettyConnectionManager(ZWavePortConfiguration configuration, ZWSerialIoClient ioClient) {+ protected NettyConnectionManager(ZWavePortConfiguration configuration, ZWaveSerialIoClient ioClient) {super(configuration);this.ioClient = ioClient;}diff --git a/model/src/main/java/org/openremote/model/util/AssetModelUtil.java b/model/src/main/java/org/openremote/model/util/AssetModelUtil.javaindex 64df2e09b..fa4db7997 100644--- a/model/src/main/java/org/openremote/model/util/AssetModelUtil.java+++ b/model/src/main/java/org/openremote/model/util/AssetModelUtil.java@@ -510,6 +510,7 @@ public final class AssetModelUtil {assetClasses = reflections.getSubTypesOf(Asset.class).stream().map(assetClass -> (Class<? extends Asset<?>>)assetClass)+ .filter(assetClass -> assetClass.getAnnotation(ModelIgnore.class) == null).collect(Collectors.toSet());LOG.fine("Found asset class count = " + assetClasses.size());diff --git a/model/src/main/java/org/openremote/model/util/ModelIgnore.java b/model/src/main/java/org/openremote/model/util/ModelIgnore.javanew file mode 100644index 000000000..5b45f02da--- /dev/null+++ b/model/src/main/java/org/openremote/model/util/ModelIgnore.java@@ -0,0 +1,33 @@+/*+ * Copyright 2021, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program 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 Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */+package org.openremote.model.util;++import java.lang.annotation.ElementType;+import java.lang.annotation.Retention;+import java.lang.annotation.RetentionPolicy;+import java.lang.annotation.Target;++/**+ * Annotation for telling the Asset model scanner to ignore the annotated type+ */+@Target({ElementType.TYPE})+@Retention(RetentionPolicy.RUNTIME)+public @interface ModelIgnore {+}