Revision 61671
Added by Konstantinos Spyrou over 2 years ago
RepositoryServiceImpl.java | ||
---|---|---|
19 | 19 |
import eu.dnetlib.repo.manager.utils.Converter; |
20 | 20 |
import gr.uoa.di.driver.enabling.vocabulary.VocabularyLoader; |
21 | 21 |
import org.apache.commons.codec.digest.DigestUtils; |
22 |
import org.apache.http.entity.ContentType; |
|
22 | 23 |
import org.apache.log4j.Logger; |
23 | 24 |
import org.json.JSONArray; |
24 | 25 |
import org.json.JSONException; |
... | ... | |
33 | 34 |
import org.springframework.security.core.Authentication; |
34 | 35 |
import org.springframework.security.core.context.SecurityContextHolder; |
35 | 36 |
import org.springframework.stereotype.Service; |
37 |
import org.springframework.util.MimeType; |
|
36 | 38 |
import org.springframework.web.client.HttpClientErrorException; |
37 | 39 |
import org.springframework.web.client.RestClientException; |
38 | 40 |
import org.springframework.web.client.RestTemplate; |
... | ... | |
310 | 312 |
} |
311 | 313 |
} |
312 | 314 |
|
315 |
@Override |
|
316 |
public int getTotalRegisteredRepositories() { |
|
317 |
UriComponents uriComponents = UriComponentsBuilder |
|
318 |
.fromHttpUrl(baseAddress + "/ds/countregistered") |
|
319 |
.queryParam("fromDate", "1900-01-01") |
|
320 |
.build().encode(); |
|
321 |
|
|
322 |
return restTemplate.getForObject(uriComponents.toUri(), Integer.class); |
|
323 |
} |
|
324 |
|
|
313 | 325 |
private Repository updateRepositoryInfo(Repository r) throws JSONException { |
314 | 326 |
|
315 | 327 |
/* |
Also available in: Unified diff
created method to retrieve total registered datasources and added an entry in prometheus metrics