-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #75 from waterflow80/ingestion-return-body
A proposal for the return type/object of the ingestion endpoint
- Loading branch information
Showing
7 changed files
with
156 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
src/main/java/uk/ac/ebi/eva/evaseqcol/exception/AssemblyAlreadyIngestedException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package uk.ac.ebi.eva.evaseqcol.exception; | ||
|
||
public class AssemblyAlreadyIngestedException extends RuntimeException{ | ||
public AssemblyAlreadyIngestedException(String assemblyAccession) { | ||
super("Seqcol objects for assembly " + assemblyAccession + " have already been ingested"); | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
src/main/java/uk/ac/ebi/eva/evaseqcol/model/IngestionResultEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package uk.ac.ebi.eva.evaseqcol.model; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/** | ||
* This Entity will hold the information that should be returned | ||
* upon ingestion of seqcol objects (given the assembly accession)*/ | ||
@Data | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class IngestionResultEntity { | ||
|
||
@JsonProperty("assembly_accession") | ||
private String assemblyAccession; | ||
@JsonProperty("num_inserted_seqcols") | ||
private Integer numberOfInsertedSeqcols = 0; | ||
@JsonProperty("inserted_seqcols") | ||
private List<InsertedSeqColEntity> insertedSeqcols = new ArrayList<>(); | ||
@JsonProperty("error_message") | ||
private String errorMessage = null; | ||
|
||
|
||
public void addInsertedSeqCol(InsertedSeqColEntity insertedSeqCol) { | ||
this.insertedSeqcols.add(insertedSeqCol); | ||
} | ||
|
||
/** | ||
* Increment the numberOfInsertedSeqcols by one*/ | ||
public void incrementNumberOfInsertedSeqCols() { | ||
this.numberOfInsertedSeqcols += 1; | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/main/java/uk/ac/ebi/eva/evaseqcol/model/InsertedSeqColEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package uk.ac.ebi.eva.evaseqcol.model; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
/** | ||
* This entity will hold minimal seqcol information that will be returned | ||
* to the user upon ingestion*/ | ||
@Data | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class InsertedSeqColEntity { | ||
|
||
private String digest; // Level 0 digest | ||
@JsonProperty("naming_convention") | ||
private String namingConvention; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters