public class SubscriptionCallbackListener extends Object implements org.uddi.v3_service.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
|
org.uddi.api_v3.DispositionReport |
notifySubscriptionListener(org.uddi.subr_v3.NotifySubscriptionListener body) |
static org.uddi.api_v3.BindingTemplate |
registerBinding(UDDIClient client,
String cfg_node_name,
org.uddi.api_v3.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 org.uddi.api_v3.BindingTemplate |
start(UDDIClient client)
Starts a subscription callback service using the juddi client config
file's settings.
|
static org.uddi.api_v3.BindingTemplate |
start(UDDIClient client,
String cfg_node_name)
Starts a subscription callback service using the juddi client config
file's settings.
|
static org.uddi.api_v3.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 org.uddi.api_v3.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, org.uddi.v3_service.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
org.uddi.v3_service.DispositionReportFaultMessage
UnexpectedException
RegistrationAbortedException
MalformedURLException
UnableToSignException
RemoteException
Endpoint
public static org.uddi.api_v3.BindingTemplate start(UDDIClient client) throws ServiceAlreadyStartedException, SecurityException, org.apache.commons.configuration.ConfigurationException, TransportException, org.uddi.v3_service.DispositionReportFaultMessage, UnexpectedException, RemoteException, RegistrationAbortedException, UnableToSignException, MalformedURLException
client
- ServiceAlreadyStartedException
SecurityException
org.apache.commons.configuration.ConfigurationException
TransportException
org.uddi.v3_service.DispositionReportFaultMessage
UnexpectedException
RemoteException
RegistrationAbortedException
UnableToSignException
MalformedURLException
public static org.uddi.api_v3.BindingTemplate start(UDDIClient client, String cfg_node_name) throws ServiceAlreadyStartedException, SecurityException, org.apache.commons.configuration.ConfigurationException, TransportException, org.uddi.v3_service.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
org.uddi.v3_service.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 org.uddi.api_v3.BindingTemplate registerBinding(UDDIClient client, String cfg_node_name, org.uddi.api_v3.BindingTemplate bt, SubscriptionCallbackListener.SignatureBehavior behavior) throws ServiceAlreadyStartedException, SecurityException, org.apache.commons.configuration.ConfigurationException, TransportException, org.uddi.v3_service.DispositionReportFaultMessage, RemoteException, UnexpectedException, RegistrationAbortedException, UnableToSignException
client
- cfg_node_name
- bt
- - Binding Templatebehavior
- ServiceAlreadyStartedException
SecurityException
org.apache.commons.configuration.ConfigurationException
TransportException
org.uddi.v3_service.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 org.uddi.api_v3.DispositionReport notifySubscriptionListener(org.uddi.subr_v3.NotifySubscriptionListener body) throws org.uddi.v3_service.DispositionReportFaultMessage, RemoteException
notifySubscriptionListener
in interface org.uddi.v3_service.UDDISubscriptionListenerPortType
org.uddi.v3_service.DispositionReportFaultMessage
RemoteException
Copyright © 2004–2021 The Apache Software Foundation. All rights reserved.