Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polishing for release #701

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public static ProtocolAdapter convertInstalledAdapterType(
}

final ProtocolAdapterSchemaManager protocolAdapterSchemaManager =
new ProtocolAdapterSchemaManager(objectMapper, adapterManager.writingEnabled() ? info.configurationClassWritingAndReading() : info.configurationClassReading());
new ProtocolAdapterSchemaManager(objectMapper, adapterManager.writingEnabled() ? info.configurationClassNorthAndSouthbound() : info.configurationClassNorthbound());


final String rawVersion = info.getVersion();
Expand Down Expand Up @@ -126,7 +126,7 @@ public static ProtocolAdapter convertInstalledAdapterType(
if (uiSchemaAsString != null) {
try {
return objectMapper.reader().withFeatures(JsonParser.Feature.ALLOW_COMMENTS).readTree(uiSchemaAsString);
} catch (JsonProcessingException e) {
} catch (final JsonProcessingException e) {
LOG.warn("Ui schema for adapter '{}' is not parsable, the default schema will be applied. ",
info.getDisplayName(),
e);
Expand All @@ -136,7 +136,7 @@ public static ProtocolAdapter convertInstalledAdapterType(

try {
return objectMapper.readTree(DEFAULT_SCHEMA);
} catch (JsonProcessingException e) {
} catch (final JsonProcessingException e) {
LOG.error("Exception during parsing of default schema: ", e);
// this should never happen as we control the input (default schema)
throw new RuntimeException(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
import com.hivemq.api.errors.adapters.AdapterTypeNotFoundError;
import com.hivemq.api.errors.adapters.AdapterTypeReadOnlyError;
import com.hivemq.api.errors.adapters.DomainTagNotFoundError;
import com.hivemq.api.format.DataUrl;
import com.hivemq.api.json.CustomConfigSchemaGenerator;
import com.hivemq.api.model.ApiConstants;
import com.hivemq.api.model.ApiErrorMessages;
Expand Down Expand Up @@ -430,8 +429,8 @@ protected void validateAdapterSchema(

final ProtocolAdapterSchemaManager protocolAdapterSchemaManager = new ProtocolAdapterSchemaManager(objectMapper,
protocolAdapterWritingService.writingEnabled() ?
information.configurationClassWritingAndReading() :
information.configurationClassReading());
information.configurationClassNorthAndSouthbound() :
information.configurationClassNorthbound());
final ProtocolAdapterValidator validator =
(objectMapper, config) -> protocolAdapterSchemaManager.validateObject(config);
final List<ProtocolAdapterValidationFailure> errors =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public ProtocolAdapterCategory getCategory() {
return null;
}
return IOUtils.toString(is, StandardCharsets.UTF_8);
} catch (Exception e) {
} catch (final Exception e) {
log.warn("The UISchema for the Simulation Adapter could not be loaded from resources:", e);
return null;
}
Expand All @@ -121,12 +121,12 @@ public ProtocolAdapterCategory getCategory() {
}

@Override
public @NotNull Class<? extends ProtocolSpecificAdapterConfig> configurationClassReading() {
public @NotNull Class<? extends ProtocolSpecificAdapterConfig> configurationClassNorthbound() {
return SimulationSpecificAdapterConfig.class;
}

@Override
public @NotNull Class<? extends ProtocolSpecificAdapterConfig> configurationClassWritingAndReading() {
public @NotNull Class<? extends ProtocolSpecificAdapterConfig> configurationClassNorthAndSouthbound() {
return SimulationSpecificAdapterConfig.class;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -330,12 +330,12 @@ static class TestWritingProtocolAdapterInformation implements ProtocolAdapterInf
}

@Override
public @org.jetbrains.annotations.NotNull Class<? extends ProtocolSpecificAdapterConfig> configurationClassReading() {
public @org.jetbrains.annotations.NotNull Class<? extends ProtocolSpecificAdapterConfig> configurationClassNorthbound() {
return null;
}

@Override
public @org.jetbrains.annotations.NotNull Class<? extends ProtocolSpecificAdapterConfig> configurationClassWritingAndReading() {
public @org.jetbrains.annotations.NotNull Class<? extends ProtocolSpecificAdapterConfig> configurationClassNorthAndSouthbound() {
return null;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,12 @@ public List<ProtocolAdapterTag> getTags() {
}

@Override
public @NotNull Class<? extends ProtocolSpecificAdapterConfig> configurationClassReading() {
public @NotNull Class<? extends ProtocolSpecificAdapterConfig> configurationClassNorthbound() {
return EipSpecificAdapterConfig.class;
}

@Override
public @NotNull Class<? extends ProtocolSpecificAdapterConfig> configurationClassWritingAndReading() {
public @NotNull Class<? extends ProtocolSpecificAdapterConfig> configurationClassNorthAndSouthbound() {
return EipSpecificAdapterConfig.class;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,12 @@ public List<ProtocolAdapterTag> getTags() {
}

@Override
public @NotNull Class<? extends ProtocolSpecificAdapterConfig> configurationClassReading() {
public @NotNull Class<? extends ProtocolSpecificAdapterConfig> configurationClassNorthbound() {
return FileSpecificAdapterConfig.class;
}

@Override
public @NotNull Class<? extends ProtocolSpecificAdapterConfig> configurationClassWritingAndReading() {
public @NotNull Class<? extends ProtocolSpecificAdapterConfig> configurationClassNorthAndSouthbound() {
return FileSpecificAdapterConfig.class;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,12 @@ public List<ProtocolAdapterTag> getTags() {
}

@Override
public @NotNull Class<? extends ProtocolSpecificAdapterConfig> configurationClassReading() {
public @NotNull Class<? extends ProtocolSpecificAdapterConfig> configurationClassNorthbound() {
return HttpSpecificAdapterConfig.class;
}

@Override
public @NotNull Class<? extends ProtocolSpecificAdapterConfig> configurationClassWritingAndReading() {
public @NotNull Class<? extends ProtocolSpecificAdapterConfig> configurationClassNorthAndSouthbound() {
return BidirectionalHttpSpecificAdapterConfig.class;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,12 @@ public List<ProtocolAdapterTag> getTags() {
}

@Override
public @NotNull Class<? extends ProtocolSpecificAdapterConfig> configurationClassReading() {
public @NotNull Class<? extends ProtocolSpecificAdapterConfig> configurationClassNorthbound() {
return ModbusSpecificAdapterConfig.class;
}

@Override
public @NotNull Class<? extends ProtocolSpecificAdapterConfig> configurationClassWritingAndReading() {
public @NotNull Class<? extends ProtocolSpecificAdapterConfig> configurationClassNorthAndSouthbound() {
return ModbusSpecificAdapterConfig.class;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,12 @@ private OpcUaProtocolAdapterInformation() {
}

@Override
public @NotNull Class<? extends ProtocolSpecificAdapterConfig> configurationClassReading() {
public @NotNull Class<? extends ProtocolSpecificAdapterConfig> configurationClassNorthbound() {
return OpcUaSpecificAdapterConfig.class;
}

@Override
public @NotNull Class<? extends ProtocolSpecificAdapterConfig> configurationClassWritingAndReading() {
public @NotNull Class<? extends ProtocolSpecificAdapterConfig> configurationClassNorthAndSouthbound() {
return BidirectionalOpcUaSpecificAdapterConfig.class;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,12 @@ public List<ProtocolAdapterTag> getTags() {
}

@Override
public @NotNull Class<? extends ProtocolSpecificAdapterConfig> configurationClassReading() {
public @NotNull Class<? extends ProtocolSpecificAdapterConfig> configurationClassNorthbound() {
return ADSSpecificAdapterConfig.class;
}

@Override
public @NotNull Class<? extends ProtocolSpecificAdapterConfig> configurationClassWritingAndReading() {
public @NotNull Class<? extends ProtocolSpecificAdapterConfig> configurationClassNorthAndSouthbound() {
return ADSSpecificAdapterConfig.class;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,12 @@ public List<ProtocolAdapterTag> getTags() {
}

@Override
public @NotNull Class<? extends ProtocolSpecificAdapterConfig> configurationClassReading() {
public @NotNull Class<? extends ProtocolSpecificAdapterConfig> configurationClassNorthbound() {
return S7SpecificAdapterConfig.class;
}

@Override
public @NotNull Class<? extends ProtocolSpecificAdapterConfig> configurationClassWritingAndReading() {
public @NotNull Class<? extends ProtocolSpecificAdapterConfig> configurationClassNorthAndSouthbound() {
return S7SpecificAdapterConfig.class;
}
}
Loading