Package com.vmware.vim.binding.vmodl

Examples of com.vmware.vim.binding.vmodl.ManagedObjectReference


         HttpClientConfiguration clientConfig =
               HttpClientConfiguration.Factory.newInstance();
         clientConfig.setHttpConfiguration(httpConfig);
         vmomiClient = Client.Factory.createClient(uri, version, clientConfig);

         ManagedObjectReference svcRef = new ManagedObjectReference();
         svcRef.setType("ServiceInstance");
         svcRef.setValue("ServiceInstance");

         ServiceInstance instance =
               vmomiClient.createStub(ServiceInstance.class, svcRef);
         ServiceInstanceContent instanceContent = instance.retrieveContent();
         SessionManager sessionManager =
View Full Code Here


         task = finishedEventChains.get(event.getChainId());
      }
      /* Now check pseudo-tasks. */
      if (task == null) {
         VcEventType vcEventType = VcEventType.getInstance(event);
         ManagedObjectReference moRef = null;
         if (event instanceof VmEvent && event.getVm() != null) {
            moRef = event.getVm().getVm();
            pTask = removePseudoTask(vcEventType, moRef);
         } else if (event instanceof ResourcePoolEvent) {
            ResourcePoolEvent rpEvent = (ResourcePoolEvent)event;
View Full Code Here

         IVcPseudoTaskBody obj) throws Exception {
      AuAssert.check(eventType != null);
      AuAssert.check(VcContext.isInTaskSession());
      VcPseudoTask task = pseudoTaskStarted(name, eventType, moRef);
      Profiler.inc(StatsType.VC_TASK_EXEC, task.getName());
      ManagedObjectReference res = null;
      try {
         res = obj.body();
      } catch (Exception e) {
         /**
          * Assume that if task execution triggered an exception, we will
View Full Code Here

       * @return boolean   true for aurora tasks
       * @throws Exception
       */
      public boolean eventHandler(VcEventType type, Event taskEvent) throws Exception {
         TaskFinishedEvent event = (TaskFinishedEvent)taskEvent;
         ManagedObjectReference taskMoRef = event.getTaskMoRef();
         VcTask task = taskFinished(taskMoRef);

         if (task == null) {
            /* Repeat the check with the write lock. */
            rwLock.writeLock().lock();
View Full Code Here

    * A handler for TaskUpdateProgress pseudo-event.
    */
   public class VcTaskUpdateProgressHandler implements IVcEventHandler {
      public boolean eventHandler(VcEventType type, Event e) throws Exception {
         TaskUpdateProgressEvent taskEvent = (TaskUpdateProgressEvent)e;
         ManagedObjectReference taskMoRef = taskEvent.getTaskMoRef();
         synchronized(VcTaskMgr.this) {
            VcTask task = pendingTasks.get(taskMoRef);
            if (task != null) {
               logger.info("task: " + task.getMoRef() + " progress: " + taskEvent.getProgress());
               task.setProgress(taskEvent.getProgress());
View Full Code Here

      VmEventArgument ea = Mockito.mock(VmEventArgument.class);
      Mockito.when(e.getVm()).thenReturn(ea);

      Mockito.when(ea.getVm()).thenAnswer(new Answer<ManagedObjectReference>() {
         public ManagedObjectReference answer(InvocationOnMock invocation) throws Throwable {
            ManagedObjectReference moRef = Mockito.mock(ManagedObjectReference.class);
            Mockito.when(moRef.getServerGuid()).thenReturn(null);
            Mockito.when(moRef.getType()).thenReturn("VirtualMachine");
            Mockito.when(moRef.getValue()).thenReturn(id);

            System.out.println("processed event " + id);
            return (ManagedObjectReference) moRef;
         }
      });
View Full Code Here

    */
   static public VcVirtualMachine
   importVm(String name, VcResourcePool rp, VcDatastore ds,
            VcNetwork network, String ovfPath)
   throws Exception {
      ManagedObjectReference vmRef;
      AuAssert.check(VcContext.isInTaskSession());
      VcService vcs = VcContext.getService();

      CreateImportSpecParams importParams = new CreateImportSpecParamsImpl();
      importParams.setDeploymentOption("");
View Full Code Here

         return;
      }
      // Event can be either VmEvent or EventEx (TODO: Explicitly check for
      // VM specific EventEx class usage? e.g. VcEventType.VmAppHealthChanged?)
      AuAssert.check(e instanceof VmEvent || e instanceof EventEx);
      ManagedObjectReference moRef = e.getVm().getVm();
      String moId = MoUtil.morefToString(moRef);
      String externalStr = external ? " external" : "";
      logger.debug("processed" + externalStr + " vm event: " + e);
      if (external) {
         if (processExternalEvent(type, e, moId)) {
View Full Code Here

TOP

Related Classes of com.vmware.vim.binding.vmodl.ManagedObjectReference

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.