-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Hardcode fdo profiles * Use type PID instead of resolved name * DigitalObjectType no longer needed in request * refactor * remove fdoprofile from request * update fdo profile * Evict cache every 12 hours (#77) * Hardcode fdo profiles * Use type PID instead of resolved name * DigitalObjectType no longer needed in request * refactor * remove fdoprofile from request * update fdo profile * code reivew * code reivew * soanr
- Loading branch information
Showing
59 changed files
with
3,819 additions
and
4,352 deletions.
There are no files selected for viewing
6 changes: 3 additions & 3 deletions
6
src/main/java/eu/dissco/core/handlemanager/controller/PidController.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
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
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
76 changes: 76 additions & 0 deletions
76
src/main/java/eu/dissco/core/handlemanager/domain/fdo/FdoType.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,76 @@ | ||
package eu.dissco.core.handlemanager.domain.fdo; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.Getter; | ||
import lombok.extern.slf4j.Slf4j; | ||
|
||
@Slf4j | ||
@Getter | ||
public enum FdoType { | ||
@JsonProperty("https://hdl.handle.net/21.T11148/532ce6796e2828dd2be6") HANDLE( | ||
"Handle Kernel", | ||
"https://hdl.handle.net/21.T11148/532ce6796e2828dd2be6", | ||
"https://hdl.handle.net/21.T11148/532ce6796e2828dd2be6"), | ||
@JsonProperty("https://hdl.handle.net/21.T11148/527856fd709ec8c5bc8c") DOI( | ||
"DOI Kernel", | ||
"https://hdl.handle.net/21.T11148/527856fd709ec8c5bc8c", | ||
"https://hdl.handle.net/21.T11148/527856fd709ec8c5bc8c"), | ||
@JsonProperty("https://hdl.handle.net/21.T11148/894b1e6cad57e921764e") DIGITAL_SPECIMEN( | ||
"DigitalSpecimen", | ||
"https://hdl.handle.net/21.T11148/894b1e6cad57e921764e", | ||
"https://hdl.handle.net/21.T11148/894b1e6cad57e921764e"), | ||
@JsonProperty("https://hdl.handle.net/21.T11148/bbad8c4e101e8af01115") MEDIA_OBJECT( | ||
"MediaObject", | ||
"https://hdl.handle.net/21.T11148/bbad8c4e101e8af01115", | ||
"https://hdl.handle.net/21.T11148/bbad8c4e101e8af01115"), | ||
@JsonProperty("https://hdl.handle.net/21.T11148/cf458ca9ee1d44a5608f") ANNOTATION( | ||
"Annotation", | ||
"https://hdl.handle.net/21.T11148/cf458ca9ee1d44a5608f", | ||
"https://hdl.handle.net/21.T11148/cf458ca9ee1d44a5608f"), | ||
@JsonProperty("https://hdl.handle.net/21.T11148/417a4f472f60f7974c12") SOURCE_SYSTEM( | ||
"sourceSystem", | ||
"https://hdl.handle.net/21.T11148/417a4f472f60f7974c12", | ||
"https://hdl.handle.net/21.T11148/417a4f472f60f7974c12"), | ||
@JsonProperty("https://hdl.handle.net/21.T11148/ce794a6f4df42eb7e77e") MAPPING( | ||
"Mapping", | ||
"https://hdl.handle.net/21.T11148/ce794a6f4df42eb7e77e", | ||
"https://hdl.handle.net/21.T11148/ce794a6f4df42eb7e77e"), | ||
@JsonProperty("https://hdl.handle.net/21.T11148/413c00cbd83ae33d1ac0") ORGANISATION( | ||
"Organisation", | ||
"https://hdl.handle.net/21.T11148/413c00cbd83ae33d1ac0", | ||
"https://hdl.handle.net/21.T11148/413c00cbd83ae33d1ac0"), | ||
@JsonProperty("https://hdl.handle.net/21.T11148/d7570227982f70256af3") TOMBSTONE( | ||
"Tombstone", | ||
"https://hdl.handle.net/21.T11148/d7570227982f70256af3", | ||
"https://hdl.handle.net/21.T11148/d7570227982f70256af3"), | ||
@JsonProperty("https://hdl.handle.net/21.T11148/22e71a0015cbcfba8ffa") MAS( | ||
"Machine Annotation Service", | ||
"https://hdl.handle.net/21.T11148/22e71a0015cbcfba8ffa", | ||
"https://hdl.handle.net/21.T11148/22e71a0015cbcfba8ffa"); | ||
|
||
private final String digitalObjectName; | ||
private final String digitalObjectType; | ||
private final String fdoProfile; | ||
|
||
FdoType(@JsonProperty("type") String digitalObjectName, String digitalObjectType, | ||
String fdoProfile) { | ||
this.digitalObjectName = digitalObjectName; | ||
this.digitalObjectType = digitalObjectType; | ||
this.fdoProfile = fdoProfile; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return digitalObjectType; | ||
} | ||
|
||
public static FdoType fromString(String fdoTypePid) { | ||
for (FdoType type : FdoType.values()) { | ||
if (type.digitalObjectType.equalsIgnoreCase(fdoTypePid)) { | ||
return type; | ||
} | ||
} | ||
log.error("Unable to determine fdo type from {}, is it a PID?", fdoTypePid); | ||
throw new IllegalArgumentException("No object type exists for " + fdoTypePid); | ||
} | ||
} |
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
23 changes: 23 additions & 0 deletions
23
src/main/java/eu/dissco/core/handlemanager/domain/fdo/MasRequest.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,23 @@ | ||
package eu.dissco.core.handlemanager.domain.fdo; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import eu.dissco.core.handlemanager.domain.fdo.vocabulary.specimen.StructuralType; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.Getter; | ||
import lombok.ToString; | ||
|
||
@Getter | ||
@ToString | ||
@EqualsAndHashCode(callSuper = true) | ||
public class MasRequest extends HandleRecordRequest { | ||
|
||
@JsonProperty(required = true) | ||
private final String machineAnnotationServiceName; | ||
|
||
public MasRequest(String issuedForAgent, | ||
String pidIssuer, String[] locations, String masName) { | ||
super(issuedForAgent, pidIssuer, StructuralType.DIGITAL, | ||
locations); | ||
this.machineAnnotationServiceName = masName; | ||
} | ||
} |
Oops, something went wrong.