Package org.glassfish.appclient.client

Examples of org.glassfish.appclient.client.CLIBootstrap$ValuedOption$OptionValue


    private static void configNvpExtraOption(List<OptionValue> extraOptions, VirtualMachineTO vmSpec) {
        /**
         * Extra Config : nvp.vm-uuid = uuid
         *  - Required for Nicira NVP integration
         */
        OptionValue newVal = new OptionValue();
        newVal.setKey("nvp.vm-uuid");
        newVal.setValue(vmSpec.getUuid());
        extraOptions.add(newVal);

        /**
         * Extra Config : nvp.iface-id.<num> = uuid
         *  - Required for Nicira NVP integration
         */
        int nicNum = 0;
        for (NicTO nicTo : sortNicsByDeviceId(vmSpec.getNics())) {
            if (nicTo.getUuid() != null) {
                newVal = new OptionValue();
                newVal.setKey("nvp.iface-id." + nicNum);
                newVal.setValue(nicTo.getUuid());
                extraOptions.add(newVal);
            }
            nicNum++;
        }
    }
View Full Code Here


    }

    private static void configCustomExtraOption(List<OptionValue> extraOptions, VirtualMachineTO vmSpec) {
        // we no longer to validation anymore
        for(Map.Entry<String, String> entry : vmSpec.getDetails().entrySet()) {
            OptionValue newVal = new OptionValue();
            newVal.setKey(entry.getKey());
            newVal.setValue(entry.getValue());
            extraOptions.add(newVal);
        }
    }
View Full Code Here

  }


  public void vncDeActivateVm(VirtualMachine newVm) throws InvalidName, VmConfigFault, DuplicateName, TaskInProgress, FileFault, InvalidState, ConcurrentAccess, InvalidDatastore, InsufficientResourcesFault, RuntimeFault, RemoteException, InterruptedException {
    OptionValue currentExtraConfig[]=newVm.getConfig().getExtraConfig();

    //Remove extra config
    // http://communities.vmware.com/message/1229409
   
    OptionValue newExtraConfig[];
   
    //determine the number of RemoteDisplay flags
    int counter=0;
   
   
    for (int i=0; i <currentExtraConfig.length;  i++)
    {
      if (currentExtraConfig[i].getKey().startsWith("RemoteDisplay.vnc")) {
        counter++;
      }
//      System.out.println(currentExtraConfig[i].getKey());
    }

    newExtraConfig=new OptionValue[currentExtraConfig.length-counter];

    int newcounter=0;
    for (int i=0; i <currentExtraConfig.length;  i++)
    {
      if (!currentExtraConfig[i].getKey().startsWith("RemoteDisplay.vnc")) {
        newExtraConfig[newcounter]=currentExtraConfig[i];
//        System.out.println(newExtraConfig[newcounter].getKey());

        newcounter++;
      }
    }


    OptionValue vnc1=new OptionValue() ;vnc1.setKey("RemoteDisplay.vnc.enabled");vnc1.setValue("FALSE");
    OptionValue vnc2=new OptionValue() ;vnc2.setKey("RemoteDisplay.vnc.password");vnc2.setValue("");
    OptionValue vnc3=new OptionValue() ;vnc3.setKey("RemoteDisplay.vnc.port");vnc3.setValue("0");
    OptionValue vnc4=new OptionValue() ;vnc4.setKey("RemoteDisplay.vnc.key");vnc4.setValue("");

    OptionValue[] extraConfig= { vnc1, vnc2, vnc3, vnc4 };

    VirtualMachineConfigSpec vmConfigSpec2 = new VirtualMachineConfigSpec();
    vmConfigSpec2.setExtraConfig(extraConfig);
View Full Code Here

    // Extraconfig gebruik : http://sourceforge.net/projects/vijava/forums/forum/826592/topic/3756870?message=8491628
    //     RemoteDisplay.vnc.enabled = "TRUE"
    //     RemoteDisplay.vnc.password = "your_password"
    //     RemoteDisplay.vnc.port = "5900"

    OptionValue vnc1=new OptionValue() ;vnc1.setKey("RemoteDisplay.vnc.enabled");vnc1.setValue("TRUE");
    OptionValue vnc2=new OptionValue() ;vnc2.setKey("RemoteDisplay.vnc.password");vnc2.setValue(vncPassword);
    OptionValue vnc3=new OptionValue() ;vnc3.setKey("RemoteDisplay.vnc.port");vnc3.setValue(String.valueOf(vncPort));
    OptionValue[] extraConfig= { vnc1, vnc2, vnc3 };

    // Need to get the old extraconfig + add new stuff
   
    // Default VNC is not enabled in ESX
View Full Code Here

        }

        if (!nicName.toLowerCase().equals(interfaceName.toLowerCase())) {
          if (nicType=="e1000") {
            System.err.println("Disabling pxe on "+nicName+"-"+interfaceName);
            OptionValue nicSpec=new OptionValue() ;nicSpec.setKey("ethernet"+(e1000Counter-1)+".opromsize");nicSpec.setValue("0");
            extraConfig.add(nicSpec);

          }
         
          //Spec -> ethernet<counter-1>.opromsize=0
         
        } else {
         
        }

      }
    }

    OptionValue optionConfig[]= extraConfig.toArray(new OptionValue[1]);
   
    vmConfigSpec.setExtraConfig(optionConfig);


    Task pxetask =   vm.reconfigVM_Task(vmConfigSpec);
View Full Code Here

    //bios.bootDeviceClasses
    //http://download3.vmware.com/sample_code/Perl/VMBootOrder.html
    // "allow:cd,hd,net"
   
    OptionValue bootOptions=new OptionValue() ;bootOptions.setKey("bios.bootDeviceClasses");bootOptions.setValue(order);
    OptionValue[] bootOptionsConfig= bootOptions };

    VirtualMachineConfigSpec vmConfigSpec = new VirtualMachineConfigSpec();
    vmConfigSpec.setExtraConfig(bootOptionsConfig);
View Full Code Here

TOP

Related Classes of org.glassfish.appclient.client.CLIBootstrap$ValuedOption$OptionValue

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.