com.vmware.vim25.mo.samples.SetHostTime.class Maven / Gradle / Ivy
The newest version!
???? 1 ? 'com/vmware/vim25/mo/samples/SetHostTime java/lang/Object ()V Code
LineNumberTable LocalVariableTable this )Lcom/vmware/vim25/mo/samples/SetHostTime; main ([Ljava/lang/String;)V
Exceptions java/lang/Exception java/lang/System out Ljava/io/PrintStream; >Usage: java SetHostTime
java/io/PrintStream println (Ljava/lang/String;)V " #com/vmware/vim25/mo/ServiceInstance $ java/net/URL
# &
! ( ) 6(Ljava/net/URL;Ljava/lang/String;Ljava/lang/String;Z)V
! + , -
getRootFolder ()Lcom/vmware/vim25/mo/Folder; / &com/vmware/vim25/mo/InventoryNavigator
. 1 2 &(Lcom/vmware/vim25/mo/ManagedEntity;)V 4
HostSystem
. 6 7 8 searchManagedEntity I(Ljava/lang/String;Ljava/lang/String;)Lcom/vmware/vim25/mo/ManagedEntity; : com/vmware/vim25/mo/HostSystem < java/lang/StringBuilder > Cannot find the host:
; &
; A B C append -(Ljava/lang/String;)Ljava/lang/StringBuilder;
; E F G toString ()Ljava/lang/String;
! I J K getServerConnection (()Lcom/vmware/vim25/mo/ServerConnection;
M O N $com/vmware/vim25/mo/ServerConnection P logout
9 R S T getHostDateTimeSystem *()Lcom/vmware/vim25/mo/HostDateTimeSystem;
V X W &com/vmware/vim25/mo/HostDateTimeSystem Y Z getDateTimeInfo %()Lcom/vmware/vim25/HostDateTimeInfo; \ The NTP Servers:
^ ` _ !com/vmware/vim25/HostDateTimeInfo a b getNtpConfig "()Lcom/vmware/vim25/HostNtpConfig;
d f e com/vmware/vim25/HostNtpConfig g h getServer ()[Ljava/lang/String; j Server[
; l B m (I)Ljava/lang/StringBuilder; o ]: q
Current Time Zone:
^ s t u getTimeZone /()Lcom/vmware/vim25/HostDateTimeSystemTimeZone; w Key:
y { z +com/vmware/vim25/HostDateTimeSystemTimeZone | G getKey ~ Name:
y ? ? G getName ?
GmtOffset:
y ? ? ? getGmtOffset ()I ? Description:
y ? ? G getDescription
! ? ? ? currentTime ()Ljava/util/Calendar; ?
Current time:
? ? ? java/util/Calendar ? ? getTime ()Ljava/util/Date;
; ? B ? -(Ljava/lang/Object;)Ljava/lang/StringBuilder;
? ? ? ? roll (IZ)V
V ? ? ? updateDateTime (Ljava/util/Calendar;)V ? Current time (after): args [Ljava/lang/String; si %Lcom/vmware/vim25/mo/ServiceInstance; hostname Ljava/lang/String;
rootFolder Lcom/vmware/vim25/mo/Folder; host Lcom/vmware/vim25/mo/HostSystem; hdts (Lcom/vmware/vim25/mo/HostDateTimeSystem; info #Lcom/vmware/vim25/HostDateTimeInfo; cfg Lcom/vmware/vim25/HostNtpConfig; svrs i I tz -Lcom/vmware/vim25/HostDateTimeSystemTimeZone; curTime Ljava/util/Calendar;
SourceFile SetHostTime.java ! / *? ?
1
? ?*?? ? ? ?? !Y? #Y*2? %*2*2? 'L*2M+? *N:? .Y-? 03,? 5? 9:? !? ? ;Y=? ?,? @? D? +? H? L?? Q:? U:? [? ? ]:? c:6 ? *? ? ;Yi? ? ? kn? @ 2? @? D? ? ? ???ϲ p? ? r: ? ? ;Yv? ? ? x? @? D? ? ? ;Y}? ? ? ? @? D? ? ? ;Y?? ? ? ?? k? D? ? ? ;Y?? ? ? ?? @? D? +? ?:
? ? ;Y?? ?
? ?? ?? D?
? ?
? ?+? ?:
? ? ;Y?? ?
? ?? ?? D?
? ?
? ?+? H? L?
? , 5 7 9 <