com.vmware.vim25.mo.samples.security.CreateRole.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/security/CreateRole java/lang/Object ()V Code
LineNumberTable LocalVariableTable this 1Lcom/vmware/vim25/mo/samples/security/CreateRole; main ([Ljava/lang/String;)V
Exceptions java/lang/Exception java/lang/System out Ljava/io/PrintStream; 2Usage: java CreateRole
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
! + , - getAuthorizationManager ,()Lcom/vmware/vim25/mo/AuthorizationManager; / master1 1 java/lang/String 3 System.View 5 System.Read 7 System.Anonymous 9 Global.LogEvent
; = < (com/vmware/vim25/mo/AuthorizationManager > ? addAuthorizationRole ((Ljava/lang/String;[Ljava/lang/String;)I A master C Global.Diagnostics E
Folder.Create
; G H I updateAuthorizationRole )(ILjava/lang/String;[Ljava/lang/String;)V K java/lang/StringBuilder M The new role ID:
J &
J P Q R append (I)Ljava/lang/StringBuilder;
J T U V toString ()Ljava/lang/String; X com/vmware/vim25/Permission
W
W [ \ ] setGroup (Z)V _ vimaster
W a b setPrincipal
W d e ] setPropagate
W g h i setRoleId (I)V
! k l m
getRootFolder ()Lcom/vmware/vim25/mo/Folder;
; o p q setEntityPermissions D(Lcom/vmware/vim25/mo/ManagedEntity;[Lcom/vmware/vim25/Permission;)V
; s t u retrieveEntityPermissions D(Lcom/vmware/vim25/mo/ManagedEntity;Z)[Lcom/vmware/vim25/Permission; w print the permissions on root:
y z { printPermissions !([Lcom/vmware/vim25/Permission;)V
! } ~ getServerConnection (()Lcom/vmware/vim25/mo/ServerConnection;
? ? ? $com/vmware/vim25/mo/ServerConnection ? logout args [Ljava/lang/String; si %Lcom/vmware/vim25/mo/ServiceInstance; am *Lcom/vmware/vim25/mo/AuthorizationManager; roleId I perm Lcom/vmware/vim25/Permission; ps [Lcom/vmware/vim25/Permission;
StackMapTable ?
Entity:
W ? ? ? getEntity +()Lcom/vmware/vim25/ManagedObjectReference;
? ? ? 'com/vmware/vim25/ManagedObjectReference ? V getType
J ? Q ? -(Ljava/lang/String;)Ljava/lang/StringBuilder; ? :
? ? ? V get_value ? IsGroup:
W ? ? ? isGroup ()Z
J ? Q ? (Z)Ljava/lang/StringBuilder; ?
Principal:
W ? ? V getPrincipal ? Propogated:
W ? ? ? isPropagate ? RoleId:
W ? ? ? getRoleId ()I i
SourceFile CreateRole.java ! / *? ?
+
? ?*?? ? ? ?? !Y? #Y*2? %*2*2? 'L+? *M,.? 0Y2SY4SY6SY8S? :>,@? 0Y2SY4SY6SY8SYBSYDS? F? ? JYL? N? O? S? ? WY? Y:? Z^? `? c? f,+? j? WYS? n,+? j? r:? v? ? x+? |? ??
? " / 1 3 6 7 $ 6 ( 9 - ; 0 <