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

Cherry picks to 2021-06 of recent merges to master #128

Merged
merged 6 commits into from
Nov 27, 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
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?>
<target name="tracecompass-incubator-e4.20" sequenceNumber="8">
<target name="tracecompass-incubator-e4.20" sequenceNumber="9">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.cdt.gnu.dsf.feature.group" version="0.0.0"/>
Expand Down Expand Up @@ -171,7 +171,7 @@
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.tracecompass.testtraces.tracecompass-test-traces-ctf" version="0.0.0"/>
<unit id="org.eclipse.tracecompass.testtraces.tracecompass-test-traces-ftrace" version="0.0.0"/>
<repository location="https://archive.eclipse.org/tracecompass/tracecompass-test-traces/repository/1.9.0/"/>
<repository location="https://archive.eclipse.org/tracecompass/tracecompass-test-traces/repository/1.10.0/"/>
</location>
<location includeDependencyDepth="infinite" includeDependencyScopes="provided,compile,system,runtime" includeSource="true" missingManifest="generate" type="Maven">
<dependencies>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?>
<target name="tracecompass-incubator-master" sequenceNumber="73">
<target name="tracecompass-incubator-master" sequenceNumber="74">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.cdt.gnu.dsf.feature.group" version="0.0.0"/>
Expand Down Expand Up @@ -169,7 +169,7 @@
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.tracecompass.testtraces.tracecompass-test-traces-ctf" version="0.0.0"/>
<unit id="org.eclipse.tracecompass.testtraces.tracecompass-test-traces-ftrace" version="0.0.0"/>
<repository location="https://archive.eclipse.org/tracecompass/tracecompass-test-traces/repository/1.9.0/"/>
<repository location="https://archive.eclipse.org/tracecompass/tracecompass-test-traces/repository/1.10.0/"/>
</location>
<location includeDependencyDepth="infinite" includeDependencyScopes="provided,compile,system,runtime" includeSource="true" missingManifest="generate" type="Maven">
<dependencies>
Expand Down Expand Up @@ -238,4 +238,4 @@
-Xmx512M</vmArgs>
<programArgs>-consolelog</programArgs>
</launcherArgs>
</target>
</target>

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
/*******************************************************************************
* Copyright (c) 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
* 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 java.io.Serializable;
import java.util.Objects;
import java.util.UUID;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
* A Stub class for the bookmark model. It matches the trace server protocol's
* <code>BookmarkModel</code> schema
*
* @author Kaveh Shahedi
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class BookmarkModelStub implements Serializable {
private static final long serialVersionUID = -1945923534635091200L;

private final UUID fUUID;
private final String fName;
private final long fStart;
private final long fEnd;

/**
* {@link JsonCreator} Constructor for final fields
*
* @param uuid
* The bookmark's UUID
* @param name
* The bookmark name
* @param start
* The start time
* @param end
* The end time
*/
@JsonCreator
public BookmarkModelStub(
@JsonProperty("uuid") UUID uuid,
@JsonProperty("name") String name,
@JsonProperty("start") long start,
@JsonProperty("end") long end) {
fUUID = Objects.requireNonNull(uuid, "The 'UUID' json field was not set");
fName = Objects.requireNonNull(name, "The 'name' json field was not set");
fStart = start;
fEnd = end;
}

/**
* Constructor for comparing equality
*
* @param name
* bookmark name
* @param start
* start time
* @param end
* end time
*/
public BookmarkModelStub(String name, long start, long end) {
this(UUID.randomUUID(), name, start, end);
}

/**
* Get the UUID
*
* @return The UUID
*/
public UUID getUUID() {
return fUUID;
}

/**
* Get the bookmark name
*
* @return The bookmark name
*/
public String getName() {
return fName;
}

/**
* Get the start time
*
* @return The start time
*/
public long getStart() {
return fStart;
}

/**
* Get the end time
*
* @return The end time
*/
public long getEnd() {
return fEnd;
}

@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
BookmarkModelStub other = (BookmarkModelStub) obj;
if (fEnd != other.fEnd) {
return false;
}
if (fName == null) {
if (other.fName != null) {
return false;
}
} else if (!fName.equals(other.fName)) {
return false;
}
if (fStart != other.fStart) {
return false;
}
if (fUUID == null) {
if (other.fUUID != null) {
return false;
}
} else if (!fUUID.equals(other.fUUID)) {
return false;
}
return true;
}


@Override
public String toString() {
return "BookmarkModelStub [fUUID=" + fUUID + ", fName=" + fName + ", fStart=" + fStart + ", fEnd=" + fEnd + "]";
}

@Override
public int hashCode() {
return super.hashCode();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

package org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core.tests.stubs.webapp;

import org.eclipse.tracecompass.incubator.internal.trace.server.jersey.rest.core.services.BookmarkManagerService;
import org.eclipse.tracecompass.incubator.internal.trace.server.jersey.rest.core.services.ConfigurationManagerService;
import org.eclipse.tracecompass.incubator.internal.trace.server.jersey.rest.core.services.ExperimentManagerService;
import org.eclipse.tracecompass.incubator.internal.trace.server.jersey.rest.core.services.FilterService;
Expand Down Expand Up @@ -52,5 +53,6 @@ protected void registerResourcesAndMappers(ResourceConfig rc) {
rc.register(CORSFilter.class);
rc.register(JacksonObjectMapperProvider.class);
rc.register(OpenApiResource.class);
rc.register(BookmarkManagerService.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ public abstract class RestServerTest {
* Experiments endpoint path (relative to application).
*/
public static final String EXPERIMENTS = "experiments";
/**
* Bookmarks endpoint path (relative to application).
*/
public static final String BOOKMARKS = "bookmarks";

/**
* Outputs path segment
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*******************************************************************************
* Copyright (c) 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
* 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.internal.trace.server.jersey.rest.core.model;

import java.util.UUID;

import org.eclipse.jdt.annotation.NonNull;

import com.fasterxml.jackson.annotation.JsonProperty;

import io.swagger.v3.oas.annotations.media.Schema;

/**
* Contributes to the model used for TSP swagger-core annotations.
*
* @author Kaveh Shahedi
*/
public interface Bookmark {

/**
* @return The bookmark UUID.
*/
@JsonProperty("uuid")
@Schema(description = "The bookmark's unique identifier")
UUID getUUID();

/**
* @return The bookmark name.
*/
@NonNull
@Schema(description = "User defined name for the bookmark")
String getName();

/**
* @return The start time.
*/
@Schema(description = "The bookmark's start time")
long getStart();

/**
* @return The end time.
*/
@Schema(description = "The bookmark's end time")
long getEnd();

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/*******************************************************************************
* Copyright (c) 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
* 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.internal.trace.server.jersey.rest.core.model;

import com.fasterxml.jackson.annotation.JsonProperty;

import io.swagger.v3.oas.annotations.media.Schema;

/**
* Parameters for bookmark creation and update operations
*
* @author Kaveh Shahedi
*/
public interface BookmarkQueryParameters {

/**
* @return The bookmark parameters
*/
@JsonProperty("parameters")
@Schema(description = "The bookmark parameters", required = true)
BookmarkParameters getParameters();


/**
* Bookmark parameters
*/
interface BookmarkParameters {
/**
* @return The bookmark name
*/
@JsonProperty("name")
@Schema(description = "The name to give this bookmark", required = true)
String getName();

/**
* @return The start time
*/
@JsonProperty("start")
@Schema(description = "The bookmark's start time", required = true)
long getStart();

/**
* @return The end time
*/
@JsonProperty("end")
@Schema(description = "The bookmark's end time", required = true)
long getEnd();
}
}
Loading
Loading