@Test public void testSyncDeployOvfTemplate() throws Exception { prepareMocksForDeployOvfTemplate(false); serviceSpy.deployOvfTemplate(httpInputsMock, vmInputsMock, PATH, ovfNetworkMapMock, ovfPropertyMapMock); verifyMockInvocationsForDeployOvfTemplate(false); }
public void deployOvfTemplate(final HttpInputs httpInputs, final VmInputs vmInputs, final String templatePath, final Map<String, String> ovfNetworkMap, final Map<String, String> ovfPropertyMap) throws Exception { final ConnectionResources connectionResources = new ConnectionResources(httpInputs, vmInputs); try { final ImmutablePair<ManagedObjectReference, OvfCreateImportSpecResult> pair = createLeaseSetup(connectionResources, vmInputs, templatePath, ovfNetworkMap, ovfPropertyMap); final ManagedObjectReference httpNfcLease = pair.getLeft(); final OvfCreateImportSpecResult importSpecResult = pair.getRight(); final HttpNfcLeaseInfo httpNfcLeaseInfo = getHttpNfcLeaseInfoWhenReady(connectionResources, httpNfcLease); final List<HttpNfcLeaseDeviceUrl> deviceUrls = httpNfcLeaseInfo.getDeviceUrl(); final ProgressUpdater progressUpdater = executor.isParallel() ? new AsyncProgressUpdater(getDisksTotalNoBytes(importSpecResult), httpNfcLease, connectionResources) : new SyncProgressUpdater(getDisksTotalNoBytes(importSpecResult), httpNfcLease, connectionResources); executor.execute(progressUpdater); transferVmdkFiles(templatePath, importSpecResult, deviceUrls, progressUpdater); executor.shutdown(); } finally { if (httpInputs.isCloseSession()) { connectionResources.getConnection().disconnect(); clearConnectionFromContext(httpInputs.getGlobalSessionObject()); } } }
DeployOvfTemplateService { public void deployOvfTemplate(final HttpInputs httpInputs, final VmInputs vmInputs, final String templatePath, final Map<String, String> ovfNetworkMap, final Map<String, String> ovfPropertyMap) throws Exception { final ConnectionResources connectionResources = new ConnectionResources(httpInputs, vmInputs); try { final ImmutablePair<ManagedObjectReference, OvfCreateImportSpecResult> pair = createLeaseSetup(connectionResources, vmInputs, templatePath, ovfNetworkMap, ovfPropertyMap); final ManagedObjectReference httpNfcLease = pair.getLeft(); final OvfCreateImportSpecResult importSpecResult = pair.getRight(); final HttpNfcLeaseInfo httpNfcLeaseInfo = getHttpNfcLeaseInfoWhenReady(connectionResources, httpNfcLease); final List<HttpNfcLeaseDeviceUrl> deviceUrls = httpNfcLeaseInfo.getDeviceUrl(); final ProgressUpdater progressUpdater = executor.isParallel() ? new AsyncProgressUpdater(getDisksTotalNoBytes(importSpecResult), httpNfcLease, connectionResources) : new SyncProgressUpdater(getDisksTotalNoBytes(importSpecResult), httpNfcLease, connectionResources); executor.execute(progressUpdater); transferVmdkFiles(templatePath, importSpecResult, deviceUrls, progressUpdater); executor.shutdown(); } finally { if (httpInputs.isCloseSession()) { connectionResources.getConnection().disconnect(); clearConnectionFromContext(httpInputs.getGlobalSessionObject()); } } } }
DeployOvfTemplateService { public void deployOvfTemplate(final HttpInputs httpInputs, final VmInputs vmInputs, final String templatePath, final Map<String, String> ovfNetworkMap, final Map<String, String> ovfPropertyMap) throws Exception { final ConnectionResources connectionResources = new ConnectionResources(httpInputs, vmInputs); try { final ImmutablePair<ManagedObjectReference, OvfCreateImportSpecResult> pair = createLeaseSetup(connectionResources, vmInputs, templatePath, ovfNetworkMap, ovfPropertyMap); final ManagedObjectReference httpNfcLease = pair.getLeft(); final OvfCreateImportSpecResult importSpecResult = pair.getRight(); final HttpNfcLeaseInfo httpNfcLeaseInfo = getHttpNfcLeaseInfoWhenReady(connectionResources, httpNfcLease); final List<HttpNfcLeaseDeviceUrl> deviceUrls = httpNfcLeaseInfo.getDeviceUrl(); final ProgressUpdater progressUpdater = executor.isParallel() ? new AsyncProgressUpdater(getDisksTotalNoBytes(importSpecResult), httpNfcLease, connectionResources) : new SyncProgressUpdater(getDisksTotalNoBytes(importSpecResult), httpNfcLease, connectionResources); executor.execute(progressUpdater); transferVmdkFiles(templatePath, importSpecResult, deviceUrls, progressUpdater); executor.shutdown(); } finally { if (httpInputs.isCloseSession()) { connectionResources.getConnection().disconnect(); clearConnectionFromContext(httpInputs.getGlobalSessionObject()); } } } DeployOvfTemplateService(final boolean parallel); }
DeployOvfTemplateService { public void deployOvfTemplate(final HttpInputs httpInputs, final VmInputs vmInputs, final String templatePath, final Map<String, String> ovfNetworkMap, final Map<String, String> ovfPropertyMap) throws Exception { final ConnectionResources connectionResources = new ConnectionResources(httpInputs, vmInputs); try { final ImmutablePair<ManagedObjectReference, OvfCreateImportSpecResult> pair = createLeaseSetup(connectionResources, vmInputs, templatePath, ovfNetworkMap, ovfPropertyMap); final ManagedObjectReference httpNfcLease = pair.getLeft(); final OvfCreateImportSpecResult importSpecResult = pair.getRight(); final HttpNfcLeaseInfo httpNfcLeaseInfo = getHttpNfcLeaseInfoWhenReady(connectionResources, httpNfcLease); final List<HttpNfcLeaseDeviceUrl> deviceUrls = httpNfcLeaseInfo.getDeviceUrl(); final ProgressUpdater progressUpdater = executor.isParallel() ? new AsyncProgressUpdater(getDisksTotalNoBytes(importSpecResult), httpNfcLease, connectionResources) : new SyncProgressUpdater(getDisksTotalNoBytes(importSpecResult), httpNfcLease, connectionResources); executor.execute(progressUpdater); transferVmdkFiles(templatePath, importSpecResult, deviceUrls, progressUpdater); executor.shutdown(); } finally { if (httpInputs.isCloseSession()) { connectionResources.getConnection().disconnect(); clearConnectionFromContext(httpInputs.getGlobalSessionObject()); } } } DeployOvfTemplateService(final boolean parallel); void deployOvfTemplate(final HttpInputs httpInputs, final VmInputs vmInputs, final String templatePath,
                                  final Map<String, String> ovfNetworkMap, final Map<String, String> ovfPropertyMap); }
DeployOvfTemplateService { public void deployOvfTemplate(final HttpInputs httpInputs, final VmInputs vmInputs, final String templatePath, final Map<String, String> ovfNetworkMap, final Map<String, String> ovfPropertyMap) throws Exception { final ConnectionResources connectionResources = new ConnectionResources(httpInputs, vmInputs); try { final ImmutablePair<ManagedObjectReference, OvfCreateImportSpecResult> pair = createLeaseSetup(connectionResources, vmInputs, templatePath, ovfNetworkMap, ovfPropertyMap); final ManagedObjectReference httpNfcLease = pair.getLeft(); final OvfCreateImportSpecResult importSpecResult = pair.getRight(); final HttpNfcLeaseInfo httpNfcLeaseInfo = getHttpNfcLeaseInfoWhenReady(connectionResources, httpNfcLease); final List<HttpNfcLeaseDeviceUrl> deviceUrls = httpNfcLeaseInfo.getDeviceUrl(); final ProgressUpdater progressUpdater = executor.isParallel() ? new AsyncProgressUpdater(getDisksTotalNoBytes(importSpecResult), httpNfcLease, connectionResources) : new SyncProgressUpdater(getDisksTotalNoBytes(importSpecResult), httpNfcLease, connectionResources); executor.execute(progressUpdater); transferVmdkFiles(templatePath, importSpecResult, deviceUrls, progressUpdater); executor.shutdown(); } finally { if (httpInputs.isCloseSession()) { connectionResources.getConnection().disconnect(); clearConnectionFromContext(httpInputs.getGlobalSessionObject()); } } } DeployOvfTemplateService(final boolean parallel); void deployOvfTemplate(final HttpInputs httpInputs, final VmInputs vmInputs, final String templatePath,
                                  final Map<String, String> ovfNetworkMap, final Map<String, String> ovfPropertyMap);  }