11package org .example ;
22
33import com .aserto .ChannelBuilder ;
4- import com .aserto .directory .v3 .DirectoryClient ;
54import com .aserto .directory .common .v3 .ObjectIdentifier ;
65import com .aserto .directory .reader .v3 .GetObjectManyResponse ;
76import com .aserto .directory .reader .v3 .GetObjectResponse ;
87import com .aserto .directory .reader .v3 .GetObjectsResponse ;
8+ import com .aserto .directory .v3 .DirectoryClient ;
9+
910import com .aserto .directory .v3 .Directory ;
11+ import com .aserto .directory .v3 .UninitilizedClientException ;
1012import io .grpc .ManagedChannel ;
1113
1214import javax .net .ssl .SSLException ;
1315import java .util .List ;
1416
1517public class DirectoryExample {
16- public static void main (String [] args ) throws SSLException {
18+ public static void main (String [] args ) throws SSLException , UninitilizedClientException {
1719 // create a channel that has the connection details
1820 ManagedChannel channel = new ChannelBuilder ()
1921 .withHost ("localhost" )
@@ -29,19 +31,19 @@ public static void main(String[] args) throws SSLException {
2931 getObjectManyRequest (directoryClient );
3032 }
3133
32- public static void getUserExample (DirectoryClient directoryClient ) {
34+ public static void getUserExample (DirectoryClient directoryClient ) throws UninitilizedClientException {
3335 System .out .println ("------ Get user example ------" );
3436 GetObjectResponse getObjectResponse =
directoryClient .
getObject (
"user" ,
"[email protected] " ,
false );
3537 System .out .println (getObjectResponse );
3638 }
3739
38- public static void getUsersExample (DirectoryClient directoryClient ) {
40+ public static void getUsersExample (DirectoryClient directoryClient ) throws UninitilizedClientException {
3941 System .out .println ("------ Get users example ------" );
4042 GetObjectsResponse getObjectsResponse = directoryClient .getObjects ("user" , 100 , "" );
4143 System .out .println (getObjectsResponse );
4244 }
4345
44- public static void getObjectManyRequest (DirectoryClient directoryClient ) {
46+ public static void getObjectManyRequest (DirectoryClient directoryClient ) throws UninitilizedClientException {
4547 System .out .println ("------ Get object many example ------" );
4648 List <ObjectIdentifier > objects = List .of (
4749 Directory .
buildObjectIdentifier (
"user" ,
"[email protected] " ),
0 commit comments