Package org.atomojo.app.client

Examples of org.atomojo.app.client.FeedClient.create()


     
      Identity admin = new Identity("admin","admin");
      Reference autoRef = new Reference("http://localhost:8080/R/");
      FeedClient client = new FeedClient(autoRef,admin);
     
      Status status = client.create("<feed xmlns='http://www.w3.org/2005/Atom'><title>autoconf</title></feed>");
      assertTrue(status.isSuccess());
     
      client.createEntry(
         "<entry xmlns='http://www.w3.org/2005/Atom'>" +
         "<title>test1 db</title>" +
View Full Code Here


            feedClient.setIdentity("admin","admin");

            Entry entry = null;
            if (!feedClient.exists()) {
               log.info("Creating feed "+i);
               Status status = feedClient.create("<feed xmlns='http://www.w3.org/2005/Atom'><title>Feed "+i+"</title></feed>");
               if (!status.isSuccess()) {
                  log.info("Failure, status="+status.getCode());
               }
               assertTrue(status.isSuccess());
            } else {
View Full Code Here

                  theEntry.set(entry);
               }
            }).getStatus();
            if (status.getCode()==404) {
               log.info("Creating feed "+j+","+i);
               status = feedClient.create("<feed xmlns='http://www.w3.org/2005/Atom'><title>Feed "+j+","+i+"</title></feed>");
               if (!status.isSuccess()) {
                  log.info("Failure, status="+status.getCode());
               }
               assertTrue(status.isSuccess());
            } else if (status.isSuccess()) {
View Full Code Here

            try {
               Document doc = InfosetFactory.getDefaultInfoset().createItemConstructor().createDocument();
               Element feed = doc.createDocumentElement(FeedClient.FEED_NAME);
               Element title = feed.addElement(FeedClient.TITLE_NAME);
               title.addCharacters(target.dir.getName());
               Status status = feedClient.create(doc);
               if (!status.isSuccess()) {
                  log.log(Level.SEVERE,"Cannot create feed "+target.feed+" due to error "+status.getCode());
                  continue;
               }
            } catch (XMLException ex) {
View Full Code Here

               // Make sure to remove the xml:base on the feed element for storage;
               feedDoc.getDocumentElement().getAttributes().remove(Attribute.XML_BASE);

               if (!targetClient.exists()) {
                  log.info("Creating target feed "+targetClient.getLocation());
                  Status status = targetClient.create(feedDoc);
                  if (!status.isSuccess()) {
                     log.severe("Cannot create target feed, status="+status.getCode());
                     errorCount++;
                     ok = false;
                  }
View Full Code Here

                     try {
                        Representation feedRep = storage.getFeed(path,feed.getUUID(),feed.getEntries());
                        // Now, create the feed with the XML
                        try {
                           String xml = feedRep.getText();
                           if (!appClient.create(xml).isSuccess()) {
                              errorCount++;
                              log.severe("Cannot create feed on target for path "+path);
                              throw new SyncException("Synchronization was incomplete.  Stopped due to failure to create feed: "+path);
                           }
                        } catch (IOException ex) {
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.