Examples of UDDIClerk


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

  public void testDirectCall() throws ConfigurationException, WSDLException, RemoteException, TransportException, MalformedURLException, Exception {
    try {
      tckTModel.saveJoePublisherTmodel(authInfoJoe);
      tckBusiness.saveJoePublisherBusiness(authInfoJoe);
     
      UDDIClerk clerk = new UDDIClient("META-INF/uddi.xml").getClerk("joe");
      Properties properties = clerk.getUDDINode().getProperties();
      URLLocalizer urlLocalizer = new URLLocalizerDefaultImpl();
     
      //get the wsdl
      Definition wsdlDefinition = new ReadWSDL().readWSDL("wsdl/sample.wsdl");
      //set required properties
View Full Code Here

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

  public void testClerkCall() throws ConfigurationException, WSDLException, RemoteException, TransportException, MalformedURLException {
    try {
      tckTModel.saveJoePublisherTmodel(authInfoJoe);
      tckBusiness.saveJoePublisherBusiness(authInfoJoe);
     
      UDDIClerk clerk = new UDDIClient("META-INF/uddi.xml").getClerk("joe");
      clerk.registerWsdls();
     
     
      String portTypeName = "StockQuotePortType";
      String namespace    = "http://example.com/stockquote/";
      FindTModel findTModelForPortType = WSDL2UDDI.createFindPortTypeTModelForPortType(portTypeName, namespace);
      System.out.println(new PrintUDDI<FindTModel>().print(findTModelForPortType));
     
      clerk.unRegisterWsdls();
    } catch (Exception e) {
      e.printStackTrace();
      Assert.fail();
    } finally {
      tckBusiness.deleteJoePublisherBusiness(authInfoJoe);
View Full Code Here

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

public class Call {
 
  public void call() {
    try {
      UDDIClient uddiClient = new UDDIClient("META-INF/wsdl2uddi-uddi.xml");
      UDDIClerk clerk = uddiClient.getClerk("joe");
         
          //find the service in the UDDI registry
          System.out.println("The clientside of a runtime lookup usually knows the serviceKey.");
          System.out.println("To get updated binding information you should use the ServiceLocator with a live cache.");
          String helloWorldServiceKey = "uddi:uddi.joepublisher.com:service_helloworld";
View Full Code Here

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

   
    System.out.println("2. Programmatically publish the endpoint to UDDI");
    Publish sp = new Publish();
    try {
      uddiClient = new UDDIClient("META-INF/wsdl2uddi-uddi.xml");
      UDDIClerk clerk = uddiClient.getClerk("joe");
     
      System.out.println("setting up the publisher");
      sp.setupJoePublisher(clerk);
      System.out.println("publish the business");
      sp.publishBusiness(clerk);
View Full Code Here

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

  public static void main (String args[]) {
   
    Delete sp = new Delete();
    try {
      uddiClient = new UDDIClient("META-INF/wsdl2uddi-uddi.xml");
      UDDIClerk clerk = uddiClient.getClerk("joe");
     
      sp.deleteWSDL(clerk);
      sp.deleteBusiness(clerk);
     
    } catch (Exception e) {
View Full Code Here

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

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

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

    public static void main(String[] args) throws Exception {

        // create a manager and read the config in the archive;
        // you can use your config file name
        UDDIClient clerkManager = new UDDIClient("META-INF/simple-publish-uddi.xml");
        UDDIClerk clerk = clerkManager.getClerk("default");
        // a ClerkManager can be a client to multiple UDDI nodes, so
        // supply the nodeName (defined in your uddi.xml.
        // The transport can be WS, inVM, RMI etc which is defined in the uddi.xml
        Transport transport = clerkManager.getTransport();
        // Now you create a reference to the UDDI API
        security = transport.getUDDISecurityService();
        publish = transport.getUDDIPublishService();
        inquiry = transport.getUDDIInquiryService();
        //step one, get a token
        GetAuthToken getAuthTokenRoot = new GetAuthToken();
        getAuthTokenRoot.setUserID("uddi");
        getAuthTokenRoot.setCred("uddi");

        // Making API call that retrieves the authentication token for the 'root' user.
        String rootAuthToken = clerk.getAuthToken(clerk.getUDDINode().getSecurityUrl());
        String uddi = security.getAuthToken(getAuthTokenRoot).getAuthInfo();

        System.out.println("killing mary's business if it exists");
        //first check is Mary's business exists and delete
        DeleteIfExists("uddi:uddi.marypublisher.com:marybusinessone", uddi);
View Full Code Here

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

        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

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

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

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

        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
TOP
Copyright © 2018 www.massapi.com. 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.