Revision 32270
Added by Nikon Gasparis about 10 years ago
modules/uoa-clients/trunk/src/test/java/eu/dnetlib/clients/TestStoreServiceClient.java | ||
---|---|---|
1 |
package eu.dnetlib.clients; |
|
2 |
|
|
3 |
import java.util.ArrayList; |
|
4 |
import java.util.Arrays; |
|
5 |
import java.util.List; |
|
6 |
|
|
7 |
import junit.framework.Assert; |
|
8 |
|
|
9 |
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; |
|
10 |
import org.apache.log4j.BasicConfigurator; |
|
11 |
import org.junit.BeforeClass; |
|
12 |
import org.junit.Test; |
|
13 |
|
|
14 |
import eu.dnetlib.api.data.DataAccessServiceException; |
|
15 |
import eu.dnetlib.api.data.StoreService.DataType; |
|
16 |
import eu.dnetlib.api.data.StoreService.StoringType; |
|
17 |
import eu.dnetlib.api.data.StoreServiceException; |
|
18 |
import eu.dnetlib.api.enabling.ResultSetServiceException; |
|
19 |
import eu.dnetlib.clients.data.dataaccess.ws.DataAccessServiceWSClient; |
|
20 |
import eu.dnetlib.clients.data.store.ws.StoreServiceWSClient; |
|
21 |
import eu.dnetlib.data.sts.das.IDataAccessService; |
|
22 |
import eu.dnetlib.data.sts.ds.IDepotService; |
|
23 |
import eu.dnetlib.domain.data.StoreInfo; |
|
24 |
import eu.dnetlib.domain.data.StoreObjectInfo; |
|
25 |
|
|
26 |
public class TestStoreServiceClient { |
|
27 |
private static StoreServiceWSClient storeService = null; |
|
28 |
private static DataAccessServiceWSClient accessService = null; |
|
29 |
|
|
30 |
@BeforeClass |
|
31 |
public static void setup() { |
|
32 |
String depotServiceUrl = "http://129.70.40.102:8380/dnet-sts-ds/services/DepotService"; |
|
33 |
String accessServiceUrl = "http://129.70.40.102:8480/dnet-sts-das/services/DataAccessService"; |
|
34 |
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); |
|
35 |
factory.setServiceClass(IDepotService.class); |
|
36 |
factory.setAddress(depotServiceUrl); |
|
37 |
|
|
38 |
storeService = new StoreServiceWSClient(); |
|
39 |
storeService.setWebService((IDepotService) factory.create()); |
|
40 |
|
|
41 |
factory = new JaxWsProxyFactoryBean(); |
|
42 |
factory.setServiceClass(IDataAccessService.class); |
|
43 |
factory.setAddress(accessServiceUrl); |
|
44 |
|
|
45 |
accessService = new DataAccessServiceWSClient(); |
|
46 |
accessService.setWebService(factory.create()); |
|
47 |
|
|
48 |
BasicConfigurator.configure(); |
|
49 |
} |
|
50 |
|
|
51 |
@Test |
|
52 |
public void test() throws StoreServiceException, DataAccessServiceException, InterruptedException, ResultSetServiceException { |
|
53 |
StoreInfo storeInfo = storeService.createStore(new ArrayList<String>(), 10); |
|
54 |
|
|
55 |
List<StoreObjectInfo> objects = storeService.storeObjects(storeInfo.getStoreId(), |
|
56 |
Arrays.asList("http://peppas2.pblogs.gr/files/112454-565px-Olympiakos4.svg%5B1%5D.png"), DataType.URL, StoringType.REFRESH); |
|
57 |
|
|
58 |
Assert.assertNotNull(objects); |
|
59 |
Assert.assertEquals(1, objects.size()); |
|
60 |
|
|
61 |
Thread.sleep(20000); |
|
62 |
|
|
63 |
for (StoreObjectInfo object:objects) { |
|
64 |
String objectUrl = accessService.getObjectUrl(object.getStoreInfo().getStoreId(), object.getObjectId()); |
|
65 |
|
|
66 |
Assert.assertNotNull(objectUrl); |
|
67 |
System.out.println(objectUrl); |
|
68 |
|
|
69 |
storeService.deleteStoreObject(object.getStoreInfo().getStoreId(), Arrays.asList(object.getObjectId())); |
|
70 |
} |
|
71 |
|
|
72 |
for (StoreObjectInfo object:objects) { |
|
73 |
storeService.deleteStoreObject(object.getStoreInfo().getStoreId(), Arrays.asList(object.getObjectId())); |
|
74 |
} |
|
75 |
|
|
76 |
storeService.deleteStore(objects.get(0).getStoreInfo().getStoreId()); |
|
77 |
} |
|
78 |
} |
modules/uoa-clients/trunk/src/main/java/eu/dnetlib/clients/data/dataaccess/ws/DataAccessServiceWSClient.java | ||
---|---|---|
1 |
package eu.dnetlib.clients.data.dataaccess.ws; |
|
2 |
|
|
3 |
import javax.xml.ws.wsaddressing.W3CEndpointReference; |
|
4 |
|
|
5 |
import eu.dnetlib.api.DriverServiceException; |
|
6 |
import eu.dnetlib.api.data.DataAccessService; |
|
7 |
import eu.dnetlib.api.data.DataAccessServiceException; |
|
8 |
import eu.dnetlib.data.sts.das.IDataAccessService; |
|
9 |
import eu.dnetlib.domain.EPR; |
|
10 |
import eu.dnetlib.domain.ServiceIdentity; |
|
11 |
import eu.dnetlib.domain.enabling.Notification; |
|
12 |
import eu.dnetlib.utils.EPRUtils; |
|
13 |
import eu.dnetlib.utils.ServiceIdentityFactory; |
|
14 |
|
|
15 |
public class DataAccessServiceWSClient implements DataAccessService { |
|
16 |
private IDataAccessService service = null; |
|
17 |
|
|
18 |
public void setWebService(Object endpoint) { |
|
19 |
this.service = (IDataAccessService) endpoint; |
|
20 |
} |
|
21 |
|
|
22 |
@Override |
|
23 |
public String getObjectSDO(String storeId, String objectId) |
|
24 |
throws DataAccessServiceException { |
|
25 |
try { |
|
26 |
return service.getObjectSDO(objectId, storeId); |
|
27 |
} catch (eu.dnetlib.data.sts.das.DataAccessServiceException e) { |
|
28 |
throw new DataAccessServiceException("Error getting object SDO", e); |
|
29 |
} |
|
30 |
} |
|
31 |
|
|
32 |
@Override |
|
33 |
public String getObjectUrl(String storeId, String objectId) |
|
34 |
throws DataAccessServiceException { |
|
35 |
try { |
|
36 |
return service.getObjectUrl(objectId, storeId); |
|
37 |
} catch (eu.dnetlib.data.sts.das.DataAccessServiceException e) { |
|
38 |
throw new DataAccessServiceException("Error getting object Url", e); |
|
39 |
} |
|
40 |
} |
|
41 |
|
|
42 |
@Override |
|
43 |
public EPR storeLookUpDataRS(String storeId) |
|
44 |
throws DataAccessServiceException { |
|
45 |
try { |
|
46 |
W3CEndpointReference w3cEpr = service.storeLookUpDataRS(storeId); |
|
47 |
|
|
48 |
return EPRUtils.createEPR(w3cEpr); |
|
49 |
} catch (eu.dnetlib.data.sts.das.DataAccessServiceException e) { |
|
50 |
throw new DataAccessServiceException("Error searching store", e); |
|
51 |
} |
|
52 |
} |
|
53 |
|
|
54 |
@Override |
|
55 |
public EPR storeLookUpRS(String storeId) throws DataAccessServiceException { |
|
56 |
try { |
|
57 |
W3CEndpointReference w3cEpr = service.storeLookUpRS(storeId); |
|
58 |
|
|
59 |
return EPRUtils.createEPR(w3cEpr); |
|
60 |
} catch (eu.dnetlib.data.sts.das.DataAccessServiceException e) { |
|
61 |
throw new DataAccessServiceException("Error searching store", e); |
|
62 |
} |
|
63 |
} |
|
64 |
|
|
65 |
@Override |
|
66 |
public EPR storeLookUpSDORS(String storeId) |
|
67 |
throws DataAccessServiceException { |
|
68 |
try { |
|
69 |
W3CEndpointReference w3cEpr = service.storeLookUpSDORS(storeId); |
|
70 |
|
|
71 |
return EPRUtils.createEPR(w3cEpr); |
|
72 |
} catch (eu.dnetlib.data.sts.das.DataAccessServiceException e) { |
|
73 |
throw new DataAccessServiceException("Error searching store", e); |
|
74 |
} |
|
75 |
} |
|
76 |
|
|
77 |
@Override |
|
78 |
public ServiceIdentity identify() { |
|
79 |
return ServiceIdentityFactory.parseIdentity(service.identify()); |
|
80 |
} |
|
81 |
|
|
82 |
@Override |
|
83 |
public void notify(Notification notification) throws DriverServiceException { |
|
84 |
throw new UnsupportedOperationException(); |
|
85 |
} |
|
86 |
} |
modules/uoa-clients/trunk/src/main/java/eu/dnetlib/clients/data/store/ws/StoreServiceWSClient.java | ||
---|---|---|
1 |
package eu.dnetlib.clients.data.store.ws; |
|
2 |
|
|
3 |
import java.util.ArrayList; |
|
4 |
import java.util.Arrays; |
|
5 |
import java.util.List; |
|
6 |
|
|
7 |
import javax.xml.ws.BindingProvider; |
|
8 |
import javax.xml.ws.wsaddressing.W3CEndpointReference; |
|
9 |
|
|
10 |
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; |
|
11 |
import org.apache.log4j.Logger; |
|
12 |
|
|
13 |
import eu.dnetlib.api.DriverServiceException; |
|
14 |
import eu.dnetlib.api.data.StoreService; |
|
15 |
import eu.dnetlib.api.data.StoreServiceException; |
|
16 |
import eu.dnetlib.data.sts.ds.DepotServiceException; |
|
17 |
import eu.dnetlib.data.sts.ds.IDepotService; |
|
18 |
import eu.dnetlib.domain.EPR; |
|
19 |
import eu.dnetlib.domain.ServiceIdentity; |
|
20 |
import eu.dnetlib.domain.data.StoreInfo; |
|
21 |
import eu.dnetlib.domain.data.StoreObjectInfo; |
|
22 |
import eu.dnetlib.domain.enabling.Notification; |
|
23 |
import eu.dnetlib.utils.EPRUtils; |
|
24 |
import eu.dnetlib.utils.ServiceIdentityFactory; |
|
25 |
|
|
26 |
public class StoreServiceWSClient implements StoreService { |
|
27 |
private static Logger logger = Logger.getLogger(StoreServiceWSClient.class); |
|
28 |
private String serviceUrl = null; |
|
29 |
private IDepotService service = null; |
|
30 |
|
|
31 |
public StoreServiceWSClient(String serviceUrl) { |
|
32 |
this.serviceUrl = serviceUrl; |
|
33 |
|
|
34 |
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); |
|
35 |
factory.setServiceClass( eu.dnetlib.data.sts.ds.IDepotService.class); |
|
36 |
factory.setAddress(serviceUrl); |
|
37 |
this.service = (IDepotService) factory.create(); |
|
38 |
} |
|
39 |
|
|
40 |
public StoreServiceWSClient() { |
|
41 |
} |
|
42 |
|
|
43 |
public void setWebService(Object webService) { |
|
44 |
BindingProvider prov = (BindingProvider) webService; |
|
45 |
|
|
46 |
W3CEndpointReference w3cepr = prov.getEndpointReference(W3CEndpointReference.class); |
|
47 |
EPR epr = EPRUtils.createEPR(w3cepr); |
|
48 |
|
|
49 |
this.serviceUrl = epr.getAddress(); |
|
50 |
this.service = (IDepotService) webService; |
|
51 |
|
|
52 |
logger.debug("Setting serviceUrl to: " + serviceUrl); |
|
53 |
} |
|
54 |
|
|
55 |
@Override |
|
56 |
public ServiceIdentity identify() { |
|
57 |
return ServiceIdentityFactory.parseIdentity(service.identify()); |
|
58 |
} |
|
59 |
|
|
60 |
@Override |
|
61 |
public void notify(Notification notification) throws DriverServiceException { |
|
62 |
throw new UnsupportedOperationException(); |
|
63 |
} |
|
64 |
|
|
65 |
@Override |
|
66 |
public StoreInfo createStore(List<String> predefinedObjectTypes, |
|
67 |
long maxSizeStoreDS) throws StoreServiceException { |
|
68 |
try { |
|
69 |
String storeId = service.createStore(predefinedObjectTypes, maxSizeStoreDS); |
|
70 |
logger.debug("Created store with id: " + storeId); |
|
71 |
StoreInfo storeInfo = new StoreInfo(); |
|
72 |
|
|
73 |
storeInfo.setServiceUrl(serviceUrl); |
|
74 |
storeInfo.setStoreId(storeId); |
|
75 |
|
|
76 |
return storeInfo; |
|
77 |
|
|
78 |
} catch (Exception e) { |
|
79 |
throw new StoreServiceException(e); |
|
80 |
} |
|
81 |
} |
|
82 |
|
|
83 |
@Override |
|
84 |
public void deleteStore(String storeId) throws StoreServiceException { |
|
85 |
try { |
|
86 |
logger.debug("Deleting store with id: " + storeId); |
|
87 |
service.deleteStore(storeId); |
|
88 |
} catch (Exception e) { |
|
89 |
throw new StoreServiceException(e); |
|
90 |
} |
|
91 |
} |
|
92 |
|
|
93 |
@Override |
|
94 |
public boolean deleteStoreObject(String storeId, List<String> storeObjectIds) |
|
95 |
throws StoreServiceException { |
|
96 |
try { |
|
97 |
if (logger.isDebugEnabled()) { |
|
98 |
logger.debug("Deleting from store " + storeId + " objects with" |
|
99 |
+ " ids " + Arrays.toString(storeObjectIds.toArray(new String[] {}))); |
|
100 |
} |
|
101 |
|
|
102 |
return service.deleteStoreObject(storeId, storeObjectIds); |
|
103 |
} catch (Exception e) { |
|
104 |
throw new StoreServiceException(e); |
|
105 |
} |
|
106 |
} |
|
107 |
|
|
108 |
@Override |
|
109 |
@Deprecated |
|
110 |
public boolean deleteStoreObjectFromRS(String storeId, EPR rsEPR) |
|
111 |
throws StoreServiceException { |
|
112 |
throw new UnsupportedOperationException(); |
|
113 |
} |
|
114 |
|
|
115 |
@Override |
|
116 |
public List<StoreObjectInfo> storeObjects(String storeId, |
|
117 |
List<String> objectsForStoring, DataType dataType, StoringType storingType) |
|
118 |
throws StoreServiceException { |
|
119 |
try { |
|
120 |
List<String> storeObjects = new ArrayList<String>(); |
|
121 |
List<StoreObjectInfo> objectInfoList = new ArrayList<StoreObjectInfo>(); |
|
122 |
StoreInfo storeInfo = new StoreInfo(); |
|
123 |
|
|
124 |
storeInfo.setServiceUrl(this.serviceUrl); |
|
125 |
storeInfo.setStoreId(storeId); |
|
126 |
|
|
127 |
for (String object:objectsForStoring) { |
|
128 |
String objectId = this.generateRandomID(object); |
|
129 |
StoreObjectInfo objectInfo = new StoreObjectInfo(); |
|
130 |
|
|
131 |
if (logger.isDebugEnabled()) { |
|
132 |
logger.debug("Storing object " + object + " to store with" |
|
133 |
+ " id " + storeId + ". DataType: " + dataType |
|
134 |
+ ", StoringType: " + storingType +", objectId: " |
|
135 |
+ objectId); |
|
136 |
} |
|
137 |
|
|
138 |
storeObjects.add(this.getStoreRecord(object, dataType, objectId)); |
|
139 |
|
|
140 |
objectInfo.setObjectId(objectId); |
|
141 |
objectInfo.setStoreInfo(storeInfo); |
|
142 |
objectInfoList.add(objectInfo); |
|
143 |
} |
|
144 |
|
|
145 |
String actionId = service.storeObjects(storeId, storeObjects, storingType.getValue(), false); |
|
146 |
|
|
147 |
logger.debug("Store action id: " + actionId); |
|
148 |
|
|
149 |
return objectInfoList; |
|
150 |
} catch (DepotServiceException e) { |
|
151 |
throw new StoreServiceException(e); |
|
152 |
} |
|
153 |
} |
|
154 |
|
|
155 |
/* |
|
156 |
<storeRecord> |
|
157 |
<storeRecordIdentifier>...</storeRecordIdentifier> |
|
158 |
<storeObject datatype="URI|Data">...<storeObject> |
|
159 |
</storeRecord> |
|
160 |
*/ |
|
161 |
private String getStoreRecord(String objectForStoring, DataType dataType, String objectId) { |
|
162 |
StringBuilder builder = new StringBuilder(); |
|
163 |
|
|
164 |
builder.append("<storeRecord><storeRecordIdentifier>"); |
|
165 |
builder.append(objectId); |
|
166 |
builder.append("</storeRecordIdentifier><storeObject datatype=\""); |
|
167 |
builder.append(dataType.getValue()); |
|
168 |
builder.append("\" >").append(objectForStoring); |
|
169 |
builder.append("</storeObject></storeRecord>"); |
|
170 |
|
|
171 |
logger.debug("store record: " + builder.toString()); |
|
172 |
|
|
173 |
return builder.toString(); |
|
174 |
} |
|
175 |
|
|
176 |
private String generateRandomID(String object) { |
|
177 |
return System.currentTimeMillis() + "-" + object.hashCode(); |
|
178 |
} |
|
179 |
|
|
180 |
@Override |
|
181 |
public List<StoreObjectInfo> storeObjectsFromRS(String storeId, EPR rsEPR, |
|
182 |
DataType dataType, StoringType storingType) throws StoreServiceException { |
|
183 |
throw new UnsupportedOperationException(); |
|
184 |
} |
|
185 |
|
|
186 |
@Override |
|
187 |
public boolean updateStore(String storeId, long maxSizeStoreDS, |
|
188 |
List<String> predefinedObjectTypes) throws StoreServiceException { |
|
189 |
try { |
|
190 |
return service.updateStore(storeId, maxSizeStoreDS, predefinedObjectTypes); |
|
191 |
} catch (Exception e) { |
|
192 |
throw new StoreServiceException(e); |
|
193 |
} |
|
194 |
} |
|
195 |
} |
modules/uoa-clients/trunk/src/main/java/eu/dnetlib/clients/enabling/hcm/ws/HostingContextManagerWebServiceImpl.java | ||
---|---|---|
9 | 9 |
targetNamespace ="http://services.dnetlib.eu/", |
10 | 10 |
serviceName="HostingContextManagerWebService", |
11 | 11 |
endpointInterface = "eu.dnetlib.clients.enabling.hcm.ws.HostingContextManagerWebService") |
12 |
// endpointInterface="eu.dnetlib.enabling.hcm.rmi.HostingContextManagerService") |
|
13 | 12 |
public class HostingContextManagerWebServiceImpl |
14 | 13 |
extends BaseDriverWebService<HostingContextManagerService> |
15 | 14 |
implements HostingContextManagerWebService { |
modules/uoa-clients/trunk/src/main/java/eu/dnetlib/clients/utils/ws/CompatibilityServiceLocatorFactory.java | ||
---|---|---|
3 | 3 |
//import deltix.qsrv.comm.xml.ThrowableTransientAnnotationReaderBuilder; |
4 | 4 |
import eu.dnetlib.api.DriverService; |
5 | 5 |
import eu.dnetlib.api.DriverServiceEndpoint; |
6 |
import eu.dnetlib.api.data.StoreService; |
|
7 | 6 |
import eu.dnetlib.api.enabling.A2Service; |
8 |
import eu.dnetlib.clients.data.store.ws.StoreServiceWSClient; |
|
9 |
import eu.dnetlib.clients.enabling.aas.ws.AASClient; |
|
10 | 7 |
import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpService; |
11 | 8 |
import eu.dnetlib.enabling.tools.DynamicServiceLocator; |
12 | 9 |
import eu.dnetlib.enabling.tools.DynamicServiceLocatorLocationScorer; |
... | ... | |
19 | 16 |
import gr.uoa.di.driver.util.RefreshingServiceLocator; |
20 | 17 |
import gr.uoa.di.driver.util.ServiceLocator; |
21 | 18 |
import gr.uoa.di.driver.util.ServiceLocatorFactory; |
22 |
import gr.uoa.di.driver.util.StaticServiceLocator; |
|
23 | 19 |
|
24 |
import java.util.HashMap; |
|
25 | 20 |
import java.util.Map; |
26 | 21 |
import java.util.concurrent.Executors; |
27 | 22 |
import java.util.concurrent.ScheduledExecutorService; |
28 | 23 |
|
29 |
import org.apache.cxf.jaxb.JAXBDataBinding; |
|
30 |
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; |
|
31 | 24 |
import org.apache.log4j.Logger; |
32 | 25 |
|
33 | 26 |
/** |
... | ... | |
78 | 71 |
// if (serviceClass.equals(A2Service.class)) |
79 | 72 |
// return (ServiceLocator<S>) newA2ServiceLocator(serviceUrl); |
80 | 73 |
// else |
81 |
if (serviceClass.equals(StoreService.class)) |
|
82 |
return (ServiceLocator<S>) newStoreServiceClient(serviceUrl); |
|
83 |
else |
|
74 |
// if (serviceClass.equals(StoreService.class))
|
|
75 |
// return (ServiceLocator<S>) newStoreServiceClient(serviceUrl);
|
|
76 |
// else
|
|
84 | 77 |
return new FallBackServiceLocator<S>( |
85 | 78 |
newRefreshingServiceLocator(newDynamicServiceLocator(serviceClass)), |
86 | 79 |
newUrlServiceLocator(serviceClass, serviceUrl)); |
87 | 80 |
} |
88 | 81 |
|
89 |
private ServiceLocator<StoreService> newStoreServiceClient(String serviceUrl) { |
|
90 |
StoreServiceWSClient client = new StoreServiceWSClient(serviceUrl); |
|
91 |
StaticServiceLocator<StoreService> locator = new StaticServiceLocator<StoreService>(); |
|
92 |
|
|
93 |
locator.setService(client); |
|
94 |
|
|
95 |
return locator; |
|
96 |
} |
|
97 |
|
|
98 | 82 |
private <S extends DriverService> ServiceLocator<S> newRefreshingServiceLocator( |
99 | 83 |
ServiceLocator<S> locator) { |
100 | 84 |
RefreshingServiceLocator<S> rLocator = new RefreshingServiceLocator<S>(); |
modules/uoa-clients/trunk/src/main/java/eu/dnetlib/clients/data/index/ws/IndexWSClient.java | ||
---|---|---|
13 | 13 |
import eu.dnetlib.api.DriverServiceException; |
14 | 14 |
import eu.dnetlib.api.data.IndexService; |
15 | 15 |
import eu.dnetlib.api.data.IndexServiceException; |
16 |
import eu.dnetlib.data.index.IIndexService; |
|
17 | 16 |
import eu.dnetlib.domain.EPR; |
18 | 17 |
import eu.dnetlib.domain.ServiceIdentity; |
19 | 18 |
import eu.dnetlib.domain.data.Hint; |
20 | 19 |
import eu.dnetlib.domain.enabling.Notification; |
20 |
import eu.dnetlib.functionality.index.client.IndexClient; |
|
21 | 21 |
import eu.dnetlib.utils.EPRUtils; |
22 | 22 |
|
23 | 23 |
/** |
24 |
* @author Vassilis Stoumpos (stoumpos@di.uoa.gr)
|
|
24 |
* @author Nikon Gasparis
|
|
25 | 25 |
*/ |
26 | 26 |
public class IndexWSClient implements IndexService { |
27 | 27 |
|
28 | 28 |
private static Logger logger = Logger.getLogger(IndexWSClient.class); |
29 | 29 |
|
30 |
IIndexService client = null;
|
|
30 |
IndexClient client = null;
|
|
31 | 31 |
|
32 |
public void setClient(IIndexService client) {
|
|
32 |
public void setClient(IndexClient client) {
|
|
33 | 33 |
this.client = client; |
34 | 34 |
} |
35 | 35 |
|
36 |
public IIndexService getClient() {
|
|
36 |
public IndexClient getClient() {
|
|
37 | 37 |
return client; |
38 | 38 |
} |
39 | 39 |
|
40 | 40 |
public void setWebService(Object webService) { |
41 |
this.client = (IIndexService) webService;
|
|
41 |
this.client = (IndexClient) webService;
|
|
42 | 42 |
} |
43 | 43 |
|
44 | 44 |
public EPR getBrowsingStatistics(String query, String index, |
45 | 45 |
String mdFormatId, String layoutId) throws IndexServiceException { |
46 |
try { |
|
46 |
throw new UnsupportedOperationException(); |
|
47 |
/* try { |
|
47 | 48 |
if (logger.isDebugEnabled()) { |
48 | 49 |
logger.debug("Request Browsing Statistics for \"" |
49 | 50 |
+ query + "\" on index " + index |
... | ... | |
56 | 57 |
logger.debug("Result EPR: \"" + epr + "\""); |
57 | 58 |
} |
58 | 59 |
return epr; |
59 |
|
|
60 |
} catch (eu.dnetlib.data.index.IndexServiceException e) {
|
|
60 |
|
|
61 |
} catch (eu.dnetlib.functionality.index.client.IndexClientException e) {
|
|
61 | 62 |
throw new IndexServiceException( |
62 | 63 |
"Error calling index: " + e.getMessage()); |
63 | 64 |
} |
64 |
} |
|
65 |
*/ }
|
|
65 | 66 |
|
66 | 67 |
public String getIndexStatistics(String index) |
67 | 68 |
throws IndexServiceException { |
68 |
try { |
|
69 |
throw new UnsupportedOperationException(); |
|
70 |
/* try { |
|
69 | 71 |
if (logger.isDebugEnabled()) { |
70 | 72 |
logger.debug("Request Index Statistics on index " + index); |
71 | 73 |
} |
72 | 74 |
return client.getIndexStatistics(index); |
73 | 75 |
|
74 |
} catch (eu.dnetlib.data.index.IndexServiceException e) {
|
|
76 |
} catch (eu.dnetlib.functionality.index.client.IndexClientException e) {
|
|
75 | 77 |
throw new IndexServiceException( |
76 | 78 |
"Error calling index: " + e.getMessage()); |
77 | 79 |
} |
78 |
} |
|
80 |
*/ }
|
|
79 | 81 |
|
80 | 82 |
public List<String> getListOfIndices() throws IndexServiceException { |
81 |
if (logger.isDebugEnabled()) { |
|
83 |
throw new UnsupportedOperationException(); |
|
84 |
/* if (logger.isDebugEnabled()) { |
|
82 | 85 |
logger.debug("Request List of Indices"); |
83 | 86 |
} |
84 | 87 |
String[] list = client.getListOfIndices(); |
... | ... | |
93 | 96 |
} |
94 | 97 |
return Arrays.asList(list); |
95 | 98 |
} |
96 |
} |
|
99 |
*/ }
|
|
97 | 100 |
|
98 | 101 |
public String getListOfIndicesCSV() throws IndexServiceException { |
99 |
if (logger.isDebugEnabled()) { |
|
102 |
throw new UnsupportedOperationException(); |
|
103 |
/* if (logger.isDebugEnabled()) { |
|
100 | 104 |
logger.debug("Request List of Indices CSV"); |
101 | 105 |
} |
102 | 106 |
return client.getListOfIndicesCSV(); |
103 |
} |
|
107 |
*/ }
|
|
104 | 108 |
|
105 | 109 |
public EPR indexLookup( |
106 | 110 |
String id, String query, String mdformat, String layout) |
107 | 111 |
throws IndexServiceException { |
108 |
try { |
|
112 |
throw new UnsupportedOperationException(); |
|
113 |
/* try { |
|
109 | 114 |
if (logger.isDebugEnabled()) { |
110 | 115 |
logger.debug("Index Lookup for \"" + query + "\" on index " + id |
111 | 116 |
+ " using " + mdformat + "/" + layout); |
... | ... | |
118 | 123 |
} |
119 | 124 |
return epr; |
120 | 125 |
|
121 |
} catch (eu.dnetlib.data.index.IndexServiceException e) {
|
|
126 |
} catch (eu.dnetlib.functionality.index.client.IndexClientException e) {
|
|
122 | 127 |
throw new IndexServiceException( |
123 | 128 |
"Error calling index: " + e.getMessage()); |
124 | 129 |
} |
125 |
} |
|
130 |
*/ }
|
|
126 | 131 |
|
127 | 132 |
public ServiceIdentity identify() { |
128 | 133 |
throw new UnsupportedOperationException(); |
modules/uoa-clients/trunk/src/main/resources/eu/dnetlib/clients/ws/springContext-locatorFactory.xml | ||
---|---|---|
33 | 33 |
<entry key="eu.dnetlib.enabling.is.lookup.rmi.ISLookUpService" value="IS_LookUpService" /> |
34 | 34 |
<entry key="eu.dnetlib.enabling.is.sn.rmi.ISSNService" value="IS_SNService" /> |
35 | 35 |
<entry key="eu.dnetlib.enabling.database.rmi.DatabaseService" value="DatabaseService" /> |
36 |
<entry key="eu.dnetlib.data.index.IIndexService" value="IndexService" />
|
|
36 |
<entry key="eu.dnetlib.functionality.index.client.IndexClient" value="IndexService" />
|
|
37 | 37 |
<!-- <entry key="eu.dnetlib.data.information.similarity.ISimilarityService" value="SimilarityService" /> --> |
38 |
<entry key="eu.dnetlib.data.sts.ds.IDepotService" value="DepotService" /> |
|
39 |
<entry key="eu.dnetlib.data.sts.das.IDataAccessService" value="DataAccessService" /> |
|
40 | 38 |
</map> |
41 | 39 |
</property> |
42 | 40 |
</bean> |
... | ... | |
113 | 111 |
<property name="config" ref="transportConfiguration" /> |
114 | 112 |
<property name="serviceClass" value="eu.dnetlib.api.enabling.ActionManagerService" /> |
115 | 113 |
</bean> |
116 |
</entry> |
|
117 |
<entry key="eu.dnetlib.api.data.DataAccessService"> |
|
118 |
<bean class="eu.dnetlib.clients.utils.ws.CompatibilityServiceClientFactory"> |
|
119 |
<property name="config" ref="transportConfiguration" /> |
|
120 |
<property name="serviceClass" value="eu.dnetlib.api.data.DataAccessService" /> |
|
121 |
</bean> |
|
122 |
</entry> |
|
114 |
</entry> |
|
123 | 115 |
<entry key="eu.dnetlib.api.data.IndexService"> |
124 | 116 |
<bean class="eu.dnetlib.clients.utils.ws.CompatibilityServiceClientFactory"> |
125 | 117 |
<property name="config" ref="transportConfiguration" /> |
... | ... | |
142 | 134 |
<property name="cacheManager" ref="cacheManager" /> |
143 | 135 |
</bean> |
144 | 136 |
</entry> |
145 |
<entry key="eu.dnetlib.api.data.StoreService"> |
|
146 |
<bean class="eu.dnetlib.clients.utils.ws.CompatibilityServiceClientFactory"> |
|
147 |
<property name="config" ref="transportConfiguration" /> |
|
148 |
<property name="serviceClass" value="eu.dnetlib.api.data.StoreService" /> |
|
149 |
</bean> |
|
150 |
</entry> |
|
151 | 137 |
<entry key="eu.dnetlib.api.functionality.AlertService"> |
152 | 138 |
<bean class="eu.dnetlib.clients.utils.ws.CompatibilityServiceClientFactory"> |
153 | 139 |
<property name="config" ref="transportConfiguration" /> |
... | ... | |
235 | 221 |
class="eu.dnetlib.clients.utils.ws.CompatibilityTransportConfiguration"> |
236 | 222 |
<property name="clientMapping"> |
237 | 223 |
<map> |
238 |
<entry key="eu.dnetlib.api.data.DataAccessService" value="eu.dnetlib.clients.data.dataaccess.ws.DataAccessServiceWSClient"/> |
|
239 | 224 |
<entry key="eu.dnetlib.api.data.IndexService" value="eu.dnetlib.clients.data.index.ws.IndexWSClient" /> |
240 | 225 |
<entry key="eu.dnetlib.api.data.PublisherService" value="eu.dnetlib.clients.data.publisher.ws.PublisherWSClient" /> |
241 | 226 |
<entry key="eu.dnetlib.api.data.SearchService" value="eu.dnetlib.clients.data.search.ws.SearchWebServiceClient" /> |
242 | 227 |
<entry key="eu.dnetlib.api.data.SimilarityService" value="eu.dnetlib.clients.data.similarity.ws.SimilarityServiceWSClient"/> |
243 |
<entry key="eu.dnetlib.api.data.StoreService" value="eu.dnetlib.clients.data.store.ws.StoreServiceWSClient"/> |
|
244 | 228 |
<entry key="eu.dnetlib.api.data.DatasourceManagerService" value="eu.dnetlib.clients.data.datasourcemanager.ws.DatasourceManagerServiceClient"/> |
245 | 229 |
<entry key="eu.dnetlib.api.data.MDStoreService" value="eu.dnetlib.clients.data.mdstore.ws.MDStoreServiceWSClient"/> |
246 | 230 |
<entry key="eu.dnetlib.api.enabling.A2Service" value="eu.dnetlib.clients.enabling.aas.ws.AASClient" /> |
... | ... | |
270 | 254 |
</property> |
271 | 255 |
<property name="endpointMapping"> |
272 | 256 |
<map> |
273 |
<entry key="eu.dnetlib.api.data.DataAccessService" value="eu.dnetlib.data.sts.das.IDataAccessService"/> |
|
274 |
<entry key="eu.dnetlib.api.data.IndexService" value="eu.dnetlib.data.index.IIndexService" /> |
|
257 |
<entry key="eu.dnetlib.api.data.IndexService" value="eu.dnetlib.functionality.index.client.IndexClient" /> |
|
275 | 258 |
<entry key="eu.dnetlib.api.data.PublisherService" value="eu.dnetlib.data.information.publisher.rmi.PublisherService" /> |
276 | 259 |
<entry key="eu.dnetlib.api.data.SearchService" value="eu.dnetlib.clients.data.search.ws.SearchWebService" /> |
277 | 260 |
<!-- <entry key="eu.dnetlib.api.data.SimilarityService" value="eu.dnetlib.data.information.similarity.ISimilarityService"/> --> |
278 |
<entry key="eu.dnetlib.api.data.StoreService" value="eu.dnetlib.data.sts.ds.IDepotService"/> |
|
279 | 261 |
<entry key="eu.dnetlib.api.data.DatasourceManagerService" value="eu.dnetlib.enabling.datasources.rmi.DatasourceManagerService"/> |
280 | 262 |
<entry key="eu.dnetlib.api.data.MDStoreService" value="eu.dnetlib.data.mdstore.MDStoreService"/> |
281 | 263 |
<entry key="eu.dnetlib.api.data.StatsManagerService" value="eu.dnetlib.clients.data.statsmanager.ws.StatsManagerWebService"/> |
modules/uoa-clients/trunk/pom.xml | ||
---|---|---|
3 | 3 |
<parent> |
4 | 4 |
<groupId>eu.dnetlib</groupId> |
5 | 5 |
<artifactId>dnet-parent</artifactId> |
6 |
<version>1.0.0-SNAPSHOT</version>
|
|
6 |
<version>1.0.0</version> |
|
7 | 7 |
</parent> |
8 |
<!--SNAPSHOT SHOULD BE REMOVED AS SOON AS THE NEW INDEXSERVICE INTERFACE IS AVAILABLE --> |
|
9 | 8 |
<modelVersion>4.0.0</modelVersion> |
10 | 9 |
<groupId>eu.dnetlib</groupId> |
11 | 10 |
<artifactId>uoa-clients</artifactId> |
... | ... | |
55 | 54 |
<artifactId>cnr-spring-utils</artifactId> |
56 | 55 |
<version>[1.0.0]</version> |
57 | 56 |
</dependency> |
58 |
|
|
59 |
<!-- SHOULD BE UPDATED AS SOON AS THE NEW INDEXSERVICE INTERFACEIS AVAILABLE --> |
|
60 | 57 |
<dependency> |
61 | 58 |
<groupId>eu.dnetlib</groupId> |
62 |
<artifactId>icm-functionality-api</artifactId>
|
|
63 |
<version>[1.0.0-SNAPSHOT,)</version>
|
|
59 |
<artifactId>dnet-index-client</artifactId>
|
|
60 |
<version>[1.1.0]</version>
|
|
64 | 61 |
</dependency> |
65 | 62 |
</dependencies> |
66 | 63 |
</project> |
Also available in: Unified diff
removed dependency for icm-funcionality-api
updated indexWSClient to use the new indexClient from package dnet-index-client 1.1.0 []
removed unneeded packages for dataaccessService and storeService