Package org.infoset.xml

Examples of org.infoset.xml.ItemDestination.send()


                  RemoteApp app = apps.next();
                  app.marshall();;
                  DocumentSource.generate(app.getElement(),false,dest);
               }
               dest.send(constructor.createElementEnd(AdminXML.NM_APPS));
               dest.send(constructor.createDocumentEnd());
               out.flush();
               out.close();
            } catch (XMLException ex) {
               getContext().getLogger().log(Level.SEVERE,"Cannot get list of remotes from DB: "+ex.getMessage(),ex);
               getResponse().setStatus(Status.SERVER_ERROR_INTERNAL,"Cannot get list of remotes due to XML DB error.");
View Full Code Here


            try {
               Iterator<SyncTarget> targets = db.getSyncTargets();
               Writer out = new OutputStreamWriter(os,"UTF-8");
               ItemDestination dest = new WriterItemDestination(out,"UTF-8");
               ItemConstructor constructor = InfosetFactory.getDefaultInfoset().createItemConstructor();
               dest.send(constructor.createDocument());
               dest.send(constructor.createElement(AdminXML.NM_TARGETS));
               while (targets.hasNext()) {
                  SyncTarget target = targets.next();
                  target.marshall();
                  DocumentSource.generate(target.getElement(),false,dest);
View Full Code Here

               Iterator<SyncTarget> targets = db.getSyncTargets();
               Writer out = new OutputStreamWriter(os,"UTF-8");
               ItemDestination dest = new WriterItemDestination(out,"UTF-8");
               ItemConstructor constructor = InfosetFactory.getDefaultInfoset().createItemConstructor();
               dest.send(constructor.createDocument());
               dest.send(constructor.createElement(AdminXML.NM_TARGETS));
               while (targets.hasNext()) {
                  SyncTarget target = targets.next();
                  target.marshall();
                  DocumentSource.generate(target.getElement(),false,dest);
               }
View Full Code Here

               while (targets.hasNext()) {
                  SyncTarget target = targets.next();
                  target.marshall();
                  DocumentSource.generate(target.getElement(),false,dest);
               }
               dest.send(constructor.createElementEnd(AdminXML.NM_TARGETS));
               dest.send(constructor.createDocumentEnd());
               out.flush();
               out.close();
            } catch (XMLException ex) {
               getContext().getLogger().log(Level.SEVERE,"Cannot get list of targets from DB: "+ex.getMessage(),ex);
View Full Code Here

                  SyncTarget target = targets.next();
                  target.marshall();
                  DocumentSource.generate(target.getElement(),false,dest);
               }
               dest.send(constructor.createElementEnd(AdminXML.NM_TARGETS));
               dest.send(constructor.createDocumentEnd());
               out.flush();
               out.close();
            } catch (XMLException ex) {
               getContext().getLogger().log(Level.SEVERE,"Cannot get list of targets from DB: "+ex.getMessage(),ex);
               getResponse().setStatus(Status.SERVER_ERROR_INTERNAL,"Cannot get list of targets due to XML DB error.");
View Full Code Here

         }
         getContext().getLogger().info("Backing up to file "+outFile.getAbsolutePath());
         OutputStreamWriter w = new OutputStreamWriter(new FileOutputStream(outFile),"UTF-8");
         ItemDestination dest = new WriterItemDestination(w,"UTF-8");
         ItemConstructor constructor = InfosetFactory.getDefaultInfoset().createItemConstructor(outFile.toURI());
         dest.send(constructor.createDocument(outFile.toURI()));
         dest.send(constructor.createElement(XML.DATABASE_NAME));
         dest.send(constructor.createCharacters("\n"));
         dest.send(constructor.createElement(XML.PERMISSIONS_NAME));
         dest.send(constructor.createCharacters("\n"));
         Iterator<Permission> permissions = db.getPermissions();
View Full Code Here

         getContext().getLogger().info("Backing up to file "+outFile.getAbsolutePath());
         OutputStreamWriter w = new OutputStreamWriter(new FileOutputStream(outFile),"UTF-8");
         ItemDestination dest = new WriterItemDestination(w,"UTF-8");
         ItemConstructor constructor = InfosetFactory.getDefaultInfoset().createItemConstructor(outFile.toURI());
         dest.send(constructor.createDocument(outFile.toURI()));
         dest.send(constructor.createElement(XML.DATABASE_NAME));
         dest.send(constructor.createCharacters("\n"));
         dest.send(constructor.createElement(XML.PERMISSIONS_NAME));
         dest.send(constructor.createCharacters("\n"));
         Iterator<Permission> permissions = db.getPermissions();
         while (permissions.hasNext()) {
View Full Code Here

         OutputStreamWriter w = new OutputStreamWriter(new FileOutputStream(outFile),"UTF-8");
         ItemDestination dest = new WriterItemDestination(w,"UTF-8");
         ItemConstructor constructor = InfosetFactory.getDefaultInfoset().createItemConstructor(outFile.toURI());
         dest.send(constructor.createDocument(outFile.toURI()));
         dest.send(constructor.createElement(XML.DATABASE_NAME));
         dest.send(constructor.createCharacters("\n"));
         dest.send(constructor.createElement(XML.PERMISSIONS_NAME));
         dest.send(constructor.createCharacters("\n"));
         Iterator<Permission> permissions = db.getPermissions();
         while (permissions.hasNext()) {
            permissions.next().generate(constructor,dest);
View Full Code Here

         ItemDestination dest = new WriterItemDestination(w,"UTF-8");
         ItemConstructor constructor = InfosetFactory.getDefaultInfoset().createItemConstructor(outFile.toURI());
         dest.send(constructor.createDocument(outFile.toURI()));
         dest.send(constructor.createElement(XML.DATABASE_NAME));
         dest.send(constructor.createCharacters("\n"));
         dest.send(constructor.createElement(XML.PERMISSIONS_NAME));
         dest.send(constructor.createCharacters("\n"));
         Iterator<Permission> permissions = db.getPermissions();
         while (permissions.hasNext()) {
            permissions.next().generate(constructor,dest);
            dest.send(constructor.createCharacters("\n"));
View Full Code Here

         ItemConstructor constructor = InfosetFactory.getDefaultInfoset().createItemConstructor(outFile.toURI());
         dest.send(constructor.createDocument(outFile.toURI()));
         dest.send(constructor.createElement(XML.DATABASE_NAME));
         dest.send(constructor.createCharacters("\n"));
         dest.send(constructor.createElement(XML.PERMISSIONS_NAME));
         dest.send(constructor.createCharacters("\n"));
         Iterator<Permission> permissions = db.getPermissions();
         while (permissions.hasNext()) {
            permissions.next().generate(constructor,dest);
            dest.send(constructor.createCharacters("\n"));
         }
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.