Skip to content
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 @@ -39,6 +39,7 @@ public class DataProviderDescriptorStub implements Serializable {
private final String fDescription;
private final String fTypeId;
private final TmfConfigurationStub fConfiguration;
private final TmfCapabilitiesStub fCapabilities;

/**
* {@link JsonCreator} Constructor for final fields
Expand All @@ -55,6 +56,8 @@ public class DataProviderDescriptorStub implements Serializable {
* the type id
* @param configuration
* the configuration
* @param capabilities
* the data provider capabilities
*
*/
@JsonCreator
Expand All @@ -63,13 +66,15 @@ public DataProviderDescriptorStub(@JsonProperty("parentId") String parentId,
@JsonProperty("name") String name,
@JsonProperty("description") String description,
@JsonProperty("type") String type,
@JsonProperty("configuration") TmfConfigurationStub configuration) {
@JsonProperty("configuration") TmfConfigurationStub configuration,
@JsonProperty("capabilities") TmfCapabilitiesStub capabilities) {
fParentId = parentId;
fId = id;
fName = name;
fDescription = description;
fTypeId = type;
fConfiguration = configuration;
fCapabilities = capabilities;
}

/**
Expand Down Expand Up @@ -126,15 +131,24 @@ public TmfConfigurationStub getConfiguration() {
return fConfiguration;
}

/**
* Gets the capabilities
*
* @return the capabilities
*/
public TmfCapabilitiesStub getCapabilities() {
return fCapabilities;
}

@Override
public String toString() {
return "DataProviderDescriptorStub[fParentId=" + getParentId() + ", fId=" + getId() + ", fName=" + fName + ", fDescription=" + fDescription
+ ", fTypeId=" + fTypeId + ", fConfiguration=" + getConfiguration() + "]";
+ ", fTypeId=" + fTypeId + ", fConfiguration=" + getConfiguration() + ", fCapabilities=" + getCapabilities() + "]";
}

@Override
public int hashCode() {
return Objects.hash(fParentId, fId, fName, fDescription, fTypeId, fConfiguration);
return Objects.hash(fParentId, fId, fName, fDescription, fTypeId, fConfiguration, fCapabilities);
}

@Override
Expand Down Expand Up @@ -167,6 +181,9 @@ public boolean equals(Object obj) {
if (Objects.equals(fConfiguration, other.fConfiguration)) {
return true;
}
if (!Objects.equals(fCapabilities, other.fCapabilities)) {
return false;
}
}
return false;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*******************************************************************************
* Copyright (c) 2025 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License 2.0 which
* accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
package org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core.tests.stubs;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
* Basic Implementation of the serialized capabilities model used by clients.
*
* @author Bernd Hufmann
*/
public class TmfCapabilitiesStub {

private final boolean fCanCreate;
private final boolean fCanDelete;

/**
* Constructor
*
* @param canCreate
* canCreate capability
* @param canDelete
* canDelete capability
*/
public TmfCapabilitiesStub(@JsonProperty("canCreate") Boolean canCreate,
@JsonProperty("canDelete") Boolean canDelete) {
fCanCreate = canCreate == null ? false : canCreate;
fCanDelete = canDelete == null ? false : canDelete;
}

/**
* @return the canCreate capability
*/
public boolean getCanCreate() {
return fCanCreate;
}

/**
* @return the canDelete capability
*/
public boolean getCanDelete() {
return fCanDelete;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ public abstract class RestServerTest {
"Flame Chart",
"Show a call stack over time",
ProviderType.TIME_GRAPH.name(),
null,
null);

/**
Expand Down Expand Up @@ -392,12 +393,12 @@ public static void beforeTest() throws IOException {
b.add(new DataProviderDescriptorStub(null, "org.eclipse.tracecompass.internal.analysis.timing.core.segmentstore.scatter.dataprovider:org.eclipse.linuxtools.lttng2.ust.analysis.callstack",
"LTTng-UST CallStack - Latency vs Time",
"Show latencies provided by Analysis module: LTTng-UST CallStack",
ProviderType.TREE_TIME_XY.name(), null));
ProviderType.TREE_TIME_XY.name(), null, null));
b.add(EXPECTED_CALLSTACK_PROVIDER_DESCRIPTOR);
b.add(new DataProviderDescriptorStub(null,"org.eclipse.tracecompass.internal.tmf.core.histogram.HistogramDataProvider",
"Histogram",
"Show a histogram of number of events to time for a trace",
ProviderType.TREE_TIME_XY.name(), null));
ProviderType.TREE_TIME_XY.name(), null, null));
sfExpectedDataProviderDescriptorStub = b.build();
}

Expand Down
Loading