Revision 46345
Added by Alessia Bardi about 7 years ago
OAIConfigurationStringReader.java | ||
---|---|---|
9 | 9 |
import eu.dnetlib.oai.info.SetInfo; |
10 | 10 |
import eu.dnetlib.rmi.provision.MDFInfo; |
11 | 11 |
import eu.dnetlib.rmi.provision.OaiPublisherRuntimeException; |
12 |
import eu.dnetlib.utils.MetadataReference; |
|
12 | 13 |
import org.apache.commons.logging.Log; |
13 | 14 |
import org.apache.commons.logging.LogFactory; |
14 | 15 |
import org.springframework.beans.factory.annotation.Autowired; |
... | ... | |
89 | 90 |
} |
90 | 91 |
|
91 | 92 |
@Override |
92 |
public List<MDFInfo> getSourceMetadataFormats() {
|
|
93 |
public List<MetadataReference> getSourceMetadataFormats() {
|
|
93 | 94 |
if (isConfigurationLoaded()) { |
94 | 95 |
return this.oaiConfiguration.getSourcesMDF().stream().collect(Collectors.toList()); |
95 | 96 |
} else { |
... | ... | |
169 | 170 |
public List<MDFInfo> getFormatsServedBy(final String sourceFormatName, final String sourceFormatLayout, final String sourceFormatInterpretation) { |
170 | 171 |
if (isConfigurationLoaded()) { |
171 | 172 |
return this.oaiConfiguration.getMdFormatsMap().values().stream() |
172 |
.filter(mdf -> (mdf.getSourceFormatName() == sourceFormatName) && (mdf.getSourceFormatLayout() == sourceFormatLayout)
|
|
173 |
&& (mdf.getSourceFormatInterpretation() == sourceFormatInterpretation))
|
|
173 |
.filter(mdf -> (mdf.getSourceFormat() == sourceFormatName) && (mdf.getSourceLayout() == sourceFormatLayout)
|
|
174 |
&& (mdf.getSourceInterpretation() == sourceFormatInterpretation)) |
|
174 | 175 |
.collect(Collectors.toList()); |
175 | 176 |
} else { |
176 | 177 |
throw new OaiPublisherRuntimeException("Configuration is not loaded"); |
Also available in: Unified diff
refactoring: let's reuse class MetadataReference