congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
ManagedObjectReference.getType
Code IndexAdd Tabnine to your IDE (free)

How to use
getType
method
in
com.vmware.vim25.ManagedObjectReference

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

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.photon.controller/photon-vsphere-adapter-util

private List<Element> acceptOnly(List<Element> found, String... types) {
  return found.stream()
      .filter(e -> {
        for (String t : types) {
          if (e.object.getType().equals(t)) {
            return true;
          }
        }
        return false;
      })
      .collect(Collectors.toList());
}
origin: mucommander/mucommander

@Override
public int hashCode() {
  final int prime = 31;
  int result = 1;
  result = prime * result
      + ((mor.getValue() == null) ? 0 : mor.getValue().hashCode());
  result = prime * result
      + ((mor.getType() == null) ? 0 : mor.getType().hashCode());
  return result;
}
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: mucommander/mucommander

@Override
public String toString() {
  return "ManagedObjectReferenceWrapper [type=" + mor.getType() + ", value=" + mor.getValue() + "]";
}
origin: com.vmware.photon.controller/photon-vsphere-adapter-util

public MoRef(ManagedObjectReference ref) {
  this.type = ref.getType();
  this.value = ref.getValue();
}
origin: LendingClub/mercator

public String computeUniqueId(ManagedObjectReference mor) {
  Preconditions
      .checkNotNull(mor, "ManagedObjectReference cannot be null");
  Preconditions.checkArgument(
      !ManagedObjectTypes.VIRTUAL_MACHINE.equals(mor.getType()),
      "cannot call computeMacId() with mor.type=VirtualMachine");
  return Hashing
      .sha1()
      .hashString(getVCenterId() + mor.getType() + mor.getVal(),
          Charsets.UTF_8)
      .toString();
}
origin: net.java.dev.vcc/vcc-vmware-esx-impl

  @Override
  public String toString() {
    final StringBuilder sb = new StringBuilder(super.toString());
    try {
      sb.append(";type=");
      sb.append(URLEncoder.encode(moRef.getType(), "UTF-8"));
      sb.append(";value=");
      sb.append(URLEncoder.encode(moRef.getValue(), "UTF-8"));
    } catch (UnsupportedEncodingException e) {
      // ignore, this cannot happen
    }
    return sb.toString();
  }
}
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: com.vmware/vijava

/**
 * Get multiple properties by their paths
 * @param propPaths an array of strings for property path
 * @return a Hashtable holding with the property path as key, and the value.
 * @throws InvalidProperty
 * @throws RuntimeFault
 * @throws RemoteException
 */
public Hashtable getPropertiesByPaths(String[] propPaths) 
  throws InvalidProperty,	RuntimeFault, RemoteException
{
  Hashtable[] pht = PropertyCollectorUtil.retrieveProperties(
      new ManagedObject[] { this }, getMOR().getType(), propPaths);
  if(pht.length!=0)
    return pht[0];
  else 
    return null;
}
 
origin: LendingClub/mercator

ObjectNode toObjectNode(HostSystem host) {
  ManagedObjectReference mor = host.getMOR();
  HostHardwareInfo hh = host.getHardware();
  ObjectNode n = mapper.createObjectNode().put("id", getUniqueId(host))
      .put("name", host.getName()).put("vmw_morType", mor.getType())
      .put("vmw_morVal", mor.getVal()).put("vmw_hardwareModel",
          hh.getSystemInfo().getModel())
      .put("vmw_cpuCoreCount", hh.getCpuInfo().getNumCpuCores())
      .put("vmw_memorySize", hh.getMemorySize());
  return n;
}
origin: com.vmware/vijava

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

 static void printPermissions(Permission[] ps)
 {
  for(int i=0; ps!=null && i< ps.length; i++)
  {
   System.out.println("\nEntity:" 
     + ps[i].getEntity().getType() + ":" 
     + ps[i].getEntity().get_value());
   System.out.println("IsGroup:" + ps[i].isGroup());
   System.out.println("Principal:" + ps[i].getPrincipal());
   System.out.println("Propogated:" + ps[i].isPropagate());
   System.out.println("RoleId:" + ps[i].getRoleId());
  }
 }
}
origin: yavijava/yavijava-samples

 static void printPermissions(Permission[] ps)
 {
  for(int i=0; ps!=null && i< ps.length; i++)
  {
   System.out.println("\nEntity:" 
     + ps[i].getEntity().getType() + ":" 
     + ps[i].getEntity().get_value());
   System.out.println("IsGroup:" + ps[i].isGroup());
   System.out.println("Principal:" + ps[i].getPrincipal());
   System.out.println("Propogated:" + ps[i].isPropagate());
   System.out.println("RoleId:" + ps[i].getRoleId());
  }
 }
}
origin: com.vmware.photon.controller/photon-vsphere-adapter-util

private PropertyFilterSpec propertyFilterSpec(ManagedObjectReference objmor,
    String[] filterProps, String[] propsToMatch) {
  PropertyFilterSpec spec = new PropertyFilterSpec();
  ObjectSpec oSpec = new ObjectSpec();
  oSpec.setObj(objmor);
  oSpec.setSkip(Boolean.FALSE);
  spec.getObjectSet().add(oSpec);
  Set<String> uniqPropSet = new HashSet<>(Arrays.asList(filterProps));
  uniqPropSet.addAll(Arrays.asList(propsToMatch));
  PropertySpec pSpec = new PropertySpec();
  pSpec.getPathSet().addAll(new ArrayList<>(uniqPropSet));
  pSpec.setType(objmor.getType());
  spec.getPropSet().add(pSpec);
  return spec;
}
origin: com.vmware.photon.controller/photon-vsphere-adapter-util

public List<Element> list()
    throws FinderException, InvalidPropertyFaultMsg, RuntimeFaultFaultMsg {
  switch (this.start.getType()) {
  case "Folder":
    return listFolder();
  case "Datacenter":
    return listDatacenter();
  case "ComputeResource":
  case "ClusterComputeResource":
    // Treat ComputeResource and ClusterComputeResource as one and the same.
    // It doesn't matter from the perspective of the lister.
    return listComputeResource();
  case "ResourcePool":
    return listResourcePool();
  default:
    throw new FinderException("Unlistable type: " + this.start.getType());
  }
}
origin: io.cloudslang.content/score-vmware

private PropertyFilterSpec propertyFilterSpec(ManagedObjectReference objmor, String[] filterProps) {
  ObjectSpec oSpec = new ObjectSpec();
  oSpec.setObj(objmor);
  oSpec.setSkip(false);
  PropertySpec pSpec = new PropertySpec();
  pSpec.getPathSet().addAll(Arrays.asList(filterProps));
  pSpec.setType(objmor.getType());
  PropertyFilterSpec spec = new PropertyFilterSpec();
  spec.getObjectSet().add(oSpec);
  spec.getPropSet().add(pSpec);
  return spec;
}
origin: com.vmware.photon.controller/photon-vsphere-adapter-util

private String getName(ObjectContent cont) throws FinderException {
  for (DynamicProperty dp : cont.getPropSet()) {
    if (dp.getName().equals("name")) {
      return (String) dp.getVal();
    }
  }
  // probably bad spec
  throw new FinderException("Name property not found/fetched for " + cont.getObj().getType());
}
origin: net.java.dev.vcc/vcc-vmware-esx-impl

private void writeObject(ObjectOutputStream out) throws IOException {
  ObjectOutputStream.PutField fields = out.putFields();
  fields.put("type", moRef.getType());
  fields.put("value", moRef.getValue());
  out.writeFields();
}
origin: com.vmware/vijava

public void watch(ManagedObject[] mos, String[] propNames)
{
  PropertyFilterSpec pfs = new PropertyFilterSpec();
  
  ObjectSpec[] oss = new ObjectSpec[mos.length];
  for(int i=0; i<oss.length; i++)
  {
    oss[i] = new ObjectSpec();
    oss[i].setObj(mos[i].getMOR());
  }
  pfs.setObjectSet(oss);
  
  PropertySpec ps = new PropertySpec();
  ps.setType(mos[0].getMOR().getType());
  ps.setPathSet(propNames);
  pfs.setPropSet(new PropertySpec[] { ps });
  watch(pfs);
}
 
com.vmware.vim25ManagedObjectReferencegetType

Javadoc

Gets the value of the type property.

Popular methods of ManagedObjectReference

  • <init>
  • 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

  • Making http post requests using okhttp
  • addToBackStack (FragmentTransaction)
  • getExternalFilesDir (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • Path (java.nio.file)
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Top 25 Plugins for Webstorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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