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

PLFM-5259 - remove old DOI code #3431

Merged
merged 2 commits into from
Nov 27, 2018
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
import org.sagebionetworks.repo.model.discussion.UpdateThreadTitle;
import org.sagebionetworks.repo.model.docker.DockerCommit;
import org.sagebionetworks.repo.model.docker.DockerCommitSortBy;
import org.sagebionetworks.repo.model.doi.Doi;
import org.sagebionetworks.repo.model.doi.v2.Doi;
import org.sagebionetworks.repo.model.doi.v2.DoiAssociation;
import org.sagebionetworks.repo.model.doi.v2.DoiResponse;
import org.sagebionetworks.repo.model.entity.query.EntityQuery;
Expand Down Expand Up @@ -211,7 +211,6 @@
import org.sagebionetworks.repo.model.wiki.WikiPage;
import org.sagebionetworks.repo.web.NotFoundException;
import org.sagebionetworks.schema.adapter.JSONEntity;
import org.sagebionetworks.util.ValidateArgument;

/**
* Abstraction for Synapse.
Expand Down Expand Up @@ -1022,20 +1021,11 @@ public PaginatedResults<ProjectHeader> getProjectsFromUser(Long userId, ProjectL
public PaginatedResults<ProjectHeader> getProjectsForTeam(Long teamId, ProjectListSortColumn sortColumn, SortDirection sortDirection,
Integer limit, Integer offset) throws SynapseException;

public void createEntityDoi(String entityId) throws SynapseException;

public void createEntityDoi(String entityId, Long entityVersion)
throws SynapseException;

public Doi getEntityDoi(String entityId) throws SynapseException;

public Doi getEntityDoi(String s, Long entityVersion) throws SynapseException;

public DoiAssociation getDoiAssociation(String objectId, ObjectType objectType, Long objectVersion) throws SynapseException;

public org.sagebionetworks.repo.model.doi.v2.Doi getDoi(String objectId, ObjectType objectType, Long objectVersion) throws SynapseException;
public Doi getDoi(String objectId, ObjectType objectType, Long objectVersion) throws SynapseException;

public String createOrUpdateDoiAsyncStart(org.sagebionetworks.repo.model.doi.v2.Doi doi) throws SynapseException;
public String createOrUpdateDoiAsyncStart(Doi doi) throws SynapseException;

public DoiResponse createOrUpdateDoiAsyncGet(String asyncJobToken) throws SynapseException, SynapseResultNotReadyException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
import org.sagebionetworks.repo.model.discussion.UpdateThreadTitle;
import org.sagebionetworks.repo.model.docker.DockerCommit;
import org.sagebionetworks.repo.model.docker.DockerCommitSortBy;
import org.sagebionetworks.repo.model.doi.Doi;
import org.sagebionetworks.repo.model.doi.v2.Doi;
import org.sagebionetworks.repo.model.doi.v2.DoiAssociation;
import org.sagebionetworks.repo.model.doi.v2.DoiRequest;
import org.sagebionetworks.repo.model.doi.v2.DoiResponse;
Expand Down Expand Up @@ -3424,62 +3424,6 @@ private PaginatedResults<ProjectHeader> getProjects(ProjectListType type, Long u
return getPaginatedResults(getRepoEndpoint(), url, ProjectHeader.class);
}

/**
* Creates a DOI for the specified entity. The DOI will always be associated
* with the current version of the entity.
*/
@Deprecated
@Override
public void createEntityDoi(String entityId) throws SynapseException {
createEntityDoi(entityId, null);
}

/**
* Creates a DOI for the specified entity version. If version is null, the
* DOI will always be associated with the current version of the entity.
*/
@Deprecated
@Override
public void createEntityDoi(String entityId, Long entityVersion)
throws SynapseException {

ValidateArgument.required(entityId, "entityId");
String url = ENTITY + "/" + entityId;
if (entityVersion != null) {
url = url + REPO_SUFFIX_VERSION + "/" + entityVersion;
}
url = url + DOI;
voidPut(getRepoEndpoint(), url, null);
}

/**
* Gets the DOI for the specified entity version. The DOI is for the current
* version of the entity.
*/
@Deprecated
@Override
public Doi getEntityDoi(String entityId) throws SynapseException {
return getEntityDoi(entityId, null);
}

/**
* Gets the DOI for the specified entity version. If version is null, the
* DOI is for the current version of the entity.
*/
@Deprecated
@Override
public Doi getEntityDoi(String entityId, Long entityVersion)
throws SynapseException {

ValidateArgument.required(entityId, "entityId");
String url = ENTITY + "/" + entityId;
if (entityVersion != null) {
url = url + REPO_SUFFIX_VERSION + "/" + entityVersion;
}
url = url + DOI;
return getJSONEntity(getRepoEndpoint(), url, Doi.class);
}

/**
* Gets the DOI Association for the specified object. If object version is null, the call will return the DOI
* for the current version of the object.
Expand All @@ -3500,21 +3444,22 @@ public DoiAssociation getDoiAssociation(String objectId, ObjectType objectType,
* for the current version of the object.
*/
@Override
public org.sagebionetworks.repo.model.doi.v2.Doi getDoi(String objectId, ObjectType objectType, Long objectVersion) throws SynapseException {
public Doi getDoi(String objectId, ObjectType objectType, Long objectVersion) throws SynapseException {
ValidateArgument.required(objectId, "objectId");
ValidateArgument.required(objectType, "objectType");
String url = DOI_ASSOCIATION + "?id=" + objectId + "&type=" + objectType;
if (objectVersion != null) {
url += "&version=" + objectVersion;
} return getJSONEntity(getRepoEndpoint(), url, org.sagebionetworks.repo.model.doi.v2.Doi.class);
}
return getJSONEntity(getRepoEndpoint(), url, Doi.class);
}


/**
* Creates a DOI for the specified object. Idempotent.
*/
@Override
public String createOrUpdateDoiAsyncStart(org.sagebionetworks.repo.model.doi.v2.Doi doi) throws SynapseException {
public String createOrUpdateDoiAsyncStart(Doi doi) throws SynapseException {
DoiRequest request = new DoiRequest();
request.setDoi(doi);
return startAsynchJob(AsynchJobType.Doi, request);
Expand Down

This file was deleted.