use of org.roguewave.grpc.util.gfx.DrawIndex in project grpc-gcp-java by GoogleCloudPlatform.
the class GetIndex method getIndexCall.
public void getIndexCall() {
System.out.println("\n :: Getting an Index :: \n");
FirestoreAdminBlockingStub blockingStub = new GRPCFirebaseAdminClientFactory().createFirebaseAdminClient().getBlockingStub();
Scanner sc = new Scanner(System.in);
System.out.print("Enter Index Name: ");
String indexName = "projects/firestoretestclient/databases/(default)/indexes/" + sc.next();
GetIndexRequest getIndexRequest = GetIndexRequest.newBuilder().setName(indexName).build();
Index index;
try {
index = blockingStub.getIndex(getIndexRequest);
} catch (Exception e) {
System.out.println("Error during call: " + e.getMessage() + e.getCause());
return;
}
DrawIndex di = new DrawIndex();
di.drawIndex(index);
Menu menu = new Menu();
menu.draw();
}
use of org.roguewave.grpc.util.gfx.DrawIndex in project grpc-gcp-java by GoogleCloudPlatform.
the class ListIndexes method listIndexesCall.
public void listIndexesCall() {
System.out.println(":: Listing All Indexes ::");
FirestoreAdminBlockingStub blockingStub = new GRPCFirebaseAdminClientFactory().createFirebaseAdminClient().getBlockingStub();
ListIndexesRequest listIndexesRequest = ListIndexesRequest.newBuilder().setParent("projects/firestoretestclient/databases/(default)").build();
ListIndexesResponse response;
try {
response = blockingStub.listIndexes(listIndexesRequest);
} catch (Exception e) {
System.out.println("Error during call: " + e.getMessage() + e.getCause());
return;
}
List<Index> indexList = response.getIndexesList();
DrawIndex di = new DrawIndex();
for (Index index : indexList) {
di.drawIndex(index);
}
Menu menu = new Menu();
menu.draw();
}
Aggregations