Skip to content

Commit

Permalink
server: serialize new parentId and configuration in DP descriptor
Browse files Browse the repository at this point in the history
Signed-off-by: Bernd Hufmann <[email protected]>
  • Loading branch information
bhufmann committed Oct 18, 2024
1 parent da80c74 commit ee587b0
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2018 Ericsson
* Copyright (c) 2018, 2024 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License 2.0 which
Expand All @@ -13,6 +13,7 @@

import java.io.IOException;

import org.eclipse.tracecompass.tmf.core.config.ITmfConfiguration;
import org.eclipse.tracecompass.tmf.core.dataprovider.IDataProviderDescriptor;

import com.fasterxml.jackson.core.JsonGenerator;
Expand Down Expand Up @@ -42,10 +43,18 @@ public DataProviderDescriptorSerializer() {
@Override
public void serialize(IDataProviderDescriptor value, JsonGenerator gen, SerializerProvider provider) throws IOException {
gen.writeStartObject();
String parentId = value.getParentId();
if (parentId != null) {
gen.writeStringField("parentId", value.getParentId()); //$NON-NLS-1$
}
gen.writeStringField("id", value.getId()); //$NON-NLS-1$
gen.writeStringField("name", value.getName()); //$NON-NLS-1$
gen.writeStringField("description", value.getDescription()); //$NON-NLS-1$
gen.writeStringField("type", value.getType().name()); //$NON-NLS-1$
ITmfConfiguration config = value.getConfiguration();
if (config != null) {
gen.writeObjectField("configuration", config); //$NON-NLS-1$
}
gen.writeEndObject();
}

Expand Down

0 comments on commit ee587b0

Please sign in to comment.