Package org.virtualbox_4_0

Examples of org.virtualbox_4_0.IProgress


      if (master.getMachine().getCurrentSnapshot() != null) {
         ISession session;
         try {
            session = manager.get().getSessionObject();
            master.getMachine().lockMachine(session, LockType.Write);
            IProgress progress = session.getConsole().deleteSnapshot(master.getMachine().getCurrentSnapshot().getId());
            progress.waitForCompletion(-1);
            session.unlockMachine();
         } catch (Exception e) {
            throw new RuntimeException("error opening vbox machine session: " + e.getMessage(), e);
         }
         logger.debug("<< deleted an existing snapshot of vm(%s)", master.getMachine().getName());
View Full Code Here


      if (isLinkedClone)
         options.add(CloneOptions.Link);

      ISnapshot currentSnapshot = new TakeSnapshotIfNotAlreadyAttached(manager,
            "snapshotName", "snapshotDesc", logger).apply(master);
      IProgress progress = currentSnapshot.getMachine().cloneTo(clonedMachine,
            CloneMode.MachineState, options);
      progress.waitForCompletion(-1);

      // memory may not be the same as the master vm
      clonedMachine.setMemorySize(cloneSpec.getVmSpec().getMemory());

      // registering
View Full Code Here

   * @return imported {@link IAppliance}
   */
  public IAppliance importAppliance(final Path importFile) {
    IAppliance appliance = vBox.createAppliance();

    IProgress readProgress = appliance.read(importFile.toAbsolutePath().toString());
    while (!readProgress.getCompleted()) {
      readProgress.waitForCompletion(1000);
    }

    appliance.interpret();

        logWarnings(appliance);

    // keep NAT MAC addresses
    List<ImportOptions> options = new LinkedList<>();
    options.add(ImportOptions.KeepNATMACs);
    IProgress importProgress = appliance.importMachines(options);
    while (!importProgress.getCompleted()) {
      importProgress.waitForCompletion(1000);
    }

        logWarnings(appliance);

    log.trace("Appliance import done!");
View Full Code Here

TOP

Related Classes of org.virtualbox_4_0.IProgress

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.