Revision 49362
Added by Panagiotis Kanakakis over 6 years ago
MonitorApiImpl.java | ||
---|---|---|
1 |
package eu.dnetlib.repo.manager.service.rest;
|
|
1 |
package eu.dnetlib.repo.manager.service.controllers;
|
|
2 | 2 |
|
3 | 3 |
import eu.dnetlib.api.functionality.ValidatorService; |
4 | 4 |
import eu.dnetlib.api.functionality.ValidatorServiceException; |
5 | 5 |
import eu.dnetlib.domain.functionality.validator.StoredJob; |
6 | 6 |
import gr.uoa.di.driver.util.ServiceLocator; |
7 |
import org.json.JSONException; |
|
7 | 8 |
import org.json.JSONObject; |
9 |
import org.springframework.beans.factory.annotation.Autowired; |
|
8 | 10 |
import org.springframework.stereotype.Component; |
9 | 11 |
import java.util.List; |
10 | 12 |
|
11 | 13 |
@Component |
12 | 14 |
public class MonitorApiImpl implements MonitorApi { |
13 | 15 |
|
16 |
@Autowired |
|
14 | 17 |
private ServiceLocator<ValidatorService> validatorServiceLocator; |
15 | 18 |
|
16 | 19 |
private ValidatorService getValidationService() { |
... | ... | |
26 | 29 |
} |
27 | 30 |
|
28 | 31 |
@Override |
29 |
public List<StoredJob> getJobsOfUser(String params) { |
|
32 |
public List<StoredJob> getJobsOfUser(String params) throws JSONException {
|
|
30 | 33 |
JSONObject json_params = new JSONObject(params); |
31 | 34 |
|
32 | 35 |
String user = json_params.getString("user"); |
... | ... | |
49 | 52 |
} |
50 | 53 |
|
51 | 54 |
@Override |
52 |
public int getJobsOfUserPerValidationStatus(String params) { |
|
55 |
public int getJobsOfUserPerValidationStatus(String params) throws JSONException {
|
|
53 | 56 |
JSONObject json_params = new JSONObject(params); |
54 | 57 |
|
55 | 58 |
String user = json_params.getString("user"); |
... | ... | |
64 | 67 |
} |
65 | 68 |
|
66 | 69 |
@Override |
67 |
public StoredJob getJobSummary(String params) { |
|
70 |
public StoredJob getJobSummary(String params) throws JSONException {
|
|
68 | 71 |
JSONObject json_params = new JSONObject(params); |
69 | 72 |
|
70 | 73 |
String jobId = json_params.getString("jobId"); |
Also available in: Unified diff
Configuration