Skip to content
Open
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
3 changes: 2 additions & 1 deletion tmf/org.eclipse.tracecompass.tmf.core/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.tracecompass.tmf.filter.parser,
org.eclipse.jdt.annotation;bundle-version="[2.0.0,3.0.0)";resolution:=optional,
org.apache.commons.lang3
Export-Package: org.eclipse.tracecompass.internal.provisional.tmf.core.model,
Export-Package: org.eclipse.tracecompass.internal.provisional.tmf.core.dataprovider;x-internal:=true,
org.eclipse.tracecompass.internal.provisional.tmf.core.model,
org.eclipse.tracecompass.internal.provisional.tmf.core.model.events;x-friends:="org.eclipse.tracecompass.tmf.core.tests,org.eclipse.tracecompass.analysis.timing.core.tests",
org.eclipse.tracecompass.internal.provisional.tmf.core.model.filter.parser;x-friends:="org.eclipse.tracecompass.tmf.ui,org.eclipse.tracecompass.tmf.core.tests",
org.eclipse.tracecompass.internal.provisional.tmf.core.model.filters;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*******************************************************************************
* 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.internal.provisional.tmf.core.dataprovider;

import org.eclipse.tracecompass.tmf.core.dataprovider.IDataProviderDescriptor;
import org.eclipse.tracecompass.tmf.core.response.TmfModelResponse;
import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;

/**
* Interface for data providers that can fetch custom data based on the provider.
* Data providers that need to return specialized data types (images, reports, etc.)
* can implement this interface and define the data fetching logic.
*
* @author Kaveh Shahedi
* @since 10.3
*/
public interface ITmfDataProviderDataFetcher {

/**
* Get the data for a specific trace and data provider.
*
* @param trace
* The trace to get the data for
* @param descriptor
* The descriptor of the data provider
* @return The report data
* @throws Exception
* If the data cannot be retrieved
*/
TmfModelResponse<TmfDataProviderDataModel<?>> getData(ITmfTrace trace, IDataProviderDescriptor descriptor) throws Exception;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/*******************************************************************************
* 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.internal.provisional.tmf.core.dataprovider;

/**
* Data model for the data provider configuration data. This class is used to
* hold the data that is returned by the data provider configuration.
*
* @author Kaveh Shahedi
*
* @param <T> Type of the content
*/
public class TmfDataProviderDataModel<T> {

private T fContent;
private String fContentType;
private String fContentName;

/**
* Constructor
*
* @param content
* The content of the data model
* @param contentType
* The type of the content
* @param contentName
* The name of the content
*/
public TmfDataProviderDataModel(T content, String contentType, String contentName) {
fContent = content;
fContentType = contentType;
fContentName = contentName;
}

/**
* Get the content of the data model.
*
* @return The content of the data model
*/
public T getContent() {
return fContent;
}

/**
* Get the type of the content.
* This is used to identify the type of content that is returned by,
* for instance, MIME type (e.g., application/octet-stream for binary data).
*
* @return The type of the content
*/
public String getContentType() {
return fContentType;
}

/**
* Get the name of the content.
* This is used to identify the name the content if required,
* as it could be saved to a file.
*
* @return The name of the content
*/
public String getContentName() {
return fContentName;
}
}
Loading