Java 类com.vmware.vim25.DuplicateName 实例源码

项目:photon-model    文件:VimUtilsTest.java   
@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();
    }
}
项目:photon-model    文件:VimUtilsTest.java   
@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());
}
项目:primecloud-controller    文件:VmwareProcessClient.java   
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));
    }
}
项目:vijava    文件:VirtualMachineDeviceManager.java   
/**
 * 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); 
}
项目:photon-model    文件:ObjectFactory.java   
/**
 * 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);
}
项目:jcloud-vsphere    文件:CustomFieldsManagerApi.java   
CustomFieldDef addCustomFieldDef(String name, String moType, PrivilegePolicyDef fieldDefPolicy,
PrivilegePolicyDef fieldPolicy) throws DuplicateName, InvalidPrivilege, RuntimeFault, RemoteException;
项目:vijava    文件:VirtualMachineDeviceManager.java   
/**
 * @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);
}
项目:vijava    文件:VirtualMachineDeviceManager.java   
/**
 * @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);
}
项目:vijava    文件:VirtualMachineDeviceManager.java   
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);
}
项目:vijava    文件:HostProfile.java   
public void updateHostProfile(HostProfileConfigSpec config) throws DuplicateName, ProfileUpdateFailed, RuntimeFault, RemoteException
{
    getVimService().updateHostProfile(getMOR(), config);
}
项目:vijava    文件:DistributedVirtualPortgroup.java   
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);
}
项目:vijava    文件:DistributedVirtualSwitch.java   
public Task addDVPortgroup_Task(DVPortgroupConfigSpec[] spec) throws DvsFault, DuplicateName, InvalidName, RuntimeFault, RemoteException
{
  ManagedObjectReference taskMor = getVimService().addDVPortgroup_Task(getMOR(), spec);
  return new Task(getServerConnection(), taskMor);
}
项目:vijava    文件:DistributedVirtualSwitch.java   
/** @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);
}
项目:vijava    文件:DistributedVirtualSwitch.java   
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);
}
项目:vijava    文件:VirtualApp.java   
public void updateVAppConfig(VAppConfigSpec spec) throws TaskInProgress, VmConfigFault, ConcurrentAccess, FileFault, InvalidName, DuplicateName, InvalidState, InsufficientResourcesFault, InvalidDatastore, RuntimeFault, RemoteException
{
    getVimService().updateVAppConfig(getMOR(), spec);
}
项目:vijava    文件:ManagedEntity.java   
public Task rename_Task(String name) throws InvalidName, DuplicateName, RuntimeFault, RemoteException 
{
    ManagedObjectReference taskMor = getVimService().rename_Task(getMOR(), name);
    return new Task(getServerConnection(), taskMor);
}
项目:vijava    文件:ClusterProfile.java   
public void updateClusterProfile(ClusterProfileConfigSpec config) throws DuplicateName, RuntimeFault, RemoteException
{
    getVimService().updateClusterProfile(getMOR(), config);
}
项目:vijava    文件:ProfileManager.java   
public Profile createProfile(ProfileCreateSpec createSpec) throws DuplicateName, RuntimeFault, RemoteException
{
    ManagedObjectReference profileMor = getVimService().createProfile(getMOR(), createSpec);
    return new Profile(getServerConnection(), profileMor); 
}
项目:jcloud-vsphere    文件:ScheduledTaskManagerApi.java   
/**
 * @since SDK4.0
 */
ScheduledTask createObjectScheduledTask(ManagedObject obj, ScheduledTaskSpec spec) throws InvalidName, DuplicateName, RuntimeFault, RemoteException;
项目:jcloud-vsphere    文件:AlarmManagerApi.java   
Alarm createAlarm(ManagedEntity me, AlarmSpec as) throws InvalidName, DuplicateName, RuntimeFault, RemoteException;
项目:jcloud-vsphere    文件:ClusterProfileManagerApi.java   
List<Profile> createProfile(ProfileCreateSpec createSpec) throws DuplicateName, RuntimeFault, RemoteException;
项目:jcloud-vsphere    文件:ScheduledTaskManagerApi.java   
ScheduledTask createScheduledTask(ManagedEntity entity, ScheduledTaskSpec spec) throws InvalidName, DuplicateName, RuntimeFault, RemoteException;
项目:jcloud-vsphere    文件:CustomFieldsManagerApi.java   
void renameCustomFieldDef(int key, String name) throws DuplicateName, RuntimeFault, RemoteException;