1
|
package eu.dnetlib.enabling.datasources;
|
2
|
|
3
|
import java.util.Date;
|
4
|
import java.util.List;
|
5
|
import java.util.Map;
|
6
|
|
7
|
import eu.dnetlib.enabling.tools.AbstractBaseService;
|
8
|
import eu.dnetlib.rmi.datasource.*;
|
9
|
import org.springframework.beans.factory.annotation.Required;
|
10
|
|
11
|
public class DatasourceManagerServiceImpl extends AbstractBaseService implements DatasourceManagerService {
|
12
|
|
13
|
//private List<XmlBrowsableField> browsableFields;
|
14
|
|
15
|
private DnetDatasourceManagerCore datasourceManagerCore;
|
16
|
|
17
|
@Override
|
18
|
public boolean addDatasource(final DatasourceDesc ds) throws DatasourceManagerServiceException {
|
19
|
return datasourceManagerCore.addDatasource(ds);
|
20
|
}
|
21
|
|
22
|
@Override
|
23
|
public boolean deleteDatasource(final String dsId) throws DatasourceManagerServiceException {
|
24
|
return datasourceManagerCore.deleteDatasource(dsId);
|
25
|
}
|
26
|
|
27
|
@Override
|
28
|
public DatasourceDesc getDatasource(final String dsId) throws DatasourceManagerServiceException {
|
29
|
return datasourceManagerCore.getDatasource(dsId);
|
30
|
}
|
31
|
|
32
|
@Override
|
33
|
public List<DatasourceDesc> listAllDatasources() throws DatasourceManagerServiceException {
|
34
|
return listDatasourcesUsingFilter(null, null, null, null);
|
35
|
}
|
36
|
|
37
|
@Override
|
38
|
public List<DatasourceDesc> listDatasourcesUsingFilter(final String compliance,
|
39
|
final String contentDescription,
|
40
|
final String iisProcessingWorkflow,
|
41
|
final String collectedFrom)
|
42
|
throws DatasourceManagerServiceException {
|
43
|
|
44
|
return datasourceManagerCore.listDatasourcesUsingFilter(compliance, contentDescription, iisProcessingWorkflow, collectedFrom);
|
45
|
|
46
|
}
|
47
|
|
48
|
@Override
|
49
|
public boolean updateLevelOfCompliance(final String dsId, final String ifaceId, final String level) throws DatasourceManagerServiceException {
|
50
|
return datasourceManagerCore.updateLevelOfCompliance(dsId, ifaceId, level);
|
51
|
}
|
52
|
|
53
|
|
54
|
|
55
|
@Override
|
56
|
public boolean updateBaseUrl(final String dsId, final String ifaceId, final String baseUrl) throws DatasourceManagerServiceException {
|
57
|
return datasourceManagerCore.updateBaseUrl(dsId, ifaceId, baseUrl);
|
58
|
}
|
59
|
|
60
|
|
61
|
|
62
|
@Override
|
63
|
public boolean updateActivationStatus(final String dsId, final String ifaceId, final boolean active) throws DatasourceManagerServiceException {
|
64
|
return datasourceManagerCore.updateActivationStatus(dsId, ifaceId, active);
|
65
|
}
|
66
|
|
67
|
|
68
|
|
69
|
@Override
|
70
|
public boolean updateContentDescription(final String dsId, final String ifaceId, final String desc) throws DatasourceManagerServiceException {
|
71
|
return datasourceManagerCore.updateContentDescription(dsId, ifaceId, desc);
|
72
|
}
|
73
|
|
74
|
|
75
|
|
76
|
@Override
|
77
|
public boolean setIisProcessingWorkflow(final String dsId, final String ifaceId, final String wf) throws DatasourceManagerServiceException {
|
78
|
return datasourceManagerCore.setIisProcessingWorkflow(dsId, ifaceId, wf);
|
79
|
}
|
80
|
|
81
|
@Override
|
82
|
public boolean updateExtraField(final String dsId, final String ifaceId, final String field, final String value, final boolean preserveOriginal)
|
83
|
throws DatasourceManagerServiceException {
|
84
|
return datasourceManagerCore.updateExtraField(dsId, ifaceId, field, value, preserveOriginal);
|
85
|
}
|
86
|
|
87
|
|
88
|
|
89
|
@Override
|
90
|
public boolean updateAccessParam(final String dsId, final String ifaceId, final String field, final String value, final boolean preserveOriginal)
|
91
|
throws DatasourceManagerServiceException {
|
92
|
return datasourceManagerCore.updateAccessParam(dsId, ifaceId, field, value, preserveOriginal);
|
93
|
}
|
94
|
|
95
|
|
96
|
|
97
|
@Override
|
98
|
public boolean deleteAccessParamOrExtraField(final String dsId, final String ifaceId, final String field) throws DatasourceManagerServiceException {
|
99
|
return datasourceManagerCore.deleteAccessParamOrExtraField(dsId, ifaceId, field);
|
100
|
}
|
101
|
|
102
|
|
103
|
|
104
|
@Override
|
105
|
public boolean addInterface(final String dsId, final IfaceDesc iface) throws DatasourceManagerServiceException {
|
106
|
return datasourceManagerCore.addInterface(dsId, iface);
|
107
|
}
|
108
|
|
109
|
@Override
|
110
|
public boolean deleteInterface(final String dsId, final String ifaceId) throws DatasourceManagerServiceException {
|
111
|
return datasourceManagerCore.deleteInterface(dsId, ifaceId);
|
112
|
}
|
113
|
|
114
|
|
115
|
|
116
|
@Override
|
117
|
public boolean updateSQL(final String dsId, final String sql, final boolean delete) throws DatasourceManagerServiceException {
|
118
|
return datasourceManagerCore.updateSQL(dsId, sql, delete);
|
119
|
}
|
120
|
|
121
|
@Override
|
122
|
public Date findNextScheduledExecution(final String dsId, final String ifaceId) throws DatasourceManagerServiceException {
|
123
|
return datasourceManagerCore.findNextScheduledExecution(dsId, ifaceId);
|
124
|
}
|
125
|
|
126
|
|
127
|
|
128
|
@Override
|
129
|
public boolean bulkUpdateApiExtraFields(final String repoId, final String ifaceId, final Map<String, String> fields)
|
130
|
throws DatasourceManagerServiceException {
|
131
|
return datasourceManagerCore.bulkUpdateApiExtraFields(repoId, ifaceId, fields);
|
132
|
|
133
|
}
|
134
|
|
135
|
@Override
|
136
|
public boolean bulkUpdateApiAccessParams(final String dsId, final String ifaceId, final Map<String, String> params)
|
137
|
throws DatasourceManagerServiceException {
|
138
|
return datasourceManagerCore.bulkUpdateApiAccessParams(dsId, ifaceId, params);
|
139
|
}
|
140
|
|
141
|
|
142
|
|
143
|
@Override
|
144
|
public boolean overrideCompliance(final String dsId, final String ifaceId, final String level) throws DatasourceManagerServiceException {
|
145
|
return datasourceManagerCore.overrideCompliance(dsId, ifaceId, level);
|
146
|
}
|
147
|
|
148
|
|
149
|
|
150
|
@Override
|
151
|
public List<BrowsableField> listBrowsableFields() throws DatasourceManagerServiceException {
|
152
|
return datasourceManagerCore.listBrowsableFields();
|
153
|
}
|
154
|
|
155
|
@Override
|
156
|
public List<BrowseTerm> browseField(final String f) throws DatasourceManagerServiceException {
|
157
|
return datasourceManagerCore.browseField(f);
|
158
|
}
|
159
|
|
160
|
@Override
|
161
|
public List<SearchInterfacesEntry> searchInterface(final String field, final String value) throws DatasourceManagerServiceException {
|
162
|
return datasourceManagerCore.searchInterface(field, value);
|
163
|
}
|
164
|
|
165
|
|
166
|
|
167
|
@Override
|
168
|
public List<RepositoryMapEntry> getRepositoryMap() throws DatasourceManagerServiceException {
|
169
|
return datasourceManagerCore.getRepositoryMap();
|
170
|
}
|
171
|
|
172
|
@Override
|
173
|
public List<SimpleDatasourceDesc> simpleListDatasourcesByType(final String type) throws DatasourceManagerServiceException {
|
174
|
return datasourceManagerCore.simpleListDatasourcesByType(type);
|
175
|
}
|
176
|
|
177
|
public DnetDatasourceManagerCore getDatasourceManagerCore() {
|
178
|
return datasourceManagerCore;
|
179
|
}
|
180
|
|
181
|
@Required
|
182
|
public void setDatasourceManagerCore(final DnetDatasourceManagerCore datasourceManagerCore) {
|
183
|
this.datasourceManagerCore = datasourceManagerCore;
|
184
|
}
|
185
|
|
186
|
|
187
|
|
188
|
}
|