throws IOException
{
try {
Iterator<SyncProcess> procs = db.getSyncProcesses();
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_SYNC_PROCESSES));
while (procs.hasNext()) {
SyncProcess proc = procs.next();
proc.marshall();
DocumentSource.generate(proc.getElement(),false,dest);
}
dest.send(constructor.createElementEnd(AdminXML.NM_SYNC_PROCESSES));
dest.send(constructor.createDocumentEnd());
out.flush();
out.close();
} catch (XMLException ex) {
getContext().getLogger().log(Level.SEVERE,"Cannot get list of sync processes from DB: "+ex.getMessage(),ex);
getResponse().setStatus(Status.SERVER_ERROR_INTERNAL,"Cannot get list of sync processes due to XML DB error.");