Package org.apache.juddi.v3.client.config

Examples of org.apache.juddi.v3.client.config.UDDIClerk$WSDL


        public void TmodelsTheEasyWay(String[] args) {
                try {
                       
                        //This reads from the config file
                        UDDIClerk clerk = uddiClient.getClerk("defaultClerk");
                        //Since the password isn't set in the above config file, we have to provide it manually
                        //or thrown some fancy dialog box
                        clerk.setPublisher("uddi");     //username
                        clerk.setPassword("uddi");     //pass
                       

                        TModel keygen = UDDIClerk.createKeyGenator("www.mycoolcompany.com", "My Company's Keymodel generator", "en");
                        clerk.register(keygen);
                        System.out.println("Creation of Partition Success!");


                        //Now lets make a few tModels using the new domain
                        TModel tm = new TModel();
                        tm.setName(new Name());
                        tm.getName().setValue("My Company's Department");
                        tm.getName().setLang("en");
                        tm.setTModelKey("uddi:www.mycoolcompany.com:department");
                        clerk.register(tm);
                        System.out.println("Creation of tModel Department Success!");

                        tm = new TModel();
                        tm.setName(new Name());
                        tm.getName().setValue("My Company's Authentication Method");
                        tm.getName().setLang("en");
                        tm.setTModelKey("uddi:www.mycoolcompany.com:authmode");
                        clerk.register(tm);
                        System.out.println("Creation of tModel Auth Mode Success!");

                        clerk.discardAuthToken();
                } catch (Exception e) {
                        e.printStackTrace();
                }
        }
View Full Code Here


public class Find {
 
  public void find() {
    try {
      UDDIClient uddiClient = new UDDIClient("META-INF/wsdl2uddi-uddi.xml");
      UDDIClerk clerk = uddiClient.getClerk("joe");
         
          BusinessEntity businessEntity = clerk.findBusiness("uddi:uddi.joepublisher.com:business-for-wsdl");
          //
          if (businessEntity!=null) {
            System.out.println("Found business with name " + businessEntity.getName().get(0).getValue());
            if (businessEntity.getBusinessServices() !=null) {
              System.out.println("Number of services: " + businessEntity.getBusinessServices().getBusinessService().size());
View Full Code Here

        public static final String TMODEL_DESTINATION_NAME = TMODEL_KEY_BASE + "amqp.destination";

        private void Fire() throws Exception {
                String amqpURL = "amqp://guest:guest@clientid/?brokerlist='tcp://localhost:5672'";
                UDDIClient client = new UDDIClient("META-INF/subscription-notification-client-uddi.xml");
                UDDIClerk clerk = client.getClerk("default");
                String base = "uddi:amqptestdomain:";
                String lang = "en";

                TModel destinationType = new TModel();
                destinationType.setName(new Name("AMQP Destination Type", lang));
                destinationType.getDescription().add(new Description("topicExchange, queue, etc", lang));
                destinationType.setTModelKey(TMODEL_DESTINATION_TYPE);

                TModel destinationName = new TModel();
                destinationName.setName(new Name("AMQP Destination Name", lang));
                destinationName.getDescription().add(new Description("The name of the topic or queue", lang));
                destinationName.setTModelKey(TMODEL_DESTINATION_NAME);

                TModel createKeyGenator = UDDIClerk.createKeyGenator(base + "keygenerator", "AMQP Test Key domain", lang);
                BusinessEntity be = new BusinessEntity();
                be.setBusinessKey(base + "business");
                be.getName().add(new Name("AMQP Test callbacks", lang));
                be.setBusinessServices(new BusinessServices());
                BusinessService bs = new BusinessService();
                bs.getName().add(new Name("AMQP Test service", lang));
                bs.setBindingTemplates(new BindingTemplates());
                bs.setBusinessKey(base + "business");
                bs.setServiceKey(base + "service");

                BindingTemplate bt = new BindingTemplate();
                bt.setBindingKey(base + "binding");
                bt.setServiceKey(base + "service");
                bt.setAccessPoint(new AccessPoint(amqpURL, AccessPointType.END_POINT.toString()));
                bt.setTModelInstanceDetails(new TModelInstanceDetails());

                TModelInstanceInfo version = UDDIClerk.createServiceInterfaceVersion("1.0", lang);
                bt.getTModelInstanceDetails().getTModelInstanceInfo().add(version);

                TModelInstanceInfo transport = new TModelInstanceInfo();
                transport.setTModelKey(UDDIConstants.TRANSPORT_AMQP);
                bt.getTModelInstanceDetails().getTModelInstanceInfo().add(transport);

                TModelInstanceInfo topic = new TModelInstanceInfo();
                topic.setTModelKey(TMODEL_DESTINATION_TYPE);
                topic.setInstanceDetails(new InstanceDetails());
                topic.getInstanceDetails().setInstanceParms("amq.topic");
                bt.getTModelInstanceDetails().getTModelInstanceInfo().add(topic);

                TModelInstanceInfo name = new TModelInstanceInfo();
                name.setTModelKey(TMODEL_DESTINATION_NAME);
                name.setInstanceDetails(new InstanceDetails());
                name.getInstanceDetails().setInstanceParms(TOPIC);
                bt.getTModelInstanceDetails().getTModelInstanceInfo().add(name);

                bs.getBindingTemplates().getBindingTemplate().add(bt);

                be.getBusinessServices().getBusinessService().add(bs);
                try {
                        System.out.println("Registering tModel");
                        clerk.register(createKeyGenator);
                        System.out.println("Registering destination type tmodel");
                        clerk.register(destinationType);
                        System.out.println("Registering destination name tmodel");
                        clerk.register(destinationName);

                        System.out.println("Registering business with callback definition");
                        clerk.register(be);

                        Properties p = new Properties();
                        p.setProperty("java.naming.factory.initial", "org.apache.qpid.jndi.PropertiesFileInitialContextFactory");
                        p.setProperty("connectionfactory.qpidConnectionfactory", amqpURL);
                        p.setProperty("destination." + TOPIC, "amq.topic");

                        System.out.println("Connecting to AMQP at " + amqpURL);

                        Context context = new InitialContext(p);

                        ConnectionFactory connectionFactory = (ConnectionFactory) context.lookup("qpidConnectionfactory");
                        Connection connection = connectionFactory.createConnection();
                        connection.start();

                        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
                        Destination destination = (Destination) context.lookup(TOPIC);

                        MessageConsumer consumer = session.createConsumer(destination);

                        consumer.setMessageListener(this);
                        System.out.println("Connected and listening...");

                        Subscription sub = new Subscription();
                        sub.setNotificationInterval(DatatypeFactory.newInstance().newDuration(1000));
                        sub.setBindingKey(base + "binding");
                        sub.setSubscriptionKey(base + "sub-fb");
                        sub.setSubscriptionFilter(new SubscriptionFilter());
                        sub.getSubscriptionFilter().setFindBusiness(new FindBusiness());
                        sub.getSubscriptionFilter().getFindBusiness().setFindQualifiers(new FindQualifiers());
                        sub.getSubscriptionFilter().getFindBusiness().getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
                        sub.getSubscriptionFilter().getFindBusiness().getName().add(new Name(UDDIConstants.WILDCARD, null));

                        Subscription subscriptionBiz = clerk.register(sub, clerk.getUDDINode().getApiNode());

                        System.out.println("Registered FindBusiness subscription key: " + (subscriptionBiz.getSubscriptionKey()) + " bindingkey: " + subscriptionBiz.getBindingKey());

                        sub = new Subscription();
                        sub.setSubscriptionKey(base + "sub-fs");
                        sub.setNotificationInterval(DatatypeFactory.newInstance().newDuration(1000));
                        sub.setBindingKey(base + "binding");
                        sub.setSubscriptionFilter(new SubscriptionFilter());
                        sub.getSubscriptionFilter().setFindService(new FindService());
                        sub.getSubscriptionFilter().getFindService().setFindQualifiers(new FindQualifiers());
                        sub.getSubscriptionFilter().getFindService().getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
                        sub.getSubscriptionFilter().getFindService().getName().add(new Name(UDDIConstants.WILDCARD, null));

                        Subscription subscriptionSvc = clerk.register(sub, clerk.getUDDINode().getApiNode());

                        System.out.println("Registered FindService subscription key: " + (subscriptionSvc.getSubscriptionKey()) + " bindingkey: " + subscriptionSvc.getBindingKey());

                        sub = new Subscription();
                        sub.setNotificationInterval(DatatypeFactory.newInstance().newDuration(1000));
                        sub.setBindingKey(base + "binding");
                        sub.setSubscriptionKey(base + "sub-ft");
                        sub.setSubscriptionFilter(new SubscriptionFilter());
                        sub.getSubscriptionFilter().setFindTModel(new FindTModel());
                        sub.getSubscriptionFilter().getFindTModel().setFindQualifiers(new FindQualifiers());
                        sub.getSubscriptionFilter().getFindTModel().getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
                        sub.getSubscriptionFilter().getFindTModel().setName(new Name(UDDIConstants.WILDCARD, null));

                        Subscription subscriptionTM = clerk.register(sub, clerk.getUDDINode().getApiNode());

                        System.out.println("Registered FindTModel subscription key: " + (subscriptionTM.getSubscriptionKey()) + " bindingkey: " + subscriptionTM.getBindingKey());

                        System.out.println("Waiting for callbacks. Now would be a good time to launch either another program or juddi-gui to make some changes. Press any key to stop!");
View Full Code Here

  public static void handle(Clerk fromClerk, Clerk toClerk, SubscriptionResultsList list) {

    if (list.getServiceList()!=null) {

      for (ServiceInfo serviceInfo : list.getServiceList().getServiceInfos().getServiceInfo() ) {
        UDDIClerk uddiToClerk = new UDDIClerk(toClerk);
        try {
          BusinessEntity existingEntity = uddiToClerk.findBusiness(serviceInfo.getBusinessKey(), toClerk.getNode());
          if (existingEntity!=null) {
            log.info("Found business with key " +  existingEntity.getBusinessKey() + ". No need to add it again");
          } else {
            log.info("Business was not found in the destination UDDI " + toClerk.getNode().getName()
                + ", going to add it in.");
            new XRegistration(serviceInfo.getBusinessKey(), new UDDIClerk(fromClerk), new UDDIClerk(toClerk)).xRegisterBusiness();
          }
          new XRegistration(serviceInfo.getServiceKey(), new UDDIClerk(fromClerk), new UDDIClerk(toClerk)).xRegisterService();
        } catch (Exception e) {
          log.error(e.getMessage(),e)
        }
      }
    }
View Full Code Here

  public static void main (String args[]) {
   
    Setup sp = new Setup();
    try {
      uddiClient = new UDDIClient("META-INF/wsdl2uddi-uddi.xml");
      UDDIClerk clerk = uddiClient.getClerk("joe");
     
      //setting up the publisher
      sp.setupJoePublisher(clerk);
      //publish the business
      sp.publishBusiness(clerk);
View Full Code Here

   
    properties.put("nodeName", JBossDSPFactory.getServerConfig().getUddiNodeName());
    String bpelUDDIConfig = properties.getProperty(BPEL_UDDI_CONFIG);
    if (bpelUDDIConfig!=null) {
      try {
        UDDIClerkManager clerkManager = new UDDIClerkManager(bpelUDDIConfig, properties);
            clerkManager.start();
            selfRegister = clerkManager.getClientConfig().isRegisterOnStartup();
            Map<String,UDDIClerk> clerks = clerkManager.getClientConfig().getUDDIClerks();
            String clerkName = properties.getProperty(BPEL_UDDI_CLERK, DEFAULT_BPEL_UDDI_CLERK);
        bpelClerk = clerks.get(clerkName);
        //Add the properties from the uddi.xml
        properties.putAll(bpelClerk.getUDDINode().getProperties());
        if (bpelClerk==null) {
View Full Code Here

    }
    logger.debug("Publisher " + publisher + " sending getSubscription request..");
    try {
      boolean isMatchingClerk=false;
      UDDIClerk toClerk = null;
      UDDIClerkManager manager = WebHelper.getUDDIClerkManager(session.getServletContext());
      UDDINode homeNode = WebHelper.getUDDIHomeNode(session.getServletContext());
      Map<String, UDDIClerk> clerks = manager.getClientConfig().getUDDIClerks();
      for (UDDIClerk clerk : clerks.values()) {
        if (publisher.equals(clerk.getPublisher())
            && homeNode.getName().equals(clerk.getUDDINode().getName())) {
          toClerk = clerk;
        }
View Full Code Here

    UDDINode node = clerk.getUDDINode();
    modelNode.setName(node.getName());
    modelNode.setClerkName(clerk.getName());
    modelNode.setDescription(node.getDescription());
    try {
      UDDIClerkManager manager = UDDIClientContainer.getUDDIClerkManager(clerk.getManagerName());
      String clazz = manager.getClientConfig().getUDDINode(clerk.getUDDINode().getName()).getProxyTransport();
      Class<?> transportClass = ClassUtil.forName(clazz, Transport.class);
      Transport transport = (Transport) transportClass.getConstructor(String.class,String.class).newInstance(clerk.getManagerName(),clerk.getUDDINode().getName())
      String authToken = (String) session.getAttribute("token-" + clerk.getName());

      UDDISubscriptionPortType subscriptionService = transport.getUDDISubscriptionService();
View Full Code Here

    SubscriptionResponse response = new SubscriptionResponse();

    logger.info("Sending saveSubscriptions request..");
    try {
      //before sending this we need to ready the listener node
      UDDIClerkManager manager = WebHelper.getUDDIClerkManager(session.getServletContext());
      UDDINode homeNode = WebHelper.getUDDIHomeNode(session.getServletContext());
      UDDIClerk clerk = manager.getClientConfig().getUDDIClerks().get(modelSubscription.getFromClerkName());
      UDDIClerk toClerk = manager.getClientConfig().getUDDIClerks().get(modelSubscription.getToClerkName());
      if (toClerk==null) {
        String publisher = (String) session.getAttribute("UserName");
        Map<String, UDDIClerk> clerks = manager.getClientConfig().getUDDIClerks();
        for (UDDIClerk uddiClerk : clerks.values()) {
          if (publisher.equals(uddiClerk.getPublisher())
              && homeNode.getName().equals(uddiClerk.getUDDINode().getName())) {
            toClerk = uddiClerk;
          }
View Full Code Here

   
    String error = null;
    try {
   
      try {
        UDDIClerkManager manager = WebHelper.getUDDIClerkManager(session.getServletContext());
        UDDIClerk clerk = manager.getClientConfig().getUDDIClerks().get(modelSubscription.getFromClerkName());
        Transport transport = WebHelper.getTransport(session.getServletContext(), clerk.getUDDINode());
        UDDISubscriptionPortType subscriptionService = transport.getUDDISubscriptionService();
        DeleteSubscription deleteSubscription = new DeleteSubscription();
        String authToken = (String) session.getAttribute("token-" + clerk.getName());
        deleteSubscription.setAuthInfo(authToken);
View Full Code Here

TOP

Related Classes of org.apache.juddi.v3.client.config.UDDIClerk$WSDL

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.