Search in sources :

Example 1 with OperationParams

use of org.locationtech.geowave.core.cli.api.OperationParams in project geowave by locationtech.

the class GeoWaveGrpcCliGeoserverService method geoServerListStylesCommand.

@Override
public void geoServerListStylesCommand(final org.locationtech.geowave.service.grpc.protobuf.GeoServerListStylesCommandParametersProtos request, final StreamObserver<org.locationtech.geowave.service.grpc.protobuf.GeoWaveReturnTypesProtos.StringResponseProtos> responseObserver) {
    final GeoServerListStylesCommand cmd = new GeoServerListStylesCommand();
    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 GeoServerListStylesCommand...");
    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);
    }
}
Also used : GeoServerListStylesCommand(org.locationtech.geowave.cli.geoserver.style.GeoServerListStylesCommand) OperationParams(org.locationtech.geowave.core.cli.api.OperationParams) ManualOperationParams(org.locationtech.geowave.core.cli.parser.ManualOperationParams) StringResponseProtos(org.locationtech.geowave.service.grpc.protobuf.GeoWaveReturnTypesProtos.StringResponseProtos) 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)

Example 2 with OperationParams

use of org.locationtech.geowave.core.cli.api.OperationParams in project geowave by locationtech.

the class GeoWaveGrpcCliGeoserverService method geoServerAddStyleCommand.

@Override
public void geoServerAddStyleCommand(final org.locationtech.geowave.service.grpc.protobuf.GeoServerAddStyleCommandParametersProtos request, final StreamObserver<org.locationtech.geowave.service.grpc.protobuf.GeoWaveReturnTypesProtos.StringResponseProtos> responseObserver) {
    final GeoServerAddStyleCommand cmd = new GeoServerAddStyleCommand();
    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 GeoServerAddStyleCommand...");
    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);
    }
}
Also used : OperationParams(org.locationtech.geowave.core.cli.api.OperationParams) ManualOperationParams(org.locationtech.geowave.core.cli.parser.ManualOperationParams) GeoServerAddStyleCommand(org.locationtech.geowave.cli.geoserver.style.GeoServerAddStyleCommand) StringResponseProtos(org.locationtech.geowave.service.grpc.protobuf.GeoWaveReturnTypesProtos.StringResponseProtos) 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)

Example 3 with OperationParams

use of org.locationtech.geowave.core.cli.api.OperationParams in project geowave by locationtech.

the class GeoWaveGrpcCliGeoserverService method geoServerAddCoverageStoreCommand.

@Override
public void geoServerAddCoverageStoreCommand(final org.locationtech.geowave.service.grpc.protobuf.GeoServerAddCoverageStoreCommandParametersProtos request, final StreamObserver<org.locationtech.geowave.service.grpc.protobuf.GeoWaveReturnTypesProtos.StringResponseProtos> responseObserver) {
    final GeoServerAddCoverageStoreCommand cmd = new GeoServerAddCoverageStoreCommand();
    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 GeoServerAddCoverageStoreCommand...");
    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);
    }
}
Also used : OperationParams(org.locationtech.geowave.core.cli.api.OperationParams) ManualOperationParams(org.locationtech.geowave.core.cli.parser.ManualOperationParams) GeoServerAddCoverageStoreCommand(org.locationtech.geowave.cli.geoserver.cvstore.GeoServerAddCoverageStoreCommand) StringResponseProtos(org.locationtech.geowave.service.grpc.protobuf.GeoWaveReturnTypesProtos.StringResponseProtos) 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)

Example 4 with OperationParams

use of org.locationtech.geowave.core.cli.api.OperationParams 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);
    }
}
Also used : GeoServerListDatastoresCommand(org.locationtech.geowave.cli.geoserver.datastore.GeoServerListDatastoresCommand) OperationParams(org.locationtech.geowave.core.cli.api.OperationParams) ManualOperationParams(org.locationtech.geowave.core.cli.parser.ManualOperationParams) StringResponseProtos(org.locationtech.geowave.service.grpc.protobuf.GeoWaveReturnTypesProtos.StringResponseProtos) 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)

Example 5 with OperationParams

use of org.locationtech.geowave.core.cli.api.OperationParams in project geowave by locationtech.

the class GeoWaveGrpcCliGeoserverService method geoServerAddCoverageCommand.

@Override
public void geoServerAddCoverageCommand(final org.locationtech.geowave.service.grpc.protobuf.GeoServerAddCoverageCommandParametersProtos request, final StreamObserver<org.locationtech.geowave.service.grpc.protobuf.GeoWaveReturnTypesProtos.StringResponseProtos> responseObserver) {
    final GeoServerAddCoverageCommand cmd = new GeoServerAddCoverageCommand();
    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 GeoServerAddCoverageCommand...");
    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);
    }
}
Also used : GeoServerAddCoverageCommand(org.locationtech.geowave.cli.geoserver.coverage.GeoServerAddCoverageCommand) OperationParams(org.locationtech.geowave.core.cli.api.OperationParams) ManualOperationParams(org.locationtech.geowave.core.cli.parser.ManualOperationParams) StringResponseProtos(org.locationtech.geowave.service.grpc.protobuf.GeoWaveReturnTypesProtos.StringResponseProtos) 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

OperationParams (org.locationtech.geowave.core.cli.api.OperationParams)61 File (java.io.File)60 ManualOperationParams (org.locationtech.geowave.core.cli.parser.ManualOperationParams)58 FieldDescriptor (com.google.protobuf.Descriptors.FieldDescriptor)57 StringResponseProtos (org.locationtech.geowave.service.grpc.protobuf.GeoWaveReturnTypesProtos.StringResponseProtos)35 RepeatedStringResponseProtos (org.locationtech.geowave.service.grpc.protobuf.GeoWaveReturnTypesProtos.RepeatedStringResponseProtos)27 VoidResponseProtos (org.locationtech.geowave.service.grpc.protobuf.GeoWaveReturnTypesProtos.VoidResponseProtos)19 ParameterException (com.beust.jcommander.ParameterException)3 Parameters (com.beust.jcommander.Parameters)3 ArrayList (java.util.ArrayList)3 List (java.util.List)3 Map (java.util.Map)3 Parameter (com.beust.jcommander.Parameter)2 Arrays (java.util.Arrays)2 Collections (java.util.Collections)2 Iterator (java.util.Iterator)2 Properties (java.util.Properties)2 Collectors (java.util.stream.Collectors)2 GeowaveOperation (org.locationtech.geowave.core.cli.annotations.GeowaveOperation)2 LocalToMapReduceToGeoWaveCommand (org.locationtech.geowave.core.ingest.operations.LocalToMapReduceToGeoWaveCommand)2