use of org.locationtech.geowave.service.grpc.protobuf.GeoWaveReturnTypesProtos.MapStringStringResponseProtos in project geowave by locationtech.
the class GeoWaveGrpcCoreCliService method listCommand.
@Override
public void listCommand(final org.locationtech.geowave.service.grpc.protobuf.ListCommandParametersProtos request, final StreamObserver<org.locationtech.geowave.service.grpc.protobuf.GeoWaveReturnTypesProtos.MapStringStringResponseProtos> responseObserver) {
final ListCommand cmd = new ListCommand();
final Map<FieldDescriptor, Object> m = request.getAllFields();
GeoWaveGrpcServiceCommandUtil.setGrpcToCommandFields(m, cmd);
final File configFile = GeoWaveGrpcServiceOptions.geowaveConfigFile;
final OperationParams params = new ManualOperationParams();
params.getContext().put(ConfigOptions.PROPERTIES_FILE_CONTEXT, configFile);
cmd.prepare(params);
LOGGER.info("Executing ListCommand...");
try {
final Map<String, String> post_result = new HashMap<>();
final Map<String, Object> result = cmd.computeResults(params);
final Iterator<Entry<String, Object>> it = result.entrySet().iterator();
while (it.hasNext()) {
final Map.Entry<String, Object> pair = it.next();
post_result.put(pair.getKey().toString(), pair.getValue().toString());
}
final MapStringStringResponseProtos resp = MapStringStringResponseProtos.newBuilder().putAllResponseValue(post_result).build();
responseObserver.onNext(resp);
responseObserver.onCompleted();
} catch (final Exception e) {
LOGGER.error("Exception encountered executing command", e);
responseObserver.onError(e);
}
}
use of org.locationtech.geowave.service.grpc.protobuf.GeoWaveReturnTypesProtos.MapStringStringResponseProtos in project geowave by locationtech.
the class GeoWaveGrpcTestClient method listCommand.
public Map<String, String> listCommand() {
final ListCommandParametersProtos request = ListCommandParametersProtos.newBuilder().build();
final MapStringStringResponseProtos response = coreCliBlockingStub.listCommand(request);
final Map<String, String> map = response.getResponseValueMap();
return map;
}
Aggregations