@Test public void retrhowKnownException() { DuplicateName dn = new DuplicateName(); LocalizedMethodFault lmf = new LocalizedMethodFault(); lmf.setLocalizedMessage("msg"); lmf.setFault(dn); try { VimUtils.rethrow(lmf); fail(); } catch (DuplicateNameFaultMsg msg) { assertSame(dn, msg.getFaultInfo()); assertSame(lmf.getLocalizedMessage(), msg.getMessage()); } catch (Exception e) { fail(); } }
@Test public void convertToFault() { DuplicateName fault = new DuplicateName(); String msg = "msg"; Exception e = new DuplicateNameFaultMsg(msg, fault); LocalizedMethodFault lmf = VimUtils.convertExceptionToFault(e); assertSame(fault, lmf.getFault()); assertSame(msg, lmf.getLocalizedMessage()); }
public void addCustomFieldDef(String name, Class<?> type) { CustomFieldsManager manager = vmwareClient.getServiceInstance().getCustomFieldsManager(); CustomFieldDef[] defs = manager.getField(); String typeName = type.getSimpleName(); if (defs != null) { for (CustomFieldDef def : defs) { if (def.getName().equals(name) && def.getManagedObjectType().equals(typeName)) { // 既にカスタムフィールドが追加されている場合はスキップ return; } } } try { manager.addCustomFieldDef(name, typeName, null, null); } catch (DuplicateName ignore) { // 他のスレッドで同時に追加された場合に備えて握りつぶす return; } catch (RemoteException e) { throw new AutoException("EPROCESS-000525", e, name, typeName); } if (log.isInfoEnabled()) { log.info(MessageUtils.getMessage("IPROCESS-100461", name)); } }
/** * Remove the device. Make sure the VM is powered off before calling this method. * If destroyDeviceBacking is true, it deletes backings for example files in datastore. BE CAREFUL! */ public Task removeDevice(VirtualDevice device, boolean destroyDeviceBacking) throws InvalidName, VmConfigFault, DuplicateName, TaskInProgress, FileFault, InvalidState, ConcurrentAccess, InvalidDatastore, InsufficientResourcesFault, RuntimeFault, RemoteException { ArrayList<VirtualDevice> deviceList = new ArrayList<VirtualDevice>(); deviceList.add(device); return removeDevices(deviceList, destroyDeviceBacking); }
/** * Create an instance of {@link JAXBElement }{@code <}{@link DuplicateName }{@code >}} * */ @XmlElementDecl(namespace = "urn:pbm", name = "DuplicateNameFault") public JAXBElement<DuplicateName> createDuplicateNameFault(DuplicateName value) { return new JAXBElement<DuplicateName>(_DuplicateNameFault_QNAME, DuplicateName.class, null, value); }
CustomFieldDef addCustomFieldDef(String name, String moType, PrivilegePolicyDef fieldDefPolicy, PrivilegePolicyDef fieldPolicy) throws DuplicateName, InvalidPrivilege, RuntimeFault, RemoteException;
/** * @param floppyImagePath - i.e. "[storage1] myVM/myFloppy.flp" Note: there is a space after ]. */ public Task addFloppyDriveFromISO(String floppyImagePath, boolean startConnected) throws InvalidName, VmConfigFault, DuplicateName, TaskInProgress, FileFault, InvalidState, ConcurrentAccess, InvalidDatastore, InsufficientResourcesFault, RuntimeFault, RemoteException { return addFloppyDrive(floppyImagePath, null, null, startConnected); }
/** * @param hostDevice - i.e. "/dev/fd0" */ public Task addFloppyDriveFromHost(String hostDevice, boolean startConnected) throws InvalidName, VmConfigFault, DuplicateName, TaskInProgress, FileFault, InvalidState, ConcurrentAccess, InvalidDatastore, InsufficientResourcesFault, RuntimeFault, RemoteException { return addFloppyDrive(null, null, hostDevice, startConnected); }
public Task createFloppyDrive(String floppyImagePath, boolean startConnected) throws InvalidName, VmConfigFault, DuplicateName, TaskInProgress, FileFault, InvalidState, ConcurrentAccess, InvalidDatastore, InsufficientResourcesFault, RuntimeFault, RemoteException { return addFloppyDrive(null, floppyImagePath, null, startConnected); }
public void updateHostProfile(HostProfileConfigSpec config) throws DuplicateName, ProfileUpdateFailed, RuntimeFault, RemoteException { getVimService().updateHostProfile(getMOR(), config); }
public Task reconfigureDVPortgroup_Task(DVPortgroupConfigSpec spec) throws DvsFault, ConcurrentAccess, DuplicateName, InvalidName, RuntimeFault, RemoteException { ManagedObjectReference mor = getVimService().reconfigureDVPortgroup_Task(getMOR(), spec); return new Task(getServerConnection(), mor); }
public Task addDVPortgroup_Task(DVPortgroupConfigSpec[] spec) throws DvsFault, DuplicateName, InvalidName, RuntimeFault, RemoteException { ManagedObjectReference taskMor = getVimService().addDVPortgroup_Task(getMOR(), spec); return new Task(getServerConnection(), taskMor); }
/** @since SDK5.1 */ public Task createDVPortgroup_Task(DVPortgroupConfigSpec spec) throws DvsFault, DuplicateName, InvalidName, RuntimeFault, RemoteException { ManagedObjectReference taskMor = getVimService().createDVPortgroup_Task(getMOR(), spec); return new Task(getServerConnection(), taskMor); }
public Task reconfigureDvs_Task(DVSConfigSpec spec) throws DvsNotAuthorized, DvsFault, ConcurrentAccess, DuplicateName, InvalidState, InvalidName, NotFound, AlreadyExists, LimitExceeded, ResourceInUse, ResourceNotAvailable, RuntimeFault, RemoteException { ManagedObjectReference taskMor = getVimService().reconfigureDvs_Task(getMOR(), spec); return new Task(getServerConnection(), taskMor); }
public void updateVAppConfig(VAppConfigSpec spec) throws TaskInProgress, VmConfigFault, ConcurrentAccess, FileFault, InvalidName, DuplicateName, InvalidState, InsufficientResourcesFault, InvalidDatastore, RuntimeFault, RemoteException { getVimService().updateVAppConfig(getMOR(), spec); }
public Task rename_Task(String name) throws InvalidName, DuplicateName, RuntimeFault, RemoteException { ManagedObjectReference taskMor = getVimService().rename_Task(getMOR(), name); return new Task(getServerConnection(), taskMor); }
public void updateClusterProfile(ClusterProfileConfigSpec config) throws DuplicateName, RuntimeFault, RemoteException { getVimService().updateClusterProfile(getMOR(), config); }
public Profile createProfile(ProfileCreateSpec createSpec) throws DuplicateName, RuntimeFault, RemoteException { ManagedObjectReference profileMor = getVimService().createProfile(getMOR(), createSpec); return new Profile(getServerConnection(), profileMor); }
/** * @since SDK4.0 */ ScheduledTask createObjectScheduledTask(ManagedObject obj, ScheduledTaskSpec spec) throws InvalidName, DuplicateName, RuntimeFault, RemoteException;
Alarm createAlarm(ManagedEntity me, AlarmSpec as) throws InvalidName, DuplicateName, RuntimeFault, RemoteException;
List<Profile> createProfile(ProfileCreateSpec createSpec) throws DuplicateName, RuntimeFault, RemoteException;
ScheduledTask createScheduledTask(ManagedEntity entity, ScheduledTaskSpec spec) throws InvalidName, DuplicateName, RuntimeFault, RemoteException;
void renameCustomFieldDef(int key, String name) throws DuplicateName, RuntimeFault, RemoteException;