Tabnine Logo
ManagedObjectReference
Code IndexAdd Tabnine to your IDE (free)

How to use
ManagedObjectReference
in
com.vmware.vim25

Best Java code snippets using com.vmware.vim25.ManagedObjectReference (Showing top 20 results out of 315)

origin: mucommander/mucommander

public ManagedObjectReference getServiceInstance() {
  ManagedObjectReference serviceInstanceMOR = new ManagedObjectReference();
  serviceInstanceMOR.setType(TYPE_SERVICE_INSTANCE);
  serviceInstanceMOR.setValue(TYPE_SERVICE_INSTANCE);
  return serviceInstanceMOR;
}
origin: com.vmware.photon.controller/photon-vsphere-adapter-util

public static boolean isTraversable(ManagedObjectReference ref) {
  switch (ref.getType()) {
  case "Folder":
  case "Datacenter":
  case "ComputeResource":
  case "ClusterComputeResource":
    // Treat ComputeResource and ClusterComputeResource as one and the same.
    // It doesn't matter from the perspective of the lister.
    return true;
  default:
    return false;
  }
}
origin: com.vmware/vijava

@Override
public boolean equals(Object obj) {
 if(this == obj)
  return true;
 if((obj == null) || (obj.getClass() != this.getClass()))
  return false;
 ManagedObjectReference mor = (ManagedObjectReference)obj;
 return  mor.getType().equals(getType()) && mor.getVal().equals(getVal());
}
origin: com.vmware/vijava

  public static ManagedObjectReference createMOR(String type, String id)
  {
    ManagedObjectReference mor = new ManagedObjectReference();
    mor.setType(type);
    mor.set_value(id);
    return mor; 
  }
}
origin: mucommander/mucommander

@Override
public String toString() {
  return "ManagedObjectReferenceWrapper [type=" + mor.getType() + ", value=" + mor.getValue() + "]";
}
origin: OpenNMS/opennms

/**
 * Returns a host system by a given managed object Id.
 *
 * @param managedObjectId the managed object Id
 * @return the host system object
 */
public HostSystem getHostSystemByManagedObjectId(String managedObjectId) {
  ManagedObjectReference managedObjectReference = new ManagedObjectReference();
  managedObjectReference.setType("HostSystem");
  managedObjectReference.setVal(managedObjectId);
  HostSystem hostSystem = (HostSystem) MorUtil.createExactManagedEntity(m_serviceInstance.getServerConnection(), managedObjectReference);
  return hostSystem;
}
origin: LendingClub/mercator

@Test
public void testComputeMacId() {
  ManagedObjectReference mor = new ManagedObjectReference();
  mor.setType("HostSystem");
  mor.setVal("host-123");
  VMWareScanner s = Mockito.mock(VMWareScanner.class);
  when(s.getVCenterId()).thenReturn("abcdef");
  Mockito.when(s.computeUniqueId(mor)).thenCallRealMethod();
  assertThat(mor.getType()).isEqualTo("HostSystem");
  assertThat(s.computeUniqueId(mor)).isEqualTo("21b23eae3d48797d8d057329705825e637e35d81");
  VMWareScanner s2 = Mockito.mock(VMWareScanner.class);
  when(s2.getVCenterId()).thenReturn("another");
  Mockito.when(s2.computeUniqueId(mor)).thenCallRealMethod();
  assertThat(s.computeUniqueId(mor)).isNotEqualTo(s2.computeUniqueId(mor));
  /*
   * try { new VSphereScanner().computeMacId(null); } catch (Exception e)
   * { assertThat(e) .isExactlyInstanceOf(NullPointerException.class)
   * .hasMessageContaining("cannot be null"); }
   * 
   * mor = new ManagedObjectReference(); mor.setType("VirtualMachine");
   * mor.setVal("vm-123"); try { new VSphereScanner().computeMacId(mor);
   * fail(); } catch (Exception e) { assertThat(e).isInstanceOf(
   * IllegalArgumentException.class); }
   */
}
origin: com.vmware/vijava

private static int findIndex (ManagedObject[] mos, ManagedObjectReference mor)
{
  for(int i=0; i<mos.length; i++)
  {
    if(mor.getType().equals(mos[i].getMOR().getType()) && 
      mor.get_value().equals(mos[i].getMOR().get_value()))
    return i;
  }
  return -1;
}
origin: OpenNMS/opennms

.forEach(hostSystem -> {
      synchronized (m_hostSystemMap) {
        m_hostSystemMap.put(hostSystem.getMOR().getVal(), hostSystem.getName());
.filter(hostSystem -> checkForAttribute(hostSystem))
.map(hostSystem -> CompletableFuture.supplyAsync(() -> {
  logger.debug("Adding Host System '{}' (ID: {})", hostSystem.getName(), hostSystem.getMOR().getVal());
  logger.debug("Found {} IP addresses for Host System '{}' (ID: {}): {}", ipAddresses.size(), hostSystem.getName(), hostSystem.getMOR().getVal(), ipAddresses);
    node.putAsset(new RequisitionAsset("cpu", hostSystem.getHardware().getCpuInfo().getNumCpuCores() + " cores"));
  } catch (Exception e) {
    logger.debug("Can't find CPU information for '{}' (ID: {})", hostSystem.getName(), hostSystem.getMOR().getVal());
    node.putAsset(new RequisitionAsset("ram", Math.round(hostSystem.getHardware().getMemorySize() / 1000000f) + " MB"));
  } catch (Exception e) {
    logger.debug("Can't find Memory information for '{}' (ID: {})", hostSystem.getName(), hostSystem.getMOR().getVal());
origin: net.java.dev.vcc/vcc-vmware-esx-impl

public AbstractManagedObject getManagedObject(ManagedObjectReference value) {
  return model.get(value.getValue());
}
origin: com.vmware/vijava

private static ManagedObjectReference createMOR(String type, String value)
{
 ManagedObjectReference mor = new ManagedObjectReference();
 mor.val = value;
 mor.type = type;
 return mor;
}
 
origin: yavijava/yavijava-samples

 public static ManagedObjectReference createMOR(String type, String id)
 {
  ManagedObjectReference mor = new ManagedObjectReference();
  mor.setType(type);
  mor.set_value(id);
  return mor; 
 }
}
origin: OpenNMS/opennms

/**
 * Returns a virtual machine by a given managed object Id.
 *
 * @param managedObjectId the managed object Id
 * @return the virtual machine object
 */
public VirtualMachine getVirtualMachineByManagedObjectId(String managedObjectId) {
  ManagedObjectReference managedObjectReference = new ManagedObjectReference();
  managedObjectReference.setType("VirtualMachine");
  managedObjectReference.setVal(managedObjectId);
  VirtualMachine virtualMachine = (VirtualMachine) MorUtil.createExactManagedEntity(m_serviceInstance.getServerConnection(), managedObjectReference);
  return virtualMachine;
}
origin: com.vmware.photon.controller/photon-vsphere-adapter-util

public MoRef(ManagedObjectReference ref) {
  this.type = ref.getType();
  this.value = ref.getValue();
}
origin: com.vmware/vijava

public String toString()
{
  return mor.getType() + ":" + mor.get_value()
    + " @ " + getServerConnection().getUrl();
}
origin: OpenNMS/opennms

/**
 * Checks whether the virtual machine should be imported into the requisition.
 *
 * @param virtualMachine the system to check
 * @return true for import, false otherwise
 */
private boolean checkVMPowerState(VirtualMachine virtualMachine) {
  logger.debug("Checking power state for VM {} (ID: {})", virtualMachine.getName(), virtualMachine.getMOR().getVal());
  String powerState = virtualMachine.getRuntime().getPowerState().toString();
  if ("poweredOn".equals(powerState) && request.isImportVMPoweredOn()) {
    return true;
  }
  if ("poweredOff".equals(powerState) && request.isImportVMPoweredOff()) {
    return true;
  }
  if ("suspended".equals(powerState) && request.isImportVMSuspended()) {
    return true;
  }
  return false;
}
origin: com.vmware.photon.controller/photon-vsphere-adapter-util

private ObjectContent findByRef(ManagedObjectReference ref, List<ObjectContent> ocs) {
  if (ref == null) {
    return null;
  }
  for (ObjectContent oc : ocs) {
    ManagedObjectReference obj = oc.getObj();
    if (Objects.equals(ref.getValue(), obj.getValue())) {
      return oc;
    }
  }
  return null;
}
origin: net.java.dev.vcc.thirdparty/vi-api

/**
 * Create an instance of {@link ManagedObjectReference }
 * 
 */
public ManagedObjectReference createManagedObjectReference() {
  return new ManagedObjectReference();
}
origin: net.java.dev.vcc/vcc-vmware-esx-impl

public static final ManagedObjectReference getServiceInstance() {
  ManagedObjectReference serviceInstance = new ManagedObjectReference();
  serviceInstance.setType("ServiceInstance");
  serviceInstance.setValue("ServiceInstance");
  return serviceInstance;
}
origin: com.vmware/vijava

  public static ManagedObjectReference createMOR(String type, String id)
  {
    ManagedObjectReference mor = new ManagedObjectReference();
    mor.setType(type);
    mor.set_value(id);
    return mor; 
  }
}
com.vmware.vim25ManagedObjectReference

Most used methods

  • <init>
  • getType
    Gets the value of the type property.
  • setType
    Sets the value of the type property.
  • setValue
    Sets the value of the value property.
  • getVal
  • getValue
    Gets the value of the value property.
  • get_value
  • setVal
  • set_value

Popular in Java

  • Finding current android device location
  • startActivity (Activity)
  • addToBackStack (FragmentTransaction)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • Notification (javax.management)
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now