Skip to content

Commit fd1800f

Browse files
committed
Align OutputConfigurationQueryParameter/Configuration for sourceTypeId
In the OutputConfigurationQueryParameter the configuration source type id was called typeId and it creates a Configuration object where the same field is called sourceTypeId for the same field. When serializing the Configuration in the derived DataProviderDescriptor over TSP the field is called sourceTypeId and this is not consistent. The returned Configuration should have the exact field names that are used when creating the data provider and the respective configuration. The Configuration is already API while OutputConfigurationQueryParameter is not, and it's better to change the name there. Signed-off-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
1 parent b48240c commit fd1800f

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

trace-server/org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core/src/org/eclipse/tracecompass/incubator/internal/trace/server/jersey/rest/core/model/OutputConfigurationQueryParameters.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ public interface OutputConfigurationQueryParameters {
2525
* {@link ConfigurationSourceType}
2626
*/
2727
@Schema(required = true, description = "TypeId of the configuration according to the corresponding ConfigurationTypeDescriptor.")
28-
@JsonProperty("typeId")
29-
String getTypeId();
28+
@JsonProperty("sourceTypeId")
29+
String getSourceTypeId();
3030
}

trace-server/org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core/src/org/eclipse/tracecompass/incubator/internal/trace/server/jersey/rest/core/model/views/OutputConfigurationQueryParameters.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@
2020
* Definition of a parameters object received by the server from a client for configurations.
2121
*/
2222
public class OutputConfigurationQueryParameters extends ConfigurationQueryParameters {
23-
private @NonNull String typeId;
23+
private @NonNull String sourceTypeId;
2424

2525
/**
2626
* Constructor for Jackson
2727
*/
2828
public OutputConfigurationQueryParameters() {
2929
// Default constructor for Jackson
3030
super();
31-
this.typeId = TmfConfiguration.UNKNOWN;
31+
this.sourceTypeId = TmfConfiguration.UNKNOWN;
3232
}
3333

3434
/**
@@ -38,28 +38,28 @@ public OutputConfigurationQueryParameters() {
3838
* the name of the configuration
3939
* @param description
4040
* the description of the configuration
41-
* @param typeId
41+
* @param souruceTypeId
4242
* the typeId of the configuration
4343
*
4444
* @param parameters
4545
* Map of parameters
4646
*/
47-
public OutputConfigurationQueryParameters(String name, String description, String typeId, Map<String, Object> parameters) {
47+
public OutputConfigurationQueryParameters(String name, String description, String souruceTypeId, Map<String, Object> parameters) {
4848
super(name, description, parameters);
49-
this.typeId = typeId == null ? TmfConfiguration.UNKNOWN : typeId;
49+
this.sourceTypeId = souruceTypeId == null ? TmfConfiguration.UNKNOWN : souruceTypeId;
5050
}
5151

5252
/**
5353
* @return the type ID of configuration or {@link TmfConfiguration#UNKNOWN} if not provided
5454
*/
55-
@NonNull public String getTypeId() {
56-
return typeId;
55+
@NonNull public String getSourceTypeId() {
56+
return sourceTypeId;
5757
}
5858

5959
@SuppressWarnings("nls")
6060
@Override
6161
public String toString() {
6262
return "OutputConfigurationQueryParameters [name=" + getName() + ", description=" + getDescription()
63-
+", typeId=" + getTypeId() + ", parameters=" + getParameters() + "]";
63+
+", typeId=" + getSourceTypeId() + ", parameters=" + getParameters() + "]";
6464
}
6565
}

trace-server/org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core/src/org/eclipse/tracecompass/incubator/internal/trace/server/jersey/rest/core/services/DataProviderService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1309,7 +1309,7 @@ public Response createProvider(
13091309
ITmfConfiguration inputConfig = new TmfConfiguration.Builder()
13101310
.setName(queryParameters.getName())
13111311
.setDescription(queryParameters.getDescription())
1312-
.setSourceTypeId(queryParameters.getTypeId())
1312+
.setSourceTypeId(queryParameters.getSourceTypeId())
13131313
.setParameters(queryParameters.getParameters())
13141314
.build();
13151315
String typeId = inputConfig.getSourceTypeId();

0 commit comments

Comments
 (0)