-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
486 additions
and
1 deletion.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
src/main/java/uk/ac/ebi/ega/accession/array/model/Array.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,26 @@ | ||
/* | ||
* | ||
* Copyright 2018 EMBL - European Bioinformatics Institute | ||
* | ||
* 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 uk.ac.ebi.ega.accession.array.model; | ||
|
||
public interface Array { | ||
|
||
String getSubmissionAccount(); | ||
|
||
String getAlias(); | ||
|
||
} |
64 changes: 64 additions & 0 deletions
64
src/main/java/uk/ac/ebi/ega/accession/array/persistence/ArrayEntity.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,64 @@ | ||
/* | ||
* | ||
* Copyright 2018 EMBL - European Bioinformatics Institute | ||
* | ||
* 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 uk.ac.ebi.ega.accession.array.persistence; | ||
|
||
import uk.ac.ebi.ampt2d.commons.accession.core.models.AccessionWrapper; | ||
import uk.ac.ebi.ampt2d.commons.accession.persistence.jpa.entities.AccessionedEntity; | ||
import uk.ac.ebi.ega.accession.array.model.Array; | ||
|
||
import javax.persistence.Column; | ||
import javax.persistence.Entity; | ||
|
||
@Entity | ||
public class ArrayEntity extends AccessionedEntity<Array, Long> implements Array { | ||
|
||
@Column(nullable = false) | ||
private String submissionAccount; | ||
|
||
@Column(nullable = false) | ||
private String alias; | ||
|
||
ArrayEntity() { | ||
super(null, null, -1); | ||
} | ||
|
||
public ArrayEntity(Array array, Long accession, String hashedMessage, int version) { | ||
super(hashedMessage, accession, version); | ||
this.submissionAccount = array.getSubmissionAccount(); | ||
this.alias = array.getAlias(); | ||
} | ||
|
||
public ArrayEntity(AccessionWrapper<Array, String, Long> wrapper) { | ||
this(wrapper.getData(), wrapper.getAccession(), wrapper.getHash(), wrapper.getVersion()); | ||
} | ||
|
||
@Override | ||
public Array getModel() { | ||
return this; | ||
} | ||
|
||
@Override | ||
public String getSubmissionAccount() { | ||
return submissionAccount; | ||
} | ||
|
||
@Override | ||
public String getAlias() { | ||
return alias; | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/main/java/uk/ac/ebi/ega/accession/array/persistence/ArrayEntityRepository.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,26 @@ | ||
/* | ||
* | ||
* Copyright 2018 EMBL - European Bioinformatics Institute | ||
* | ||
* 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 uk.ac.ebi.ega.accession.array.persistence; | ||
|
||
import org.springframework.stereotype.Repository; | ||
import uk.ac.ebi.ampt2d.commons.accession.persistence.repositories.IAccessionedObjectRepository; | ||
|
||
@Repository | ||
public interface ArrayEntityRepository extends IAccessionedObjectRepository<ArrayEntity, Long> { | ||
|
||
} |
30 changes: 30 additions & 0 deletions
30
src/main/java/uk/ac/ebi/ega/accession/array/persistence/ArrayEntityRepositoryImpl.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,30 @@ | ||
/* | ||
* | ||
* Copyright 2018 EMBL - European Bioinformatics Institute | ||
* | ||
* 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 uk.ac.ebi.ega.accession.array.persistence; | ||
|
||
import org.springframework.transaction.PlatformTransactionManager; | ||
import uk.ac.ebi.ampt2d.commons.accession.persistence.jpa.repositories.BasicJpaAccessionedObjectCustomRepositoryImpl; | ||
|
||
import javax.persistence.EntityManager; | ||
|
||
public class ArrayEntityRepositoryImpl extends BasicJpaAccessionedObjectCustomRepositoryImpl<Long, ArrayEntity> { | ||
|
||
public ArrayEntityRepositoryImpl(PlatformTransactionManager platformTransactionManager, EntityManager entityManager) { | ||
super(ArrayEntity.class, platformTransactionManager, entityManager); | ||
} | ||
} |
59 changes: 59 additions & 0 deletions
59
src/main/java/uk/ac/ebi/ega/accession/array/persistence/HistoricArrayEntity.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,59 @@ | ||
/* | ||
* | ||
* Copyright 2018 EMBL - European Bioinformatics Institute | ||
* | ||
* 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 uk.ac.ebi.ega.accession.array.persistence; | ||
|
||
import uk.ac.ebi.ampt2d.commons.accession.persistence.jpa.entities.InactiveAccessionEntity; | ||
import uk.ac.ebi.ega.accession.array.model.Array; | ||
|
||
import javax.persistence.Column; | ||
import javax.persistence.Entity; | ||
|
||
@Entity | ||
public class HistoricArrayEntity extends InactiveAccessionEntity<Array, Long> implements Array { | ||
|
||
@Column(nullable = false) | ||
private String submissionAccount; | ||
|
||
@Column(nullable = false) | ||
private String alias; | ||
|
||
HistoricArrayEntity() { | ||
super(); | ||
} | ||
|
||
public HistoricArrayEntity(ArrayEntity entity) { | ||
super(entity); | ||
this.submissionAccount = entity.getSubmissionAccount(); | ||
this.alias = entity.getAlias(); | ||
} | ||
|
||
@Override | ||
public Array getModel() { | ||
return this; | ||
} | ||
|
||
@Override | ||
public String getSubmissionAccount() { | ||
return submissionAccount; | ||
} | ||
|
||
@Override | ||
public String getAlias() { | ||
return alias; | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/main/java/uk/ac/ebi/ega/accession/array/persistence/HistoricArrayRepository.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,26 @@ | ||
/* | ||
* | ||
* Copyright 2018 EMBL - European Bioinformatics Institute | ||
* | ||
* 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 uk.ac.ebi.ega.accession.array.persistence; | ||
|
||
import org.springframework.stereotype.Repository; | ||
import uk.ac.ebi.ampt2d.commons.accession.persistence.jpa.repositories.InactiveAccessionRepository; | ||
|
||
@Repository | ||
public interface HistoricArrayRepository extends InactiveAccessionRepository<HistoricArrayEntity> { | ||
|
||
} |
26 changes: 26 additions & 0 deletions
26
src/main/java/uk/ac/ebi/ega/accession/array/persistence/HistoricLogArrayEntity.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,26 @@ | ||
/* | ||
* | ||
* Copyright 2018 EMBL - European Bioinformatics Institute | ||
* | ||
* 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 uk.ac.ebi.ega.accession.array.persistence; | ||
|
||
import uk.ac.ebi.ampt2d.commons.accession.persistence.jpa.entities.OperationEntity; | ||
|
||
import javax.persistence.Entity; | ||
|
||
@Entity | ||
public class HistoricLogArrayEntity extends OperationEntity<Long> { | ||
} |
26 changes: 26 additions & 0 deletions
26
src/main/java/uk/ac/ebi/ega/accession/array/persistence/HistoricLogArrayRepository.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,26 @@ | ||
/* | ||
* | ||
* Copyright 2018 EMBL - European Bioinformatics Institute | ||
* | ||
* 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 uk.ac.ebi.ega.accession.array.persistence; | ||
|
||
import org.springframework.stereotype.Repository; | ||
import uk.ac.ebi.ampt2d.commons.accession.persistence.repositories.IHistoryRepository; | ||
|
||
@Repository | ||
public interface HistoricLogArrayRepository extends IHistoryRepository<Long, HistoricLogArrayEntity, Long> { | ||
|
||
} |
51 changes: 51 additions & 0 deletions
51
src/main/java/uk/ac/ebi/ega/accession/array/rest/ArrayDTO.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,51 @@ | ||
/* | ||
* | ||
* Copyright 2018 EMBL - European Bioinformatics Institute | ||
* | ||
* 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 uk.ac.ebi.ega.accession.array.rest; | ||
|
||
import uk.ac.ebi.ega.accession.array.model.Array; | ||
|
||
import javax.persistence.Column; | ||
|
||
public class ArrayDTO implements Array { | ||
|
||
@Column(nullable = false) | ||
private String submissionAccount; | ||
|
||
@Column(nullable = false) | ||
private String alias; | ||
|
||
public ArrayDTO(Array array) { | ||
this(array.getSubmissionAccount(), array.getAlias()); | ||
} | ||
|
||
public ArrayDTO(String submissionAccount, String alias) { | ||
this.submissionAccount = submissionAccount; | ||
this.alias = alias; | ||
} | ||
|
||
@Override | ||
public String getSubmissionAccount() { | ||
return submissionAccount; | ||
} | ||
|
||
@Override | ||
public String getAlias() { | ||
return alias; | ||
} | ||
|
||
} |
34 changes: 34 additions & 0 deletions
34
src/main/java/uk/ac/ebi/ega/accession/array/rest/ArrayRestController.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,34 @@ | ||
/* | ||
* | ||
* Copyright 2018 EMBL - European Bioinformatics Institute | ||
* | ||
* 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 uk.ac.ebi.ega.accession.array.rest; | ||
|
||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
import uk.ac.ebi.ampt2d.commons.accession.core.AccessioningService; | ||
import uk.ac.ebi.ampt2d.commons.accession.rest.controllers.BasicRestController; | ||
import uk.ac.ebi.ega.accession.array.model.Array; | ||
|
||
@RestController | ||
@RequestMapping(value = "/v1/array") | ||
public class ArrayRestController extends BasicRestController<ArrayDTO, Array, String, String> { | ||
|
||
public ArrayRestController(AccessioningService<Array, String, String> arrayAccessionService) { | ||
super(arrayAccessionService, ArrayDTO::new); | ||
} | ||
|
||
} |
Oops, something went wrong.