1
|
package eu.dnetlib.msro.workflows.nodes.blackboard;
|
2
|
|
3
|
import javax.annotation.Resource;
|
4
|
import javax.xml.ws.Endpoint;
|
5
|
import javax.xml.ws.wsaddressing.W3CEndpointReference;
|
6
|
|
7
|
import org.apache.commons.logging.Log;
|
8
|
import org.apache.commons.logging.LogFactory;
|
9
|
import org.springframework.beans.factory.annotation.Required;
|
10
|
|
11
|
import eu.dnetlib.enabling.is.sn.rmi.ISSNException;
|
12
|
import eu.dnetlib.enabling.is.sn.rmi.ISSNService;
|
13
|
import eu.dnetlib.enabling.locators.UniqueServiceLocator;
|
14
|
import eu.dnetlib.soap.EndpointReferenceBuilder;
|
15
|
|
16
|
public class BlackboardSubscriber {
|
17
|
|
18
|
/**
|
19
|
* Logger.
|
20
|
*/
|
21
|
private static final Log log = LogFactory.getLog(BlackboardSubscriber.class); // NOPMD by marko on 11/24/08 5:02 PM
|
22
|
|
23
|
/**
|
24
|
* service locator.
|
25
|
*/
|
26
|
@Resource
|
27
|
private UniqueServiceLocator serviceLocator;
|
28
|
|
29
|
/**
|
30
|
* injected EPR builder.
|
31
|
*/
|
32
|
@Resource(name = "jaxwsEndpointReferenceBuilder")
|
33
|
private EndpointReferenceBuilder<Endpoint> eprBuilder;
|
34
|
|
35
|
/**
|
36
|
* notification endpoint (normally the msro service).
|
37
|
*/
|
38
|
private Endpoint endpoint;
|
39
|
|
40
|
/**
|
41
|
* performs the subscription.
|
42
|
*
|
43
|
* @throws ISSNException
|
44
|
* could happen
|
45
|
*/
|
46
|
public void subscribeAll() throws ISSNException {
|
47
|
log.info("Subscribing msro service");
|
48
|
|
49
|
final W3CEndpointReference endpointReference = eprBuilder.getEndpointReference(getEndpoint());
|
50
|
serviceLocator.getService(ISSNService.class).subscribe(endpointReference, "UPDATE/*/*/RESOURCE_PROFILE/BODY/BLACKBOARD/LAST_RESPONSE", 0);
|
51
|
}
|
52
|
|
53
|
public Endpoint getEndpoint() {
|
54
|
return endpoint;
|
55
|
}
|
56
|
|
57
|
@Required
|
58
|
public void setEndpoint(final Endpoint endpoint) {
|
59
|
this.endpoint = endpoint;
|
60
|
}
|
61
|
}
|