use of org.locationtech.geowave.cli.geoserver.datastore.GeoServerListDatastoresCommand in project geowave by locationtech.
the class GeoWaveGrpcCliGeoserverService method geoServerListDatastoresCommand.
@Override
public void geoServerListDatastoresCommand(final org.locationtech.geowave.service.grpc.protobuf.GeoServerListDatastoresCommandParametersProtos request, final StreamObserver<org.locationtech.geowave.service.grpc.protobuf.GeoWaveReturnTypesProtos.StringResponseProtos> responseObserver) {
final GeoServerListDatastoresCommand cmd = new GeoServerListDatastoresCommand();
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 GeoServerListDatastoresCommand...");
try {
final String result = cmd.computeResults(params);
final StringResponseProtos resp = StringResponseProtos.newBuilder().setResponseValue(result).build();
responseObserver.onNext(resp);
responseObserver.onCompleted();
} catch (final Exception e) {
LOGGER.error("Exception encountered executing command", e);
responseObserver.onError(e);
}
}
Aggregations