Revision 50570
Added by Panagiotis Kanakakis about 6 years ago
ValidatorApiImpl.java | ||
---|---|---|
3 | 3 |
import eu.dnetlib.api.functionality.ValidatorServiceException; |
4 | 4 |
import eu.dnetlib.domain.functionality.validator.StoredJob; |
5 | 5 |
import eu.dnetlib.repo.manager.service.utils.OaiTools; |
6 |
import eu.dnetlib.repo.manager.shared.InterfaceInformation; |
|
7 |
import eu.dnetlib.repo.manager.shared.ValidationServiceException; |
|
6 | 8 |
import gr.uoa.di.driver.util.ServiceLocator; |
7 | 9 |
import eu.dnetlib.domain.functionality.validator.JobForValidation; |
8 | 10 |
import eu.dnetlib.domain.functionality.validator.RuleSet; |
... | ... | |
122 | 124 |
} |
123 | 125 |
|
124 | 126 |
@Override |
125 |
public List<String> getSetsOfRepository(String url) { |
|
127 |
public List<String> getSetsOfRepository(@PathVariable("url") String url) {
|
|
126 | 128 |
LOGGER.debug("Getting sets of repository with url : " + url); |
127 | 129 |
try { |
128 | 130 |
return OaiTools.getSetsOfRepo(url); |
... | ... | |
133 | 135 |
} |
134 | 136 |
|
135 | 137 |
@Override |
136 |
public boolean identifyRepo(String url) { |
|
138 |
public boolean identifyRepo(@PathVariable("url") String url) {
|
|
137 | 139 |
LOGGER.debug("Identify repository with url : " + url); |
138 | 140 |
try { |
139 | 141 |
return OaiTools.identifyRepository(url); |
... | ... | |
144 | 146 |
} |
145 | 147 |
|
146 | 148 |
@Override |
147 |
public RuleSet getRuleSet(String acronym) { |
|
149 |
public RuleSet getRuleSet(@PathVariable("acronym") String acronym) {
|
|
148 | 150 |
LOGGER.debug("Getting ruleset with acronym : " + acronym); |
149 | 151 |
RuleSet ruleSet = null; |
150 | 152 |
try { |
... | ... | |
173 | 175 |
return getValidationService().getStoredJobsTotalNumberNew(user, jobType, validationStatus); |
174 | 176 |
} |
175 | 177 |
|
178 |
@Override |
|
179 |
public InterfaceInformation getInterfaceInformation(@PathVariable("baseUrl") String baseUrl) throws ValidationServiceException { |
|
180 |
try { |
|
181 |
LOGGER.debug("Getting interface information with url: " + baseUrl); |
|
182 |
InterfaceInformation interfaceInformation = new InterfaceInformation(); |
|
183 |
interfaceInformation.setIdentified(this.identifyRepo(baseUrl)); |
|
184 |
if (interfaceInformation.isIdentified()) |
|
185 |
interfaceInformation.setSets(this.getSetsOfRepository(baseUrl)); |
|
176 | 186 |
|
187 |
return interfaceInformation; |
|
188 |
} catch (Exception e) { |
|
189 |
LOGGER.error("Error getting interface information with url: " + baseUrl, e); |
|
190 |
// emailUtils.reportException(e); |
|
191 |
throw new ValidationServiceException("login.generalError", ValidationServiceException.ErrorCode.GENERAL_ERROR); |
|
192 |
} |
|
193 |
} |
|
194 |
|
|
195 |
|
|
177 | 196 |
} |
Also available in: Unified diff
1. Add getMetricsInfoForRepository and getInterfaceInformation methods.
2. Create aai-secutiry.xml file
3. Add properties on application file