Skip to content
Snippets Groups Projects
Commit fb1b4b43 authored by Mathieu.Vonlanthen's avatar Mathieu.Vonlanthen
Browse files

refactor(OAIService): solve code inspection issues

parent a4d07a74
No related branches found
No related tags found
No related merge requests found
......@@ -92,9 +92,7 @@ import ch.unige.solidify.util.XMLTool;
@ConditionalOnBean(OAIController.class)
public class OAIService {
private JAXBContext jaxbContext;
private List<Class<?>> xmlClasses = new ArrayList<>(Arrays.asList(OAIPMHtype.class, OaiDcType.class, OaiIdentifierType.class, Html.class));
private final JAXBContext jaxbContext;
private final int oaiPmhPageSize;
private final int oaiPmhTokenLifeTime;
......@@ -128,8 +126,9 @@ public class OAIService {
// JAXB contexts
try {
// Add project XML Classes
this.xmlClasses.addAll(this.metadataService.getOaiXmlClasses());
this.jaxbContext = JAXBContext.newInstance(this.xmlClasses.toArray(Class<?>[]::new));
final List<Class<?>> xmlClasses = new ArrayList<>(Arrays.asList(OAIPMHtype.class, OaiDcType.class, OaiIdentifierType.class, Html.class));
xmlClasses.addAll(this.metadataService.getOaiXmlClasses());
this.jaxbContext = JAXBContext.newInstance(xmlClasses.toArray(Class<?>[]::new));
} catch (JAXBException e) {
throw new SolidifyRuntimeException(e.getMessage(), e);
}
......@@ -228,10 +227,6 @@ public class OAIService {
return VerbType.fromValue(verb);
}
public VerbType[] getVerbs() {
return VerbType.values();
}
public ListIdentifiersType listIdentifiers(String metadataPrefix, String from, String until, String set, String token) {
// Check Parameters
final OAIToken oaiToken = this.checkParameters(metadataPrefix, from, until, set, token);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment