Revision 0fd7ff08
Added by Cherian Mathew almost 9 years ago
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/source/CdmRemoteSourceBase.java | ||
---|---|---|
12 | 12 |
|
13 | 13 |
import org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean; |
14 | 14 |
|
15 |
import eu.etaxonomy.cdm.api.service.IDatabaseService;
|
|
15 |
import eu.etaxonomy.cdm.api.service.IUserService;
|
|
16 | 16 |
import eu.etaxonomy.cdm.config.CdmSource; |
17 | 17 |
import eu.etaxonomy.cdm.config.CdmSourceException; |
18 | 18 |
import eu.etaxonomy.cdm.model.metadata.CdmMetaData.MetaDataPropertyName; |
... | ... | |
34 | 34 |
private String contextPath; |
35 | 35 |
private String baseUrl; |
36 | 36 |
|
37 |
private IDatabaseService databaseService;
|
|
37 |
private IUserService userService;
|
|
38 | 38 |
|
39 | 39 |
/** |
40 | 40 |
* Constructs a CdmRemoteSourceBase object with default values. |
... | ... | |
76 | 76 |
// application context initialsation) since it is required to |
77 | 77 |
// to make queries related to the source database |
78 | 78 |
HttpInvokerProxyFactoryBean proxy = new HttpInvokerProxyFactoryBean(); |
79 |
proxy.setServiceInterface(IDatabaseService.class);
|
|
79 |
proxy.setServiceInterface(IUserService.class);
|
|
80 | 80 |
// FIXME:Remoting need to fix this hardcoded url and make it configurable somehow |
81 |
proxy.setServiceUrl(baseUrl + "/remoting-public/database.service");
|
|
81 |
proxy.setServiceUrl(baseUrl + "/remoting-public/user.service");
|
|
82 | 82 |
proxy.afterPropertiesSet(); |
83 |
databaseService = (IDatabaseService) proxy.getObject();
|
|
83 |
userService = (IUserService) proxy.getObject();
|
|
84 | 84 |
|
85 | 85 |
} |
86 | 86 |
|
... | ... | |
128 | 128 |
*/ |
129 | 129 |
@Override |
130 | 130 |
public String getDbSchemaVersion() throws CdmSourceException { |
131 |
return databaseService.getDbSchemaVersion();
|
|
131 |
return userService.getDbSchemaVersion();
|
|
132 | 132 |
|
133 | 133 |
} |
134 | 134 |
|
... | ... | |
137 | 137 |
*/ |
138 | 138 |
@Override |
139 | 139 |
public boolean isDbEmpty() throws CdmSourceException { |
140 |
return databaseService.isDbEmpty();
|
|
140 |
return userService.isDbEmpty();
|
|
141 | 141 |
|
142 | 142 |
} |
143 | 143 |
|
... | ... | |
151 | 151 |
// if no exception is thrown then we assume that the |
152 | 152 |
// connection is up |
153 | 153 |
// FIXME:Remoting is this really correct? |
154 |
databaseService.getDbSchemaVersion();
|
|
154 |
userService.getDbSchemaVersion();
|
|
155 | 155 |
|
156 | 156 |
return true; |
157 | 157 |
} |
... | ... | |
167 | 167 |
|
168 | 168 |
@Override |
169 | 169 |
public Map<MetaDataPropertyName, String> getMetaDataMap() throws CdmSourceException { |
170 |
return databaseService.getCdmMetadataMap();
|
|
170 |
return userService.getCdmMetadataMap();
|
|
171 | 171 |
} |
172 | 172 |
|
173 | 173 |
|
Also available in: Unified diff
CdmRemoteSourceBase : using user service for db checks
httpInvokerServiceClients.xml : updated database service config
HttpInvokerServicesTest : added polytomous key service ping
server.properties : added back server properties file