public class SubscriptionCallbackListener extends Object implements UDDISubscriptionListenerPortType, Runnable
UDDIClient c = new UDDIClient("META-INF/uddiclient.xml"); UDDIClerk clerk = c.getClerk("default"); TModel createKeyGenator = UDDIClerk.createKeyGenator("uddi:org.apache.juddi:test:keygenerator", "Test domain", "en"); clerk.register(createKeyGenator); BindingTemplate start = SubscriptionCallbackListener.start(c, "default"); //keep alive while(running) Thread.sleep(1000); SubscriptionCallbackListener.stop(c, "default", start.getBindingKey());
Modifier and Type | Class and Description |
---|---|
static class |
SubscriptionCallbackListener.SignatureBehavior
This defines how the automatic subscription binding template is
suppose to behave
|
Modifier and Type | Field and Description |
---|---|
static String |
PROPERTY_AUTOREG_BT
config parameter true/false
|
static String |
PROPERTY_AUTOREG_SERVICE_KEY
config parameter business key
|
static String |
PROPERTY_KEYDOMAIN
config parameter
|
static String |
PROPERTY_LISTENURL
config parameter
|
static String |
PROPERTY_NODE
config parameter, if not defined, default will be used
|
static String |
PROPERTY_SIGNATURE_BEHAVIOR
config parameter
|
Constructor and Description |
---|
SubscriptionCallbackListener()
adds a shutdown hook to trap and warn about leaving the server
running on exit
|
Modifier and Type | Method and Description |
---|---|
static String |
getCallbackURL()
gets the current callback url, may be null if the endpoint isn't
started yet
|
protected static SubscriptionCallbackListener |
getInstance()
used for unit tests, may return null if the endpoint isn't started
yet
|
DispositionReport |
notifySubscriptionListener(NotifySubscriptionListener body)
This API, when implemented by a subscriber and specified in a
subscription, enables the node to deliver notifications to subscription
listeners by invoking a Web service.
|
static BindingTemplate |
registerBinding(UDDIClient client,
String cfg_node_name,
BindingTemplate bt,
SubscriptionCallbackListener.SignatureBehavior behavior)
Registers a UDDI binding template that represents the subscription
callback endpoint
|
static void |
registerCallback(ISubscriptionCallback callback)
Registers an implementation of ISubscriptionCallback for subscription
callbacks from a UDDI server.
|
void |
run()
shutdown hook
|
static BindingTemplate |
start(UDDIClient client)
Starts a subscription callback service using the juddi client config
file's settings.
|
static BindingTemplate |
start(UDDIClient client,
String cfg_node_name)
Starts a subscription callback service using the juddi client config
file's settings.
|
static BindingTemplate |
start(UDDIClient client,
String cfg_node_name,
String endpoint,
String keydomain,
boolean autoregister,
String serviceKey,
SubscriptionCallbackListener.SignatureBehavior behavior)
Starts a embedded Jetty web server (comes with the JDK) using the
Endpoint API.
|
static void |
stop(UDDIClient client,
String cfg_node_name,
String bindingKey)
This effectively stops the endpoint address and notifies all
ISubscriptionCallback clients that the endpoint as been stopped.
|
protected static void |
unregisterAllCallbacks() |
static void |
unRegisterCallback(ISubscriptionCallback callback)
unregisters a ISubscriptionCallback for callbacks
|
public static final String PROPERTY_LISTENURL
public static final String PROPERTY_NODE
public static final String PROPERTY_KEYDOMAIN
public static final String PROPERTY_AUTOREG_BT
public static final String PROPERTY_AUTOREG_SERVICE_KEY
public static final String PROPERTY_SIGNATURE_BEHAVIOR
public SubscriptionCallbackListener()
protected static SubscriptionCallbackListener getInstance()
public static BindingTemplate start(UDDIClient client, String cfg_node_name, String endpoint, String keydomain, boolean autoregister, String serviceKey, SubscriptionCallbackListener.SignatureBehavior behavior) throws ServiceAlreadyStartedException, SecurityException, org.apache.commons.configuration.ConfigurationException, TransportException, DispositionReportFaultMessage, RemoteException, UnexpectedException, RegistrationAbortedException, UnableToSignException, MalformedURLException
client
- cfg_node_name
- endpoint
- this is the url that a UDDI server would use to
connect to the client's subscription listener service Recommend
specifying a port that is firewall friendlykeydomain
- autoregister
- behavior
- serviceKey
- ServiceAlreadyStartedException
SecurityException
org.apache.commons.configuration.ConfigurationException
TransportException
DispositionReportFaultMessage
UnexpectedException
RegistrationAbortedException
MalformedURLException
UnableToSignException
RemoteException
Endpoint
public static BindingTemplate start(UDDIClient client) throws ServiceAlreadyStartedException, SecurityException, org.apache.commons.configuration.ConfigurationException, TransportException, DispositionReportFaultMessage, UnexpectedException, RemoteException, RegistrationAbortedException, UnableToSignException, MalformedURLException
client
- ServiceAlreadyStartedException
SecurityException
org.apache.commons.configuration.ConfigurationException
TransportException
DispositionReportFaultMessage
UnexpectedException
RemoteException
RegistrationAbortedException
UnableToSignException
MalformedURLException
public static BindingTemplate start(UDDIClient client, String cfg_node_name) throws ServiceAlreadyStartedException, SecurityException, org.apache.commons.configuration.ConfigurationException, TransportException, DispositionReportFaultMessage, UnexpectedException, RemoteException, RegistrationAbortedException, UnableToSignException, MalformedURLException
client
- cfg_node_name
- the node to connect to and perform all
operations onServiceAlreadyStartedException
SecurityException
org.apache.commons.configuration.ConfigurationException
TransportException
DispositionReportFaultMessage
UnexpectedException
RemoteException
RegistrationAbortedException
UnableToSignException
MalformedURLException
public static String getCallbackURL()
public static void registerCallback(ISubscriptionCallback callback)
callback
- if null, no action is takenpublic static void unRegisterCallback(ISubscriptionCallback callback)
callback
- if null, no action is takenpublic static BindingTemplate registerBinding(UDDIClient client, String cfg_node_name, BindingTemplate bt, SubscriptionCallbackListener.SignatureBehavior behavior) throws ServiceAlreadyStartedException, SecurityException, org.apache.commons.configuration.ConfigurationException, TransportException, DispositionReportFaultMessage, RemoteException, UnexpectedException, RegistrationAbortedException, UnableToSignException
client
- cfg_node_name
- bt
- - Binding Templatebehavior
- ServiceAlreadyStartedException
SecurityException
org.apache.commons.configuration.ConfigurationException
TransportException
DispositionReportFaultMessage
RemoteException
UnexpectedException
RegistrationAbortedException
UnableToSignException
protected static void unregisterAllCallbacks()
public static void stop(UDDIClient client, String cfg_node_name, String bindingKey) throws org.apache.commons.configuration.ConfigurationException
client
- cfg_node_name
- bindingKey
- org.apache.commons.configuration.ConfigurationException
public DispositionReport notifySubscriptionListener(NotifySubscriptionListener body) throws DispositionReportFaultMessage, RemoteException
UDDISubscriptionListenerPortType
notifySubscriptionListener
in interface UDDISubscriptionListenerPortType
body
- · authInfo: This optional argument is an element that contains an authentication token. Subscription listener services that wish to restrict who can transmit subscription data MAY require authInfo for this call, though this is a matter of client policy.
· subscriptionResultsList: This list contains the results for this notification, which consist of the result structures which are normally returned for standard find_xx or get_xx APIs, based upon the criteria saved in the subscriptionFilter for the subscription which is generating this notification. Note that the chunkToken is not returned with this structure for this API. The subscriptionResultsList also contains a coveragePeriod structure which defines the time period over which the node data is compared with the subscription criterion in order to produce the result set. It provides the start and end date/time information according to the format described in Section 5.5.4 Subscription Coverage Period. The "current" state of registry entries pertaining to the subscription referenced by the subscriptionKey provided are returned if they were last changed during the specified time period. See Section 5.5.11.3 Returns for more information on the subscriptionResultsList’s content.
DispositionReportFaultMessage
- If an error occurs in processing this API call, a dispositionReport structure is returned to the caller in a SOAP Fault. In addition to the errors common to all APIs, the following error information is relevant here:
· E_fatalError: signifies the client’s failure to receive notification data. The node is not obligated to retry.
RemoteException
Copyright © 2004–2021 The Apache Software Foundation. All rights reserved.