com.vmware.vim25.mo.samples.scheduling.OneTimeScheduledTask.class Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vijava Show documentation
Show all versions of vijava Show documentation
Java API for accessing VMWare web services API
The newest version!
???? 2 ? ;com/vmware/vim25/mo/samples/scheduling/OneTimeScheduledTask java/lang/Object ()V Code
LineNumberTable LocalVariableTable this =Lcom/vmware/vim25/mo/samples/scheduling/OneTimeScheduledTask; constructOptions (()[Lcom/vmware/vim25/mo/util/OptionSpec; #com/vmware/vim25/mo/util/OptionSpec vmname String Name of Virtual Machine
L(Ljava/lang/String;Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;)V taskname Name of the task to be scheduled useroptions &[Lcom/vmware/vim25/mo/util/OptionSpec; createSchedulerSpec L(Ljava/lang/String;Ljava/util/Calendar;)Lcom/vmware/vim25/ScheduledTaskSpec; $ com/vmware/vim25/MethodAction
# ' PowerOffVM_Task
# ) * + setName (Ljava/lang/String;)V - %com/vmware/vim25/MethodActionArgument
# / 0 1 setArgument +([Lcom/vmware/vim25/MethodActionArgument;)V
3 5 4 java/util/Calendar 6 7 add (II)V 9 "com/vmware/vim25/OnceTaskScheduler
8
8 < = > setRunAt (Ljava/util/Calendar;)V @ "com/vmware/vim25/ScheduledTaskSpec
?
? ) D PowerOff VM in 1 minutes
? F G + setDescription
? I J K
setEnabled (Z)V
? M N O setAction (Lcom/vmware/vim25/Action;)V
? Q R S setScheduler #(Lcom/vmware/vim25/TaskScheduler;)V taskName Ljava/lang/String; runTime Ljava/util/Calendar; action Lcom/vmware/vim25/MethodAction; scheduler $Lcom/vmware/vim25/OnceTaskScheduler; scheduleSpec $Lcom/vmware/vim25/ScheduledTaskSpec; main ([Ljava/lang/String;)V
Exceptions b java/lang/Exception d *com/vmware/vim25/mo/util/CommandLineParser
f
c h i <([Lcom/vmware/vim25/mo/util/OptionSpec;[Ljava/lang/String;)V k url
c m n o
get_option &(Ljava/lang/String;)Ljava/lang/String; q username s password u #com/vmware/vim25/mo/ServiceInstance w java/net/URL
v y +
t { | 6(Ljava/net/URL;Ljava/lang/String;Ljava/lang/String;Z)V
t ~ ?
getRootFolder ()Lcom/vmware/vim25/mo/Folder; ? &com/vmware/vim25/mo/InventoryNavigator
? ? ? &(Lcom/vmware/vim25/mo/ManagedEntity;)V ? VirtualMachine
? ? ? ? searchManagedEntity I(Ljava/lang/String;Ljava/lang/String;)Lcom/vmware/vim25/mo/ManagedEntity; ? "com/vmware/vim25/mo/VirtualMachine
t ? ? ? currentTime ()Ljava/util/Calendar;
? ! "
t ? ? ? getScheduledTaskManager ,()Lcom/vmware/vim25/mo/ScheduledTaskManager;
? ? ? (com/vmware/vim25/mo/ScheduledTaskManager ? ? createScheduledTask l(Lcom/vmware/vim25/mo/ManagedEntity;Lcom/vmware/vim25/ScheduledTaskSpec;)Lcom/vmware/vim25/mo/ScheduledTask; ? ? ? java/lang/System ? ? out Ljava/io/PrintStream; ? java/lang/StringBuilder ? Task:
? y
? ? ? ? append -(Ljava/lang/String;)Ljava/lang/StringBuilder; ? has been successfully added.
? ? ? ? toString ()Ljava/lang/String;
? ? ? java/io/PrintStream ? + println ? 4SchduledTaskManager is not available on this target.
t ? ? ? getServerConnection (()Lcom/vmware/vim25/mo/ServerConnection;
? ? ? $com/vmware/vim25/mo/ServerConnection ? logout args [Ljava/lang/String; clp ,Lcom/vmware/vim25/mo/util/CommandLineParser; urlStr si %Lcom/vmware/vim25/mo/ServiceInstance;
rootFolder Lcom/vmware/vim25/mo/Folder; vm $Lcom/vmware/vim25/mo/VirtualMachine; spec stm *Lcom/vmware/vim25/mo/ScheduledTaskManager;
StackMapTable ? ? java/lang/String ? com/vmware/vim25/mo/Folder
SourceFile OneTimeScheduledTask.java ! / *? ?
;
y +? K*? Y? S*? Y? S*?
*
? @ A B @ C " D $ E ( C ) F &