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

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

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

origin: net.java.dev.vcc/vcc-vmware-esx-impl

public AbstractManagedObject getManagedObject(ManagedObjectReference value) {
  return model.get(value.getValue());
}
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: 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: mucommander/mucommander

@Override
public String toString() {
  return "ManagedObjectReferenceWrapper [type=" + mor.getType() + ", value=" + mor.getValue() + "]";
}
origin: net.java.dev.vcc/vcc-vmware-esx-impl

<T> Future<T> addPendingTask(ManagedObjectReference moRef, ViTaskContinuation<T> c) {
  pendingTasks.put(moRef.getValue(), c);
  return c.getFuture();
}
origin: com.vmware.photon.controller/photon-vsphere-adapter-util

public MoRef(ManagedObjectReference ref) {
  this.type = ref.getType();
  this.value = ref.getValue();
}
origin: com.vmware.photon.controller/photon-vsphere-adapter-util

private Element uniqueResultOrFail(List<Element> found) throws FinderException {
  if (found.isEmpty()) {
    throw new FinderException("No elements matching the input pattern found");
  }
  if (found.size() > 1) {
    List<String> idList = found.stream()
        .map(o -> o.object.getValue())
        .collect(Collectors.toList());
    throw new FinderException("More than one elements found: " + idList);
  }
  return found.get(0);
}
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.photon.controller/photon-vsphere-adapter-util

private ObjectContent findByParent(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 findByRef(prop(oc, VimNames.PROPERTY_PARENT), ocs);
    }
  }
  return null;
}
origin: mucommander/mucommander

@Override
public boolean equals(Object obj) {
  if (this == obj)
    return true;
  if (obj == null)
    return false;
  if (getClass() != obj.getClass())
    return false;
  ManagedObjectReferenceWrapper other = (ManagedObjectReferenceWrapper) obj;
  if (mor.getValue() == null) {
    if (other.mor.getValue() != null)
      return false;
  } else if (!mor.getValue().equals(other.mor.getValue()))
    return false;
  if (mor.getType() == null) {
    if (other.mor.getType() != null)
      return false;
  } else if (!mor.getType().equals(other.mor.getType()))
    return false;
  return true;
}
origin: net.java.dev.vcc/vcc-vmware-esx-impl

public void processTask(TaskInfo taskInfo) {
  ViTaskContinuation<?> continuation = pendingTasks.get(taskInfo.getTask().getValue());
  if (continuation != null) {
    switch (taskInfo.getState()) {
      case SUCCESS:
        continuation.onSuccess();
        pendingTasks.remove(taskInfo.getTask().getValue());
        break;
      case ERROR:
        continuation.onError(taskInfo.getError());
        pendingTasks.remove(taskInfo.getTask().getValue());
        break;
    }
  }
}
origin: io.cloudslang.content/score-vmware

public static void addDataToVmDetailsMap(Map<String, String> inputMap,
                     VirtualMachineSummary virtualMachineSummary,
                     VirtualMachineConfigSummary virtualMachineConfigSummary) {
  inputMap.put(VmParameter.VM_ID.getValue(), virtualMachineSummary.getVm().getValue());
  inputMap.put(VmParameter.VM_FULL_NAME.getValue(), virtualMachineConfigSummary.getGuestFullName());
  inputMap.put(VmParameter.VM_UUID.getValue(), virtualMachineConfigSummary.getUuid());
  inputMap.put(Inputs.VM_CPU_COUNT, virtualMachineConfigSummary.getNumCpu().toString());
  inputMap.put(Inputs.VM_MEMORY_SIZE, virtualMachineConfigSummary.getMemorySizeMB().toString());
  inputMap.put(VmParameter.VM_ETH_COUNT.getValue(), virtualMachineConfigSummary.getNumEthernetCards().toString());
  inputMap.put(VmParameter.VM_DISK_COUNT.getValue(), virtualMachineConfigSummary.getNumVirtualDisks().toString());
  inputMap.put(Inputs.DATA_STORE, virtualMachineConfigSummary.getVmPathName()
      .substring(1, virtualMachineConfigSummary.getVmPathName().indexOf(Constants.RIGHT_SQUARE_BRACKET)));
  inputMap.put(VmParameter.VM_PATH_NAME.getValue(), virtualMachineConfigSummary.getVmPathName());
  inputMap.put(VmParameter.VM_IS_TEMPLATE.getValue(), Boolean.toString(virtualMachineConfigSummary.isTemplate()));
  if (virtualMachineSummary.getGuest() != null) {
    if (virtualMachineSummary.getGuest().getIpAddress() != null) {
      inputMap.put(VmParameter.VM_IP_ADDRESS.getValue(), virtualMachineSummary.getGuest().getIpAddress());
    } else {
      inputMap.put(VmParameter.VM_IP_ADDRESS.getValue(), Constants.EMPTY);
    }
  }
}
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: io.cloudslang.content/score-vmware

      task.getValue(), "Failure: The [" + vmInputs.getVirtualMachineName() + "] VM could not be reconfigured.");
} else {
  return ResponseUtils.getVmNotFoundResultsMap(vmInputs);
origin: io.cloudslang.content/score-vmware

/**
 * Method used to connect to specified data center and delete the virtual machine identified by the inputs provided.
 *
 * @param httpInputs Object that has all the inputs necessary to made a connection to data center
 * @param vmInputs   Object that has all the specific inputs necessary to identify the targeted virtual machine
 * @return Map with String as key and value that contains returnCode of the operation, success message with task id
 * of the execution or failure message and the exception if there is one
 * @throws Exception
 */
public Map<String, String> deleteVM(HttpInputs httpInputs, VmInputs vmInputs) throws Exception {
  ConnectionResources connectionResources = new ConnectionResources(httpInputs, vmInputs);
  try {
    ManagedObjectReference vmMor = new MorObjectHandler().getVmMor(connectionResources,
        VmParameter.VIRTUAL_MACHINE.getValue(), vmInputs.getVirtualMachineName());
    if (vmMor != null) {
      ManagedObjectReference task = connectionResources.getVimPortType().destroyTask(vmMor);
      return new ResponseHelper(connectionResources, task).getResultsMap("Success: The [" +
              vmInputs.getVirtualMachineName() + "] VM was deleted. The taskId is: " + task.getValue(),
          "Failure: The [" + vmInputs.getVirtualMachineName() + "] VM could not be deleted.");
    } else {
      return ResponseUtils.getVmNotFoundResultsMap(vmInputs);
    }
  } catch (Exception ex) {
    return ResponseUtils.getResultsMap(ex.toString(), Outputs.RETURN_CODE_FAILURE);
  } finally {
    connectionResources.getConnection().disconnect();
  }
}
origin: io.cloudslang.content/score-vmware

/**
 * Method used to connect to specified data center and power-on virtual machine identified by the inputs provided.
 *
 * @param httpInputs Object that has all the inputs necessary to made a connection to data center
 * @param vmInputs   Object that has all the specific inputs necessary to identify the targeted virtual machine
 * @return Map with String as key and value that contains returnCode of the operation, success message with task id
 * of the execution or failure message and the exception if there is one
 * @throws Exception
 */
public Map<String, String> powerOnVM(HttpInputs httpInputs, VmInputs vmInputs) throws Exception {
  ConnectionResources connectionResources = new ConnectionResources(httpInputs, vmInputs);
  try {
    ManagedObjectReference vmMor = new MorObjectHandler().getVmMor(connectionResources,
        VmParameter.VIRTUAL_MACHINE.getValue(), vmInputs.getVirtualMachineName());
    if (vmMor != null) {
      ManagedObjectReference task = connectionResources.getVimPortType().powerOnVMTask(vmMor, null);
      return new ResponseHelper(connectionResources, task).getResultsMap("Success: The [" +
          vmInputs.getVirtualMachineName() + "] VM was successfully powered on. The taskId is: " +
          task.getValue(), "Failure: The [" + vmInputs.getVirtualMachineName() + "] VM could not be powered on.");
    } else {
      return ResponseUtils.getVmNotFoundResultsMap(vmInputs);
    }
  } catch (Exception ex) {
    return ResponseUtils.getResultsMap(ex.toString(), Outputs.RETURN_CODE_FAILURE);
  } finally {
    connectionResources.getConnection().disconnect();
  }
}
origin: io.cloudslang.content/score-vmware

/**
 * Method used to connect to specified data center and power-off virtual machine identified by the inputs provided.
 *
 * @param httpInputs Object that has all the inputs necessary to made a connection to data center
 * @param vmInputs   Object that has all the specific inputs necessary to identify the targeted virtual machine
 * @return Map with String as key and value that contains returnCode of the operation, success message with task id
 * of the execution or failure message and the exception if there is one
 * @throws Exception
 */
public Map<String, String> powerOffVM(HttpInputs httpInputs, VmInputs vmInputs) throws Exception {
  ConnectionResources connectionResources = new ConnectionResources(httpInputs, vmInputs);
  try {
    ManagedObjectReference vmMor = new MorObjectHandler().getVmMor(connectionResources,
        VmParameter.VIRTUAL_MACHINE.getValue(), vmInputs.getVirtualMachineName());
    if (vmMor != null) {
      ManagedObjectReference task = connectionResources.getVimPortType().powerOffVMTask(vmMor);
      return new ResponseHelper(connectionResources, task).getResultsMap("Success: The [" +
          vmInputs.getVirtualMachineName() + "] VM was successfully powered off. The taskId is: " +
          task.getValue(), "Failure: The [" + vmInputs.getVirtualMachineName() + "] VM could not be powered off.");
    } else {
      return ResponseUtils.getVmNotFoundResultsMap(vmInputs);
    }
  } catch (Exception ex) {
    return ResponseUtils.getResultsMap(ex.toString(), Outputs.RETURN_CODE_FAILURE);
  } finally {
    connectionResources.getConnection().disconnect();
  }
}
origin: io.cloudslang.content/score-vmware

/**
 * Method used to connect to specified data center and create a virtual machine using the inputs provided.
 *
 * @param httpInputs Object that has all the inputs necessary to made a connection to data center
 * @param vmInputs   Object that has all the specific inputs necessary to create a new virtual machine
 * @return Map with String as key and value that contains returnCode of the operation, success message with task id
 * of the execution or failure message and the exception if there is one
 * @throws Exception
 */
public Map<String, String> createVM(HttpInputs httpInputs, VmInputs vmInputs) throws Exception {
  ConnectionResources connectionResources = new ConnectionResources(httpInputs, vmInputs);
  try {
    VmUtils utils = new VmUtils();
    ManagedObjectReference vmFolderMor = utils.getMorFolder(vmInputs.getFolderName(), connectionResources);
    ManagedObjectReference resourcePoolMor = utils.getMorResourcePool(vmInputs.getResourcePool(), connectionResources);
    ManagedObjectReference hostMor = utils.getMorHost(vmInputs.getHostname(), connectionResources, null);
    VirtualMachineConfigSpec vmConfigSpec = new VmConfigSpecs().getVmConfigSpec(vmInputs, connectionResources);
    ManagedObjectReference task = connectionResources.getVimPortType()
        .createVMTask(vmFolderMor, vmConfigSpec, resourcePoolMor, hostMor);
    return new ResponseHelper(connectionResources, task).getResultsMap("Success: Created [" +
            vmInputs.getVirtualMachineName() + "] VM. The taskId is: " + task.getValue(),
        "Failure: Could not create [" + vmInputs.getVirtualMachineName() + "] VM");
  } catch (Exception ex) {
    return ResponseUtils.getResultsMap(ex.toString(), Outputs.RETURN_CODE_FAILURE);
  } finally {
    connectionResources.getConnection().disconnect();
  }
}
origin: io.cloudslang.content/score-vmware

      task.getValue(), "Failure: The [" + vmInputs.getVirtualMachineName() + "] VM could not be customized.");
} else {
  return ResponseUtils.getVmNotFoundResultsMap(vmInputs);
origin: io.cloudslang.content/score-vmware

      taskMor.getValue(), "Failure: The [" + vmInputs.getVirtualMachineName() + "] VM could not be cloned.");
} else {
  return ResponseUtils.getVmNotFoundResultsMap(vmInputs);
com.vmware.vim25ManagedObjectReferencegetValue

Javadoc

Gets the value of the value property.

Popular methods of ManagedObjectReference

  • <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
  • get_value
  • setVal
  • set_value

Popular in Java

  • Creating JSON documents from java classes using gson
  • setContentView (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • getSharedPreferences (Context)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • Menu (java.awt)
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Top Vim 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