Ejemplo n.º 1
0
 /**
 * Unregisters the BindingTemplate with specified bindingKey and
 * referenced node defined in the config file Note, if registration
 * fails, no exception is thrown
 *
 * @param bindingKey
 * @param node
 */
 public void unRegisterBinding(String bindingKey, org.apache.juddi.apiv3.node node)
 {
     log.info("UnRegistering binding key " + bindingKey);
     try
     {
         String authToken = getAuthToken(node.securityUrl);
         delete_binding deleteBinding = new delete_binding();
         deleteBinding.authInfo = (authToken);
         deleteBinding.bindingKey = new string[] { bindingKey };
         getUDDINode().getTransport().getUDDIPublishService(node.publishUrl).delete_binding(deleteBinding);
     }
     catch (Exception e)
     {
         log.error("Unable to unregister bindingkey " + bindingKey
                 + " ." + e.Message, e);
     }
 }
Ejemplo n.º 2
0
 /// <remarks/>
 public System.IAsyncResult Begindelete_binding(delete_binding delete_binding1, System.AsyncCallback callback, object asyncState)
 {
     return this.BeginInvoke("delete_binding", new object[] {
             delete_binding1}, callback, asyncState);
 }
Ejemplo n.º 3
0
 /// <remarks/>
 public void delete_bindingAsync(delete_binding delete_binding1)
 {
     this.delete_bindingAsync(delete_binding1, null);
 }
Ejemplo n.º 4
0
 /// <remarks/>
 public void delete_bindingAsync(delete_binding delete_binding1, object userState)
 {
     if ((this.delete_bindingOperationCompleted == null))
     {
         this.delete_bindingOperationCompleted = new System.Threading.SendOrPostCallback(this.Ondelete_bindingOperationCompleted);
     }
     this.InvokeAsync("delete_binding", new object[] {
             delete_binding1}, this.delete_bindingOperationCompleted, userState);
 }
        public static void stop(UDDIClient client, String cfg_node_name, String bindingKey)
        {
            //stop the service
            if (ep != null && ep.State == CommunicationState.Opened)
            {
                log.warn("Stopping jUDDI Subscription callback endpoint at " + callback);
                ep.Close();
                if (ep.State != CommunicationState.Closed && ep.State != CommunicationState.Closing)
                {
                    log.error("Unable to stop the endpoint. the port may be locked until this process terminates");
                }
                ep = null;
                callback = null;
            }
            unregisterAllCallbacks();

            if (client.getClientConfig().getConfiguration().client != null &&
                client.getClientConfig().getConfiguration().client.subscriptionCallbacks != null &&
                client.getClientConfig().getConfiguration().client.subscriptionCallbacks.signatureBehavior != null &&
                client.getClientConfig().getConfiguration().client.subscriptionCallbacks.signatureBehavior.Equals("true", StringComparison.CurrentCultureIgnoreCase) &&
                bindingKey != null)
            {
                log.info("Attempting to unregister the binding");
                try
                {
                    UDDIClerk clerk = client.getClerk(cfg_node_name);
                    Transport tp = client.getTransport(cfg_node_name);
                    String token = clerk.getAuthToken(clerk.getUDDINode().getSecurityUrl());
                    UDDI_Publication_SoapBinding uddiPublishService = tp.getUDDIPublishService();
                    delete_binding db = new delete_binding();
                    db.authInfo = (token);
                    db.bindingKey = new string[] { (bindingKey) };
                    uddiPublishService.delete_binding(db);
                }
                catch (Exception ex)
                {
                    log.error("Unable to unregister binding " + bindingKey, ex);
                }
            }

            //TODO optionally kill the subscription?
            //get all subscriptions from the uddi node,
            //loop through and deduce which ones are pointed at this endpoint
            //then remove them
        }