Package org.atomojo.app

Examples of org.atomojo.app.Storage


               DB db = dbinfo.getDB();
               if (dbNames.size()>0 && !dbNames.contains(db.getName())) {
                  continue;
               }
               try {
                  Storage storage = storageFactory.getStorage(db);
                  Backup backup = new Backup(db,storage,AtomApplication.RESOURCE_BASE);
                  File zipFile = new File(dir,db.getName()+".zip");
                  backup.toZip(db.getName(), zipFile);
               } catch (Exception ex) {
                  getLogger().log(Level.SEVERE,"Cannot backup database "+db.getName()+" due to exception.",ex);
View Full Code Here


                  continue;
               }
               File dbDir = new File(dir,db.getName());
               boolean needsCleanup = false;
               try {
                  Storage storage = storageFactory.getStorage(db);
                  File zipFile = new File(dir,db.getName()+".zip");
                  if (!dbDir.exists() && zipFile.exists()) {
                     // This is what we want but it doesn't work
                     //introspectionURI = new URI("jar:"+zipFile.toURI()+"!/_introspection_.xml");
                     getLogger().info("Extracting backup for restore...");
View Full Code Here

         getResponse().setStatus(Status.CLIENT_ERROR_BAD_REQUEST);
         return new StringRepresentation("Non-XML media type for entity body: "+entity.getMediaType().getName());
      }
     
      final DB db = (DB)getRequest().getAttributes().get(App.DB_ATTR);
      final Storage storage = (Storage)getRequest().getAttributes().get(App.STORAGE_ATTR);
      XMLRepresentationParser parser = new XMLRepresentationParser();
      try {
         DocumentDestination dest = new DocumentDestination();
        
         parser.parse(entity,AdminApplication.createAdminDocumentDestination(dest,AdminXML.NM_RESTORE));
View Full Code Here

   }
  
   public Representation get()
   {
      final DB db = (DB)getRequest().getAttributes().get(App.DB_ATTR);
      final Storage storage = (Storage)getRequest().getAttributes().get(App.STORAGE_ATTR);
      final Reference resourceBase = (Reference)getRequest().getAttributes().get(App.RESOURCE_BASE_ATTR);
      File tmpDir = (File)getContext().getAttributes().get(WebComponent.ATOMOJO_TMP_DIR);
      long tstamp = System.currentTimeMillis();
      String baseName = db.getName()+".backup."+tstamp;
      /*
 
View Full Code Here

   }
  
   public Representation post(Representation entity)
   {
      final DB db = (DB)getRequest().getAttributes().get(App.DB_ATTR);
      final Storage storage = (Storage)getRequest().getAttributes().get(App.STORAGE_ATTR);
      final Reference resourceBase = (Reference)getRequest().getAttributes().get(App.RESOURCE_BASE_ATTR);
      if (getRequest().getResourceRef().getRemainingPart().endsWith(".zip")) {
         getResponse().setStatus(Status.CLIENT_ERROR_METHOD_NOT_ALLOWED);
         return null;
      }
View Full Code Here

      setNegotiated(false);
   }
  
   public Representation get() {
      final DB db = (DB)getRequest().getAttributes().get(App.DB_ATTR);
      final Storage storage = (Storage)getRequest().getAttributes().get(App.STORAGE_ATTR);
      try {
         db.stop();
         db.connect();
         getResponse().setStatus(Status.SUCCESS_OK);
         Representation rep = new StringRepresentation("<success xmlns='"+AdminXML.NAMESPACE+"'/>",MediaType.APPLICATION_XML);
View Full Code Here

   }
  
   public Representation get()
   {
      final DB db = (DB)getRequest().getAttributes().get(App.DB_ATTR);
      final Storage storage = (Storage)getRequest().getAttributes().get(App.STORAGE_ATTR);
      final String name = getRequest().getAttributes().get("name").toString();

      SyncProcess proc = db.getSyncProcess(name);
     
      if (proc!=null) {
View Full Code Here

TOP

Related Classes of org.atomojo.app.Storage

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.