Search in sources :

Example 1 with RepeatedStringResponseProtos

use of org.locationtech.geowave.service.grpc.protobuf.GeoWaveReturnTypesProtos.RepeatedStringResponseProtos in project geowave by locationtech.

the class GeoWaveGrpcCliGeoserverService method geoServerGetStoreAdapterCommand.

@Override
public void geoServerGetStoreAdapterCommand(final org.locationtech.geowave.service.grpc.protobuf.GeoServerGetStoreAdapterCommandParametersProtos request, final StreamObserver<org.locationtech.geowave.service.grpc.protobuf.GeoWaveReturnTypesProtos.RepeatedStringResponseProtos> responseObserver) {
    final GeoServerGetStoreAdapterCommand cmd = new GeoServerGetStoreAdapterCommand();
    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 GeoServerGetStoreAdapterCommand...");
    try {
        final List<String> result = cmd.computeResults(params);
        final RepeatedStringResponseProtos resp = RepeatedStringResponseProtos.newBuilder().addAllResponseValue(result).build();
        responseObserver.onNext(resp);
        responseObserver.onCompleted();
    } catch (final Exception e) {
        LOGGER.error("Exception encountered executing command", e);
        responseObserver.onError(e);
    }
}
Also used : OperationParams(org.locationtech.geowave.core.cli.api.OperationParams) ManualOperationParams(org.locationtech.geowave.core.cli.parser.ManualOperationParams) RepeatedStringResponseProtos(org.locationtech.geowave.service.grpc.protobuf.GeoWaveReturnTypesProtos.RepeatedStringResponseProtos) File(java.io.File) GeoServerGetStoreAdapterCommand(org.locationtech.geowave.cli.geoserver.datastore.GeoServerGetStoreAdapterCommand) FieldDescriptor(com.google.protobuf.Descriptors.FieldDescriptor) ManualOperationParams(org.locationtech.geowave.core.cli.parser.ManualOperationParams)

Example 2 with RepeatedStringResponseProtos

use of org.locationtech.geowave.service.grpc.protobuf.GeoWaveReturnTypesProtos.RepeatedStringResponseProtos in project geowave by locationtech.

the class GeoWaveGrpcCliGeoserverService method geoServerListWorkspacesCommand.

@Override
public void geoServerListWorkspacesCommand(final org.locationtech.geowave.service.grpc.protobuf.GeoServerListWorkspacesCommandParametersProtos request, final StreamObserver<org.locationtech.geowave.service.grpc.protobuf.GeoWaveReturnTypesProtos.RepeatedStringResponseProtos> responseObserver) {
    final GeoServerListWorkspacesCommand cmd = new GeoServerListWorkspacesCommand();
    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 GeoServerListWorkspacesCommand...");
    try {
        final List<String> result = cmd.computeResults(params);
        final RepeatedStringResponseProtos resp = RepeatedStringResponseProtos.newBuilder().addAllResponseValue(result).build();
        responseObserver.onNext(resp);
        responseObserver.onCompleted();
    } catch (final Exception e) {
        LOGGER.error("Exception encountered executing command", e);
        responseObserver.onError(e);
    }
}
Also used : OperationParams(org.locationtech.geowave.core.cli.api.OperationParams) ManualOperationParams(org.locationtech.geowave.core.cli.parser.ManualOperationParams) GeoServerListWorkspacesCommand(org.locationtech.geowave.cli.geoserver.workspace.GeoServerListWorkspacesCommand) RepeatedStringResponseProtos(org.locationtech.geowave.service.grpc.protobuf.GeoWaveReturnTypesProtos.RepeatedStringResponseProtos) File(java.io.File) FieldDescriptor(com.google.protobuf.Descriptors.FieldDescriptor) ManualOperationParams(org.locationtech.geowave.core.cli.parser.ManualOperationParams)

Aggregations

FieldDescriptor (com.google.protobuf.Descriptors.FieldDescriptor)2 File (java.io.File)2 OperationParams (org.locationtech.geowave.core.cli.api.OperationParams)2 ManualOperationParams (org.locationtech.geowave.core.cli.parser.ManualOperationParams)2 RepeatedStringResponseProtos (org.locationtech.geowave.service.grpc.protobuf.GeoWaveReturnTypesProtos.RepeatedStringResponseProtos)2 GeoServerGetStoreAdapterCommand (org.locationtech.geowave.cli.geoserver.datastore.GeoServerGetStoreAdapterCommand)1 GeoServerListWorkspacesCommand (org.locationtech.geowave.cli.geoserver.workspace.GeoServerListWorkspacesCommand)1