diff --git a/hivemq-edge/src/main/java/com/hivemq/protocols/ProtocolAdapterFactoryManager.java b/hivemq-edge/src/main/java/com/hivemq/protocols/ProtocolAdapterFactoryManager.java index ca3d2494f..1ba065012 100644 --- a/hivemq-edge/src/main/java/com/hivemq/protocols/ProtocolAdapterFactoryManager.java +++ b/hivemq-edge/src/main/java/com/hivemq/protocols/ProtocolAdapterFactoryManager.java @@ -60,10 +60,15 @@ public ProtocolAdapterFactoryManager( } public @NotNull Map getAllAvailableAdapterTypes() { - return factoryMap.values() - .stream() - .map(ProtocolAdapterFactory::getInformation) - .collect(Collectors.toMap(ProtocolAdapterInformation::getProtocolId, o -> o)); + final Map protocolIdToInformation = new HashMap<>(); + for (final ProtocolAdapterFactory factory : factoryMap.values()) { + final ProtocolAdapterInformation information = factory.getInformation(); + protocolIdToInformation.put(information.getProtocolId(), information); + for (final String legacyProtocolId : information.getLegacyProtocolIds()) { + protocolIdToInformation.put(legacyProtocolId, information); + } + } + return protocolIdToInformation; } public void writingEnabledChanged(final boolean writingEnabled) { @@ -75,7 +80,7 @@ public static Map> findAllAdapters( final @NotNull ModuleLoader moduleLoader, final @NotNull EventService eventService, final boolean writingEnabled) { - Map> factoryMap = new HashMap<>(); + final Map> factoryMap = new HashMap<>(); final List> implementations = moduleLoader.findImplementations(ProtocolAdapterFactory.class); @@ -90,6 +95,9 @@ public static Map> findAllAdapters( } final ProtocolAdapterInformation information = protocolAdapterFactory.getInformation(); factoryMap.put(information.getProtocolId(), protocolAdapterFactory); + for (final String legacyProtocolId : information.getLegacyProtocolIds()) { + factoryMap.put(legacyProtocolId, protocolAdapterFactory); + } } catch (final InvocationTargetException | InstantiationException | IllegalAccessException | NoSuchMethodException e) { log.error("Not able to load module, reason: {}.", e.getMessage()); diff --git a/modules/hivemq-edge-module-etherip/src/main/java/com/hivemq/edge/adapters/etherip/EipProtocolAdapterInformation.java b/modules/hivemq-edge-module-etherip/src/main/java/com/hivemq/edge/adapters/etherip/EipProtocolAdapterInformation.java index c8191e0e3..91c1e3e55 100644 --- a/modules/hivemq-edge-module-etherip/src/main/java/com/hivemq/edge/adapters/etherip/EipProtocolAdapterInformation.java +++ b/modules/hivemq-edge-module-etherip/src/main/java/com/hivemq/edge/adapters/etherip/EipProtocolAdapterInformation.java @@ -54,6 +54,11 @@ private EipProtocolAdapterInformation() { return PROTOCOL_ID; } + @Override + public @NotNull List getLegacyProtocolIds() { + return List.of("ethernet-ip"); + } + @Override public @NotNull String getDisplayName() { return "Ethernet IP Protocol Adapter"; diff --git a/modules/hivemq-edge-module-file/src/main/java/com/hivemq/edge/adapters/file/FileProtocolAdapterInformation.java b/modules/hivemq-edge-module-file/src/main/java/com/hivemq/edge/adapters/file/FileProtocolAdapterInformation.java index 35f20e6e9..504297cb2 100644 --- a/modules/hivemq-edge-module-file/src/main/java/com/hivemq/edge/adapters/file/FileProtocolAdapterInformation.java +++ b/modules/hivemq-edge-module-file/src/main/java/com/hivemq/edge/adapters/file/FileProtocolAdapterInformation.java @@ -49,6 +49,11 @@ protected FileProtocolAdapterInformation() { return "File Protocol"; } + @Override + public @NotNull List getLegacyProtocolIds() { + return List.of("file_input", "file_polling_protocol"); + } + @Override public @NotNull String getProtocolId() { return PROTOCOL_ID; diff --git a/modules/hivemq-edge-module-opcua/src/main/java/com/hivemq/edge/adapters/opcua/OpcUaProtocolAdapterInformation.java b/modules/hivemq-edge-module-opcua/src/main/java/com/hivemq/edge/adapters/opcua/OpcUaProtocolAdapterInformation.java index d82c6ae71..4460ad8c9 100644 --- a/modules/hivemq-edge-module-opcua/src/main/java/com/hivemq/edge/adapters/opcua/OpcUaProtocolAdapterInformation.java +++ b/modules/hivemq-edge-module-opcua/src/main/java/com/hivemq/edge/adapters/opcua/OpcUaProtocolAdapterInformation.java @@ -55,6 +55,11 @@ private OpcUaProtocolAdapterInformation() { return PROTOCOL_ID; } + @Override + public @NotNull List getLegacyProtocolIds() { + return List.of("opc-ua-client"); + } + @Override public @NotNull String getDisplayName() { return "OPC UA Protocol Adapter";