diff --git a/legend-depot-core-data-services/src/main/java/org/finos/legend/depot/server/resources/deprecated/DeprecatedProjectAPIsResource.java b/legend-depot-core-data-services/src/main/java/org/finos/legend/depot/server/resources/deprecated/DeprecatedProjectAPIsResource.java deleted file mode 100644 index 2a704475d..000000000 --- a/legend-depot-core-data-services/src/main/java/org/finos/legend/depot/server/resources/deprecated/DeprecatedProjectAPIsResource.java +++ /dev/null @@ -1,288 +0,0 @@ -// Copyright 2021 Goldman Sachs -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -package org.finos.legend.depot.server.resources.deprecated; - -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.apache.commons.lang.builder.EqualsBuilder; -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.finos.legend.depot.domain.CoordinateData; -import org.finos.legend.depot.domain.VersionedData; -import org.finos.legend.depot.domain.project.ProjectVersion; -import org.finos.legend.depot.store.model.projects.StoreProjectData; -import org.finos.legend.depot.store.model.projects.StoreProjectVersionData; -import org.finos.legend.depot.domain.version.VersionValidator; -import org.finos.legend.depot.server.resources.projects.ProjectsResource; -import org.finos.legend.depot.services.api.projects.ProjectsService; -import org.finos.legend.depot.tracing.resources.BaseResource; -import org.finos.legend.sdlc.domain.model.version.VersionId; - -import javax.inject.Inject; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Optional; -import java.util.stream.Collectors; - -@Path("") -@Api("Deprecated") -public class DeprecatedProjectAPIsResource extends BaseResource -{ - - private static final String GET_ALL_LEGACY_PROJECTS = "get all projects deprecated"; - private static final String GET_PROJECT_BY_GA = "get project by ga deprecated"; - - private final ProjectsService projectApi; - - @Inject - public DeprecatedProjectAPIsResource(ProjectsService projectApi) - { - this.projectApi = projectApi; - } - - - @GET - @Path("/projects/{groupId}/{artifactId}") - @ApiOperation(value = GET_PROJECT_BY_GA,notes = "replaced by: /project-configurations/{groupId}/{artifactId}", tags = "_Deprecated: remove by Q3 2023") - @Produces(MediaType.APPLICATION_JSON) - @Deprecated - public Optional getProject(@PathParam("groupId") String groupId, @PathParam("artifactId") String artifactId) - { - return handle(GET_PROJECT_BY_GA, GET_PROJECT_BY_GA + groupId + artifactId, () -> - { - List projectVersions = projectApi.find(groupId, artifactId); - Optional projectCoordinates = this.projectApi.findCoordinates(groupId, artifactId); - if (!projectVersions.isEmpty() && projectCoordinates.isPresent()) - { - return Optional.of(transformToProjectData(projectCoordinates.get().getProjectId(), groupId, artifactId, projectVersions)); - } - return Optional.empty(); - }); - } - - - @GET - @Path("/projects") - @ApiOperation(value = GET_ALL_LEGACY_PROJECTS,notes = "replaced by: /project-configurations", tags = "_Deprecated: remove by Q3 2023") - @Produces(MediaType.APPLICATION_JSON) - @Deprecated - public List getProjects() - { - return handle(GET_ALL_LEGACY_PROJECTS, GET_ALL_LEGACY_PROJECTS, () -> - { - List projectCoordinates = projectApi.getAllProjectCoordinates(); - if (!projectCoordinates.isEmpty()) - { - return projectCoordinates.stream().map(pc -> - { - List projectVersions = projectApi.find(pc.getGroupId(), pc.getArtifactId()); - return projectVersions.isEmpty() ? new ProjectData(pc.getProjectId(), pc.getGroupId(), pc.getArtifactId()) : transformToProjectData(pc.getProjectId(), pc.getGroupId(), pc.getArtifactId(), projectVersions); - }).collect(Collectors.toList()); - } - return Collections.emptyList(); - }); - } - - - private ProjectData transformToProjectData(String projectId, String groupId, String artifactId, List projectVersionsData) - { - ProjectData projectData = new ProjectData(projectId, groupId, artifactId); - projectVersionsData.stream().filter(pv -> !pv.getVersionData().isExcluded()).forEach(pv -> - { - List dependencies = pv.getVersionData().getDependencies().stream().map(dep -> new ProjectData.ProjectVersionDependency(groupId, artifactId, pv.getVersionId(), dep)).collect(Collectors.toList()); - projectData.addDependencies(dependencies); - List projectProperties = pv.getVersionData().getProperties().stream().map(prop -> new ProjectsResource.ProjectVersionProperty(prop.getPropertyName(), prop.getValue(), pv.getVersionId())).collect(Collectors.toList()); - projectData.addProperties(projectProperties); - projectData.addVersion(pv.getVersionId()); - }); - return projectData; - } - - - @JsonIgnoreProperties(ignoreUnknown = true) - @Deprecated - public static final class ProjectData extends CoordinateData - { - @JsonProperty - private String projectId; - @JsonProperty - private List versions = new ArrayList<>(); - @JsonProperty - private List dependencies = new ArrayList<>(); - @JsonProperty - private List properties = new ArrayList<>(); - - public ProjectData() - { - } - - public ProjectData(String projectId, String groupId, String artifactId) - { - super(groupId, artifactId); - this.projectId = projectId; - } - - @JsonIgnore - public String getId() - { - return ""; - } - - public String getProjectId() - { - return projectId; - } - - public List getVersions() - { - Collections.sort(versions); - return versions; - } - - public void addVersion(String versionId) - { - if (!VersionValidator.isSnapshotVersion(versionId) && !this.getVersions().contains(versionId)) - { - this.versions.add(versionId); - } - } - - @Override - public boolean equals(Object obj) - { - return EqualsBuilder.reflectionEquals(this, obj); - } - - @Override - public int hashCode() - { - return HashCodeBuilder.reflectionHashCode(this); - } - - @JsonProperty("latestVersion") - public String getLatestVersionAsString() - { - Optional latest = getLatestVersion(); - return latest.map(VersionId::toVersionIdString).orElse(null); - } - - @JsonIgnore - public Optional getLatestVersion() - { - if (versions != null && !versions.isEmpty()) - { - List versionIds = versions.stream().map(VersionId::parseVersionId).collect(Collectors.toList()); - return versionIds.stream().max(VersionId::compareTo); - } - return Optional.empty(); - } - - public List getDependencies() - { - return dependencies; - } - - @JsonIgnore - public List getDependencies(String version) - { - return dependencies.stream().filter(dependency -> dependency.getVersionId().equals(version)).collect(Collectors.toList()); - } - - public List getPropertiesForProjectVersionID(String projectVersionId) - { - return properties.stream().filter(property -> property.getProjectVersionId().equals(projectVersionId)).collect(Collectors.toList()); - } - - public void addDependencies(List dependencies) - { - this.dependencies.addAll(dependencies); - } - - public void setDependencies(List dependencies) - { - this.dependencies = dependencies; - } - - - public List getProperties() - { - return properties; - } - - public void setProperties(List properties) - { - this.properties = properties; - } - - public void addProperties(List propertyList) - { - propertyList.stream().filter(property -> !properties.contains(property)).forEach(property -> this.properties.add(property)); - } - - @JsonIgnore - public Optional getVersion(String versionId) - { - return this.versions.stream().filter(v -> v.equals(versionId)).findFirst(); - } - - public static class ProjectVersionDependency extends VersionedData - { - private ProjectVersion dependency; - - public ProjectVersionDependency() - { - } - - public ProjectVersionDependency(String groupid, String artifactId, String versionId, ProjectVersion dep) - { - super(groupid, artifactId, versionId); - this.dependency = dep; - } - - public ProjectVersion getDependency() - { - return dependency; - } - - public void setDependency(ProjectVersion dependency) - { - this.dependency = dependency; - } - - @Override - public boolean equals(Object obj) - { - return EqualsBuilder.reflectionEquals(this, obj); - } - - @Override - public int hashCode() - { - return HashCodeBuilder.reflectionHashCode(this); - } - } - } - - -} diff --git a/legend-depot-core-data-services/src/main/java/org/finos/legend/depot/server/resources/guice/CoreDataDeprecatedResourcesModule.java b/legend-depot-core-data-services/src/main/java/org/finos/legend/depot/server/resources/guice/CoreDataDeprecatedResourcesModule.java deleted file mode 100644 index 0271354a5..000000000 --- a/legend-depot-core-data-services/src/main/java/org/finos/legend/depot/server/resources/guice/CoreDataDeprecatedResourcesModule.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2021 Goldman Sachs -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -package org.finos.legend.depot.server.resources.guice; - -import com.google.inject.PrivateModule; -import org.finos.legend.depot.server.resources.deprecated.DeprecatedProjectAPIsResource; - - -public class CoreDataDeprecatedResourcesModule extends PrivateModule -{ - @Override - protected void configure() - { - bind(DeprecatedProjectAPIsResource.class); - expose(DeprecatedProjectAPIsResource.class); - } -} \ No newline at end of file diff --git a/legend-depot-entities-services/src/main/java/org/finos/legend/depot/server/resources/deprecated/DeprecatedDependenciesAPIsResource.java b/legend-depot-entities-services/src/main/java/org/finos/legend/depot/server/resources/deprecated/DeprecatedDependenciesAPIsResource.java deleted file mode 100644 index 46bde9e7e..000000000 --- a/legend-depot-entities-services/src/main/java/org/finos/legend/depot/server/resources/deprecated/DeprecatedDependenciesAPIsResource.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2021 Goldman Sachs -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -package org.finos.legend.depot.server.resources.deprecated; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.finos.legend.depot.domain.entity.ProjectVersionEntities; -import org.finos.legend.depot.services.api.entities.EntitiesService; -import org.finos.legend.depot.tracing.resources.BaseResource; - -import javax.inject.Inject; -import javax.ws.rs.DefaultValue; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.MediaType; -import java.util.List; - -import static org.finos.legend.depot.domain.version.VersionValidator.BRANCH_SNAPSHOT; - -@Path("") -@Api("Deprecated") -public class DeprecatedDependenciesAPIsResource extends BaseResource -{ - - private static final String GET_REVISION_DEPENDENCY_ENTITIES = "get latest dependencies entities deprecated"; - private final EntitiesService entitiesService; - - - @Inject - public DeprecatedDependenciesAPIsResource(EntitiesService entitiesService) - { - this.entitiesService = entitiesService; - } - - @GET - @Path("/projects/{groupId}/{artifactId}/revisions/latest/dependants") - @ApiOperation(value = GET_REVISION_DEPENDENCY_ENTITIES, notes = "replaced by: /projects/{groupId}/{artifactId}/versions/master-SNAPSHOT/dependantProjects", tags = "_Deprecated: remove by Q1 2024") - @Produces(MediaType.APPLICATION_JSON) - @Deprecated - public List getLatestEntitiesFromDependencies(@PathParam("groupId") String groupId, - @PathParam("artifactId") String artifactId, - @QueryParam("transitive") @DefaultValue("false") - @ApiParam("Whether to return transitive dependencies") boolean transitive, - @QueryParam("includeOrigin") @DefaultValue("false") - @ApiParam("Whether to return start of dependency tree") boolean includeOrigin) - { - return handle(GET_REVISION_DEPENDENCY_ENTITIES, () -> this.entitiesService.getDependenciesEntities(groupId, artifactId,BRANCH_SNAPSHOT("master"), transitive, includeOrigin)); - } -} diff --git a/legend-depot-entities-services/src/main/java/org/finos/legend/depot/server/resources/deprecated/DeprecatedEntitiesAPIsResource.java b/legend-depot-entities-services/src/main/java/org/finos/legend/depot/server/resources/deprecated/DeprecatedEntitiesAPIsResource.java deleted file mode 100644 index 5ad65f90a..000000000 --- a/legend-depot-entities-services/src/main/java/org/finos/legend/depot/server/resources/deprecated/DeprecatedEntitiesAPIsResource.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright 2021 Goldman Sachs -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -package org.finos.legend.depot.server.resources.deprecated; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.finos.legend.depot.services.api.entities.EntitiesService; -import org.finos.legend.depot.tracing.resources.BaseResource; -import org.finos.legend.sdlc.domain.model.entity.Entity; - -import javax.inject.Inject; -import javax.ws.rs.DefaultValue; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.MediaType; -import java.util.List; -import java.util.Optional; -import java.util.Set; - -import static org.finos.legend.depot.domain.version.VersionValidator.BRANCH_SNAPSHOT; - -@Path("") -@Api("Deprecated") -public class DeprecatedEntitiesAPIsResource extends BaseResource -{ - - private static final String GET_REVISION_ENTITIES = "get revision entities deprecated"; - private static final String GET_REVISION_ENTITY = "get revision entity deprecated"; - private static final String GET_REVISION_ENTITIES_BY_PACKAGE = "get revision entities by package deprecated"; - private final EntitiesService entitiesService; - - @Inject - public DeprecatedEntitiesAPIsResource(EntitiesService entitiesService) - { - this.entitiesService = entitiesService; - } - - - @GET - @Path("/projects/{groupId}/{artifactId}/revisions/latest") - @ApiOperation(value = GET_REVISION_ENTITIES, notes = "replaced by: /projects/{groupId}/{artifactId}/versions/master-SNAPSHOT", tags = "_Deprecated: remove by Q1 2024") - @Produces(MediaType.APPLICATION_JSON) - @Deprecated - public List getLatestEntities(@PathParam("groupId") String groupId, - @PathParam("artifactId") String artifactId) - { - return handle(GET_REVISION_ENTITIES, () -> this.entitiesService.getEntities(groupId, artifactId, BRANCH_SNAPSHOT("master"))); - } - - - @GET - @Path("/projects/{groupId}/{artifactId}/latest/entities/{path}") - @ApiOperation(value = GET_REVISION_ENTITY,notes = "replaced by: /projects/{groupId}/{artifactId}/versions/master-SNAPSHOT/entities/{path}", tags = "_Deprecated: remove by Q1 2024") - @Produces(MediaType.APPLICATION_JSON) - @Deprecated - public Optional geLatestEntity(@PathParam("groupId") String groupId, - @PathParam("artifactId") String artifactId, - @PathParam("path") String entityPath) - { - return handle(GET_REVISION_ENTITY, GET_REVISION_ENTITY + entityPath, () -> this.entitiesService.getEntity(groupId, artifactId,BRANCH_SNAPSHOT("master"), entityPath)); - } - - @GET - @Path("/projects/{groupId}/{artifactId}/latest/entities") - @ApiOperation(value = GET_REVISION_ENTITIES_BY_PACKAGE, notes = "replaced by: /projects/{groupId}/{artifactId}/versions/master-SNAPSHOT/entities",tags = "_Deprecated: remove by Q1 2024") - @Produces(MediaType.APPLICATION_JSON) - @Deprecated - public List getLatestEntities(@PathParam("groupId") String groupId, - @PathParam("artifactId") String artifactId, - @QueryParam("package") String packageName, - @QueryParam("classifierPath") @ApiParam("Only include ENTITIES with one of these classifier paths.") Set classifierPaths, - @QueryParam("includeSubPackages") - @DefaultValue("true") - @ApiParam("Whether to include ENTITIES from subpackages or only directly in one of the given packages") boolean includeSubPackages) - { - return handle(GET_REVISION_ENTITIES_BY_PACKAGE, GET_REVISION_ENTITIES_BY_PACKAGE + packageName, () -> this.entitiesService.getEntitiesByPackage(groupId, artifactId, BRANCH_SNAPSHOT("master"),packageName, classifierPaths, includeSubPackages)); - } -} diff --git a/legend-depot-entities-services/src/main/java/org/finos/legend/depot/server/resources/guice/EntitiesDeprecatedResourcesModule.java b/legend-depot-entities-services/src/main/java/org/finos/legend/depot/server/resources/guice/EntitiesDeprecatedResourcesModule.java deleted file mode 100644 index 8308b13a7..000000000 --- a/legend-depot-entities-services/src/main/java/org/finos/legend/depot/server/resources/guice/EntitiesDeprecatedResourcesModule.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2021 Goldman Sachs -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -package org.finos.legend.depot.server.resources.guice; - -import com.google.inject.PrivateModule; -import org.finos.legend.depot.server.resources.deprecated.DeprecatedDependenciesAPIsResource; -import org.finos.legend.depot.server.resources.deprecated.DeprecatedEntitiesAPIsResource; - -public class EntitiesDeprecatedResourcesModule extends PrivateModule -{ - @Override - protected void configure() - { - bind(DeprecatedEntitiesAPIsResource.class); - bind(DeprecatedDependenciesAPIsResource.class); - - expose(DeprecatedEntitiesAPIsResource.class); - expose(DeprecatedDependenciesAPIsResource.class); - } -} \ No newline at end of file diff --git a/legend-depot-generations-services/src/main/java/org/finos/legend/depot/server/resources/deprecated/GenerationsDeprecatedResource.java b/legend-depot-generations-services/src/main/java/org/finos/legend/depot/server/resources/deprecated/GenerationsDeprecatedResource.java deleted file mode 100644 index b4b42b19f..000000000 --- a/legend-depot-generations-services/src/main/java/org/finos/legend/depot/server/resources/deprecated/GenerationsDeprecatedResource.java +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright 2021 Goldman Sachs -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -package org.finos.legend.depot.server.resources.deprecated; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.finos.legend.depot.domain.generation.DepotGeneration; -import org.finos.legend.depot.services.api.generations.FileGenerationsService; -import org.finos.legend.depot.tracing.resources.BaseResource; -import org.finos.legend.sdlc.domain.model.entity.Entity; - -import javax.inject.Inject; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; -import java.util.List; -import java.util.Optional; - -import static org.finos.legend.depot.domain.version.VersionValidator.BRANCH_SNAPSHOT; - -@Path("") -@Api("Deprecated") -public class GenerationsDeprecatedResource extends BaseResource -{ - private static final String GET_REVISION_FILE_GENERATION_ENTITIES = "get revision generation entities deprecated"; - private static final String GET_REVISION_FILE_GENERATION = "get revision file generations deprecated"; - private static final String GET_REVISION_FILE_GENERATION_BY_ELEMENT_PATH = "get revision file generations by element path deprecated"; - private static final String GET_REVISION_FILE_GENERATION_BY_FILEPATH = "get revision file generations by file deprecated"; - private final FileGenerationsService generationsService; - - @Inject - public GenerationsDeprecatedResource(FileGenerationsService generationsService) - { - this.generationsService = generationsService; - } - - @GET - @Path("/projects/{groupId}/{artifactId}/latest/generations") - @ApiOperation(value = GET_REVISION_FILE_GENERATION_ENTITIES,notes = "replaced by: /projects/{groupId}/{artifactId}/master-SNAPSHOT/generations",tags = "_Deprecated: remove by Q1 2024") - @Produces(MediaType.APPLICATION_JSON) - @Deprecated - public List getLatestGenerations(@PathParam("groupId") String groupId, - @PathParam("artifactId") String artifactId) - { - return handle(GET_REVISION_FILE_GENERATION_ENTITIES, () -> this.generationsService.getGenerations(groupId, artifactId, BRANCH_SNAPSHOT("master"))); - } - - - @GET - @Path("/generations/{groupId}/{artifactId}/latest") - @ApiOperation(value = GET_REVISION_FILE_GENERATION, notes = "replaced by: /generations/{groupId}/{artifactId}/versions/master-SNAPSHOT",tags = "_Deprecated: remove by Q1 2024") - @Produces(MediaType.APPLICATION_JSON) - @Deprecated - public List getLatestFileGenerations(@PathParam("groupId") String groupId, - @PathParam("artifactId") String artifactId) - { - return handle(GET_REVISION_FILE_GENERATION, () -> this.generationsService.getFileGenerations(groupId, artifactId,BRANCH_SNAPSHOT("master"))); - } - - @GET - @Path("/generations/{groupId}/{artifactId}/latest/{elementPath}") - @ApiOperation(value = GET_REVISION_FILE_GENERATION_BY_ELEMENT_PATH, notes = " deprecated use /generations/{groupId}/{artifactId}/versions/master-SNAPSHOT/{elementPath}",tags = "_Deprecated: remove by Q1 2024") - @Produces(MediaType.APPLICATION_JSON) - @Deprecated - public List getLatestFileGenerationsByElementPath(@PathParam("groupId") String groupId, - @PathParam("artifactId") String artifactId, - @PathParam("elementPath") String elementPath) - { - return handle(GET_REVISION_FILE_GENERATION_BY_ELEMENT_PATH, () -> this.generationsService.getFileGenerationsByElementPath(groupId, artifactId, BRANCH_SNAPSHOT("master"),elementPath)); - } - - @GET - @Path("/generations/{groupId}/{artifactId}/latest/file/{filePath}") - @ApiOperation(value = GET_REVISION_FILE_GENERATION_BY_FILEPATH, notes = "replaced by: /generations/{groupId}/{artifactId}/versions/master-SNAPSHOT/file/{filePath}",tags = "_Deprecated: remove by Q1 2024") - @Produces(MediaType.APPLICATION_JSON) - @Deprecated - public Optional getLatestFileGenerationsByFilePath(@PathParam("groupId") String groupId, - @PathParam("artifactId") String artifactId, - @PathParam("filePath") String filePath) - { - return handle(GET_REVISION_FILE_GENERATION_BY_FILEPATH, () -> this.generationsService.getFileGenerationsByFilePath(groupId, artifactId, BRANCH_SNAPSHOT("master"),filePath)); - } - -} diff --git a/legend-depot-generations-services/src/main/java/org/finos/legend/depot/server/resources/guice/GenerationsDeprecatedResourcesModule.java b/legend-depot-generations-services/src/main/java/org/finos/legend/depot/server/resources/guice/GenerationsDeprecatedResourcesModule.java deleted file mode 100644 index dbc76bd56..000000000 --- a/legend-depot-generations-services/src/main/java/org/finos/legend/depot/server/resources/guice/GenerationsDeprecatedResourcesModule.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2021 Goldman Sachs -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -package org.finos.legend.depot.server.resources.guice; - -import com.google.inject.PrivateModule; -import org.finos.legend.depot.server.resources.deprecated.GenerationsDeprecatedResource; - - -public class GenerationsDeprecatedResourcesModule extends PrivateModule -{ - @Override - protected void configure() - { - bind(GenerationsDeprecatedResource.class); - expose(GenerationsDeprecatedResource.class); - } -} diff --git a/legend-depot-pure-model-context/src/main/java/org/finos/legend/depot/server/resources/deprecated/PureModelContextDeprecatedResource.java b/legend-depot-pure-model-context/src/main/java/org/finos/legend/depot/server/resources/deprecated/PureModelContextDeprecatedResource.java deleted file mode 100644 index bb9803714..000000000 --- a/legend-depot-pure-model-context/src/main/java/org/finos/legend/depot/server/resources/deprecated/PureModelContextDeprecatedResource.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2022 Goldman Sachs -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -package org.finos.legend.depot.server.resources.deprecated; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; - -import org.finos.legend.depot.services.api.pure.model.context.PureModelContextService; -import org.finos.legend.depot.tracing.resources.BaseResource; -import org.finos.legend.engine.protocol.pure.v1.model.context.PureModelContextData; - -import javax.inject.Inject; -import javax.ws.rs.DefaultValue; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.MediaType; - -import static org.finos.legend.depot.domain.version.VersionValidator.BRANCH_SNAPSHOT; - -@Path("") -@Api("Deprecated") -public class PureModelContextDeprecatedResource extends BaseResource -{ - - private static final String GET_REVISION_ENTITIES_AS_PMCD = "get revision entities as PMCD deprecated"; - private final PureModelContextService service; - - @Inject - public PureModelContextDeprecatedResource(PureModelContextService service) - { - this.service = service; - } - - - @GET - @Path("projects/{groupId}/{artifactId}/revisions/latest/pureModelContextData") - @ApiOperation(value = GET_REVISION_ENTITIES_AS_PMCD, notes = "replaced by: projects/{groupId}/{artifactId}/versions/master-SNAPSHOT/pureModelContextData", tags = "_Deprecated: remove by Q1 2024") - @Produces(MediaType.APPLICATION_JSON) - @Deprecated - public PureModelContextData getPureModelContextData(@PathParam("groupId") String groupId, - @PathParam("artifactId") String artifactId, - @QueryParam("clientVersion") String clientVersion, - @QueryParam("getDependencies") - @DefaultValue("true") - @ApiParam("Whether to return ENTITIES with version in entity path") boolean getDependencies) - { - return handle(GET_REVISION_ENTITIES_AS_PMCD, () -> service.getPureModelContextData(groupId, artifactId,BRANCH_SNAPSHOT("master"), clientVersion, getDependencies)); - } -} diff --git a/legend-depot-pure-model-context/src/main/java/org/finos/legend/depot/server/resources/guice/PureModelContextDeprecatedResourcesModule.java b/legend-depot-pure-model-context/src/main/java/org/finos/legend/depot/server/resources/guice/PureModelContextDeprecatedResourcesModule.java deleted file mode 100644 index 9aaf32b69..000000000 --- a/legend-depot-pure-model-context/src/main/java/org/finos/legend/depot/server/resources/guice/PureModelContextDeprecatedResourcesModule.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2022 Goldman Sachs -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -package org.finos.legend.depot.server.resources.guice; - -import com.google.inject.PrivateModule; -import org.finos.legend.depot.server.resources.deprecated.PureModelContextDeprecatedResource; - -public class PureModelContextDeprecatedResourcesModule extends PrivateModule -{ - @Override - protected void configure() - { - bind(PureModelContextDeprecatedResource.class); - expose(PureModelContextDeprecatedResource.class); - } -}