-
Notifications
You must be signed in to change notification settings - Fork 1
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 #170 from aodn/features/6028-versioning
auto detect latest ARDC versions
- Loading branch information
Showing
13 changed files
with
291 additions
and
118 deletions.
There are no files selected for viewing
37 changes: 0 additions & 37 deletions
37
ardcvocabs/src/main/java/au/org/aodn/ardcvocabs/configuration/VocabApiPaths.java
This file was deleted.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
ardcvocabs/src/main/java/au/org/aodn/ardcvocabs/model/ArdcCurrentPaths.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,29 @@ | ||
package au.org.aodn.ardcvocabs.model; | ||
|
||
import lombok.Getter; | ||
|
||
@Getter | ||
public enum ArdcCurrentPaths { | ||
PARAMETER_VOCAB( | ||
"/aodn-parameter-category-vocabulary/current/concept.json", | ||
"/aodn-discovery-parameter-vocabulary/current/concept.json" | ||
), | ||
PLATFORM_VOCAB( | ||
"/aodn-platform-category-vocabulary/current/concept.json", | ||
"/aodn-platform-vocabulary/current/concept.json" | ||
), | ||
ORGANISATION_VOCAB( | ||
"/aodn-organisation-category-vocabulary/current/concept.json", | ||
"/aodn-organisation-vocabulary/current/concept.json" | ||
); | ||
|
||
|
||
private final String categoryCurrent; | ||
private final String vocabCurrent; | ||
|
||
ArdcCurrentPaths(String categoryCurrent, String vocabCurrent) { | ||
String baseUrl = "https://vocabs.ardc.edu.au/repository/api/lda/aodn"; | ||
this.categoryCurrent = baseUrl + categoryCurrent; | ||
this.vocabCurrent = baseUrl + vocabCurrent; | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
ardcvocabs/src/main/java/au/org/aodn/ardcvocabs/model/PathName.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,8 @@ | ||
package au.org.aodn.ardcvocabs.model; | ||
|
||
public enum PathName { | ||
categoryApi, | ||
categoryDetailsApi, | ||
vocabApi, | ||
vocabDetailsApi | ||
} |
43 changes: 21 additions & 22 deletions
43
ardcvocabs/src/main/java/au/org/aodn/ardcvocabs/model/VocabApiPaths.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 |
---|---|---|
@@ -1,37 +1,36 @@ | ||
package au.org.aodn.ardcvocabs.model; | ||
|
||
import lombok.Getter; | ||
|
||
@Getter | ||
public enum VocabApiPaths { | ||
PARAMETER_VOCAB( | ||
"/aodn-parameter-category-vocabulary/version-2-1/concept.json", | ||
"/aodn-parameter-category-vocabulary/version-2-1/resource.json?uri=%s", | ||
"/aodn-discovery-parameter-vocabulary/version-1-6/concept.json", | ||
"/aodn-discovery-parameter-vocabulary/version-1-6/resource.json?uri=%s" | ||
"/aodn-parameter-category-vocabulary/%s/concept.json", | ||
"/aodn-parameter-category-vocabulary/%s/resource.json?uri=%s", | ||
"/aodn-discovery-parameter-vocabulary/%s/concept.json", | ||
"/aodn-discovery-parameter-vocabulary/%s/resource.json?uri=%s" | ||
), | ||
PLATFORM_VOCAB( | ||
"/aodn-platform-category-vocabulary/version-1-2/concept.json", | ||
"/aodn-platform-category-vocabulary/version-1-2/resource.json?uri=%s", | ||
"/aodn-platform-vocabulary/version-6-1/concept.json", | ||
"/aodn-platform-vocabulary/version-6-1/resource.json?uri=%s" | ||
"/aodn-platform-category-vocabulary/%s/concept.json", | ||
"/aodn-platform-category-vocabulary/%s/resource.json?uri=%s", | ||
"/aodn-platform-vocabulary/%s/concept.json", | ||
"/aodn-platform-vocabulary/%s/resource.json?uri=%s" | ||
), | ||
ORGANISATION_VOCAB( | ||
"/aodn-organisation-category-vocabulary/version-2-5/concept.json", | ||
"/aodn-organisation-category-vocabulary/version-2-5/resource.json?uri=%s", | ||
"/aodn-organisation-vocabulary/version-2-5/concept.json", | ||
"/aodn-organisation-vocabulary/version-2-5/resource.json?uri=%s" | ||
"/aodn-organisation-category-vocabulary/%s/concept.json", | ||
"/aodn-organisation-category-vocabulary/%s/resource.json?uri=%s", | ||
"/aodn-organisation-vocabulary/%s/concept.json", | ||
"/aodn-organisation-vocabulary/%s/resource.json?uri=%s" | ||
); | ||
|
||
private final String vocabCategoryApiPath; | ||
private final String vocabCategoryDetailsApiPath; | ||
private final String vocabApiPath; | ||
private final String vocabDetailsApiPath; | ||
private final String categoryApiTemplate; | ||
private final String categoryDetailsTemplate; | ||
private final String vocabApiTemplate; | ||
private final String vocabDetailsTemplate; | ||
|
||
VocabApiPaths(String vocabCategoryApiPath, String vocabCategoryDetailsApiPath, String vocabApiPath, String vocabDetailsApiPath) { | ||
this.vocabCategoryApiPath = vocabCategoryApiPath; | ||
this.vocabCategoryDetailsApiPath = vocabCategoryDetailsApiPath; | ||
this.vocabApiPath = vocabApiPath; | ||
this.vocabDetailsApiPath = vocabDetailsApiPath; | ||
VocabApiPaths(String categoryApiTemplate, String categoryDetailsTemplate, String vocabApiTemplate, String vocabDetailsTemplate) { | ||
this.categoryApiTemplate = categoryApiTemplate; | ||
this.categoryDetailsTemplate = categoryDetailsTemplate; | ||
this.vocabApiTemplate = vocabApiTemplate; | ||
this.vocabDetailsTemplate = vocabDetailsTemplate; | ||
} | ||
} |
5 changes: 4 additions & 1 deletion
5
ardcvocabs/src/main/java/au/org/aodn/ardcvocabs/service/ArdcVocabService.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 |
---|---|---|
@@ -1,10 +1,13 @@ | ||
package au.org.aodn.ardcvocabs.service; | ||
|
||
import au.org.aodn.ardcvocabs.model.PathName; | ||
import au.org.aodn.ardcvocabs.model.VocabApiPaths; | ||
import au.org.aodn.ardcvocabs.model.VocabModel; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
public interface ArdcVocabService { | ||
List<VocabModel> getVocabTreeFromArdcByType(VocabApiPaths vocabApiPaths); | ||
Map<String, Map<PathName, String>> getResolvedPathCollection(); | ||
List<VocabModel> getVocabTreeFromArdcByType(Map<PathName, String> resolvedPaths); | ||
} |
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
Oops, something went wrong.