Search in sources :

Example 21 with NotNull

use of javax.validation.constraints.NotNull in project graphhopper by graphhopper.

the class IsochroneResource method doGet.

@GET
@Produces(MediaType.APPLICATION_JSON)
public Response doGet(@Context UriInfo uriInfo, @QueryParam("profile") String profileName, @QueryParam("buckets") @Range(min = 1, max = 20) @DefaultValue("1") IntParam nBuckets, @QueryParam("reverse_flow") @DefaultValue("false") boolean reverseFlow, @QueryParam("point") @NotNull GHPointParam point, @QueryParam("time_limit") @DefaultValue("600") LongParam timeLimitInSeconds, @QueryParam("distance_limit") @DefaultValue("-1") LongParam distanceLimitInMeter, @QueryParam("weight_limit") @DefaultValue("-1") LongParam weightLimit, @QueryParam("type") @DefaultValue("json") ResponseType respType, @QueryParam("tolerance") @DefaultValue("0") double toleranceInMeter, @QueryParam("full_geometry") @DefaultValue("false") boolean fullGeometry) {
    StopWatch sw = new StopWatch().start();
    PMap hintsMap = new PMap();
    RouteResource.initHints(hintsMap, uriInfo.getQueryParameters());
    hintsMap.putObject(Parameters.CH.DISABLE, true);
    hintsMap.putObject(Parameters.Landmark.DISABLE, true);
    if (Helper.isEmpty(profileName)) {
        profileName = profileResolver.resolveProfile(hintsMap).getName();
        removeLegacyParameters(hintsMap);
    }
    errorIfLegacyParameters(hintsMap);
    Profile profile = graphHopper.getProfile(profileName);
    if (profile == null)
        throw new IllegalArgumentException("The requested profile '" + profileName + "' does not exist");
    LocationIndex locationIndex = graphHopper.getLocationIndex();
    Graph graph = graphHopper.getGraphHopperStorage();
    Weighting weighting = graphHopper.createWeighting(profile, hintsMap);
    BooleanEncodedValue inSubnetworkEnc = graphHopper.getEncodingManager().getBooleanEncodedValue(Subnetwork.key(profileName));
    if (hintsMap.has(Parameters.Routing.BLOCK_AREA)) {
        GraphEdgeIdFinder.BlockArea blockArea = GraphEdgeIdFinder.createBlockArea(graph, locationIndex, Collections.singletonList(point.get()), hintsMap, new FiniteWeightFilter(weighting));
        weighting = new BlockAreaWeighting(weighting, blockArea);
    }
    Snap snap = locationIndex.findClosest(point.get().lat, point.get().lon, new DefaultSnapFilter(weighting, inSubnetworkEnc));
    if (!snap.isValid())
        throw new IllegalArgumentException("Point not found:" + point);
    QueryGraph queryGraph = QueryGraph.create(graph, snap);
    TraversalMode traversalMode = profile.isTurnCosts() ? EDGE_BASED : NODE_BASED;
    ShortestPathTree shortestPathTree = new ShortestPathTree(queryGraph, queryGraph.wrapWeighting(weighting), reverseFlow, traversalMode);
    double limit;
    if (weightLimit.get() > 0) {
        limit = weightLimit.get();
        shortestPathTree.setWeightLimit(limit + Math.max(limit * 0.14, 2_000));
    } else if (distanceLimitInMeter.get() > 0) {
        limit = distanceLimitInMeter.get();
        shortestPathTree.setDistanceLimit(limit + Math.max(limit * 0.14, 2_000));
    } else {
        limit = timeLimitInSeconds.get() * 1000;
        shortestPathTree.setTimeLimit(limit + Math.max(limit * 0.14, 200_000));
    }
    ArrayList<Double> zs = new ArrayList<>();
    double delta = limit / nBuckets.get();
    for (int i = 0; i < nBuckets.get(); i++) {
        zs.add((i + 1) * delta);
    }
    ToDoubleFunction<ShortestPathTree.IsoLabel> fz;
    if (weightLimit.get() > 0) {
        fz = l -> l.weight;
    } else if (distanceLimitInMeter.get() > 0) {
        fz = l -> l.distance;
    } else {
        fz = l -> l.time;
    }
    Triangulator.Result result = triangulator.triangulate(snap, queryGraph, shortestPathTree, fz, degreesFromMeters(toleranceInMeter));
    ContourBuilder contourBuilder = new ContourBuilder(result.triangulation);
    ArrayList<Geometry> isochrones = new ArrayList<>();
    for (Double z : zs) {
        logger.info("Building contour z={}", z);
        MultiPolygon isochrone = contourBuilder.computeIsoline(z, result.seedEdges);
        if (fullGeometry) {
            isochrones.add(isochrone);
        } else {
            Polygon maxPolygon = heuristicallyFindMainConnectedComponent(isochrone, isochrone.getFactory().createPoint(new Coordinate(point.get().lon, point.get().lat)));
            isochrones.add(isochrone.getFactory().createPolygon(((LinearRing) maxPolygon.getExteriorRing())));
        }
    }
    ArrayList<JsonFeature> features = new ArrayList<>();
    for (Geometry isochrone : isochrones) {
        JsonFeature feature = new JsonFeature();
        HashMap<String, Object> properties = new HashMap<>();
        properties.put("bucket", features.size());
        if (respType == geojson) {
            properties.put("copyrights", ResponsePathSerializer.COPYRIGHTS);
        }
        feature.setProperties(properties);
        feature.setGeometry(isochrone);
        features.add(feature);
    }
    ObjectNode json = JsonNodeFactory.instance.objectNode();
    sw.stop();
    ObjectNode finalJson = null;
    if (respType == geojson) {
        json.put("type", "FeatureCollection");
        json.putPOJO("features", features);
        finalJson = json;
    } else {
        json.putPOJO("polygons", features);
        final ObjectNode info = json.putObject("info");
        info.putPOJO("copyrights", ResponsePathSerializer.COPYRIGHTS);
        info.put("took", Math.round((float) sw.getMillis()));
        finalJson = json;
    }
    logger.info("took: " + sw.getSeconds() + ", visited nodes:" + shortestPathTree.getVisitedNodes());
    return Response.ok(finalJson).header("X-GH-Took", "" + sw.getSeconds() * 1000).build();
}
Also used : ProfileResolver(com.graphhopper.routing.ProfileResolver) LoggerFactory(org.slf4j.LoggerFactory) Subnetwork(com.graphhopper.routing.ev.Subnetwork) HashMap(java.util.HashMap) ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) ArrayList(java.util.ArrayList) Range(org.hibernate.validator.constraints.Range) Inject(javax.inject.Inject) MediaType(javax.ws.rs.core.MediaType) ShortestPathTree(com.graphhopper.isochrone.algorithm.ShortestPathTree) BlockAreaWeighting(com.graphhopper.routing.weighting.BlockAreaWeighting) IntParam(io.dropwizard.jersey.params.IntParam) Profile(com.graphhopper.config.Profile) TraversalMode(com.graphhopper.routing.util.TraversalMode) Graph(com.graphhopper.storage.Graph) NODE_BASED(com.graphhopper.routing.util.TraversalMode.NODE_BASED) GraphHopper(com.graphhopper.GraphHopper) org.locationtech.jts.geom(org.locationtech.jts.geom) com.graphhopper.util(com.graphhopper.util) Logger(org.slf4j.Logger) Context(javax.ws.rs.core.Context) ResponsePathSerializer(com.graphhopper.jackson.ResponsePathSerializer) LocationIndex(com.graphhopper.storage.index.LocationIndex) RouteResource.errorIfLegacyParameters(com.graphhopper.resources.RouteResource.errorIfLegacyParameters) LongParam(io.dropwizard.jersey.params.LongParam) BooleanEncodedValue(com.graphhopper.routing.ev.BooleanEncodedValue) NotNull(javax.validation.constraints.NotNull) ResponseType.geojson(com.graphhopper.resources.IsochroneResource.ResponseType.geojson) QueryGraph(com.graphhopper.routing.querygraph.QueryGraph) GHPointParam(com.graphhopper.http.GHPointParam) GraphEdgeIdFinder(com.graphhopper.storage.GraphEdgeIdFinder) Triangulator(com.graphhopper.isochrone.algorithm.Triangulator) ContourBuilder(com.graphhopper.isochrone.algorithm.ContourBuilder) javax.ws.rs(javax.ws.rs) Response(javax.ws.rs.core.Response) JsonNodeFactory(com.fasterxml.jackson.databind.node.JsonNodeFactory) Weighting(com.graphhopper.routing.weighting.Weighting) ToDoubleFunction(java.util.function.ToDoubleFunction) FiniteWeightFilter(com.graphhopper.routing.util.FiniteWeightFilter) DefaultSnapFilter(com.graphhopper.routing.util.DefaultSnapFilter) Snap(com.graphhopper.storage.index.Snap) UriInfo(javax.ws.rs.core.UriInfo) EDGE_BASED(com.graphhopper.routing.util.TraversalMode.EDGE_BASED) Collections(java.util.Collections) RouteResource.removeLegacyParameters(com.graphhopper.resources.RouteResource.removeLegacyParameters) GraphEdgeIdFinder(com.graphhopper.storage.GraphEdgeIdFinder) Triangulator(com.graphhopper.isochrone.algorithm.Triangulator) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) BlockAreaWeighting(com.graphhopper.routing.weighting.BlockAreaWeighting) TraversalMode(com.graphhopper.routing.util.TraversalMode) Snap(com.graphhopper.storage.index.Snap) Profile(com.graphhopper.config.Profile) FiniteWeightFilter(com.graphhopper.routing.util.FiniteWeightFilter) ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) DefaultSnapFilter(com.graphhopper.routing.util.DefaultSnapFilter) LocationIndex(com.graphhopper.storage.index.LocationIndex) Graph(com.graphhopper.storage.Graph) QueryGraph(com.graphhopper.routing.querygraph.QueryGraph) BlockAreaWeighting(com.graphhopper.routing.weighting.BlockAreaWeighting) Weighting(com.graphhopper.routing.weighting.Weighting) BooleanEncodedValue(com.graphhopper.routing.ev.BooleanEncodedValue) ContourBuilder(com.graphhopper.isochrone.algorithm.ContourBuilder) ShortestPathTree(com.graphhopper.isochrone.algorithm.ShortestPathTree) QueryGraph(com.graphhopper.routing.querygraph.QueryGraph)

Example 22 with NotNull

use of javax.validation.constraints.NotNull in project blueocean-plugin by jenkinsci.

the class GitRepositoryRule method createBranches.

@NotNull
public List<Ref> createBranches(@NotNull String prefix, int number) throws GitAPIException {
    List<Ref> refs = new ArrayList<>();
    for (int i = 1; i < number + 1; i++) {
        Ref ref = client.branchCreate().setName(prefix + i).call();
        refs.add(ref);
    }
    logger.info("Created " + number + " branches " + prefix + "[1-" + (number + 1) + "]");
    return refs;
}
Also used : Ref(org.eclipse.jgit.lib.Ref) ArrayList(java.util.ArrayList) NotNull(javax.validation.constraints.NotNull)

Example 23 with NotNull

use of javax.validation.constraints.NotNull in project graylog2-server by Graylog2.

the class SidecarResource method assignConfiguration.

@PUT
@Timed
@Path("/configurations")
@ApiOperation(value = "Assign configurations to sidecars")
@RequiresPermissions(SidecarRestPermissions.SIDECARS_UPDATE)
@AuditEvent(type = SidecarAuditEventTypes.SIDECAR_UPDATE)
public Response assignConfiguration(@ApiParam(name = "JSON body", required = true) @Valid @NotNull NodeConfigurationRequest request) throws NotFoundException {
    List<String> nodeIdList = request.nodes().stream().filter(distinctByKey(NodeConfiguration::nodeId)).map(NodeConfiguration::nodeId).collect(Collectors.toList());
    for (String nodeId : nodeIdList) {
        List<ConfigurationAssignment> nodeRelations = request.nodes().stream().filter(a -> a.nodeId().equals(nodeId)).flatMap(a -> a.assignments().stream()).collect(Collectors.toList());
        try {
            Sidecar sidecar = sidecarService.assignConfiguration(nodeId, nodeRelations);
            sidecarService.save(sidecar);
        } catch (org.graylog2.database.NotFoundException e) {
            throw new NotFoundException(e.getMessage());
        }
    }
    return Response.accepted().build();
}
Also used : DateTimeZone(org.joda.time.DateTimeZone) CollectorActions(org.graylog.plugins.sidecar.rest.models.CollectorActions) Produces(javax.ws.rs.Produces) SidecarService(org.graylog.plugins.sidecar.services.SidecarService) Path(javax.ws.rs.Path) ApiParam(io.swagger.annotations.ApiParam) NodeConfiguration(org.graylog.plugins.sidecar.rest.models.NodeConfiguration) Valid(javax.validation.Valid) ApiOperation(io.swagger.annotations.ApiOperation) PaginatedList(org.graylog2.database.PaginatedList) MediaType(javax.ws.rs.core.MediaType) QueryParam(javax.ws.rs.QueryParam) SidecarConfiguration(org.graylog.plugins.sidecar.system.SidecarConfiguration) ClusterConfigService(org.graylog2.plugin.cluster.ClusterConfigService) Consumes(javax.ws.rs.Consumes) SearchQueryField(org.graylog2.search.SearchQueryField) Map(java.util.Map) PluginRestResource(org.graylog2.plugin.rest.PluginRestResource) DefaultValue(javax.ws.rs.DefaultValue) HeaderParam(javax.ws.rs.HeaderParam) BadRequestException(javax.ws.rs.BadRequestException) NoAuditEvent(org.graylog2.audit.jersey.NoAuditEvent) Function(com.google.common.base.Function) ImmutableMap(com.google.common.collect.ImmutableMap) Predicate(java.util.function.Predicate) CollectorAction(org.graylog.plugins.sidecar.rest.models.CollectorAction) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) NotNull(javax.validation.constraints.NotNull) Collectors(java.util.stream.Collectors) NotFoundException(javax.ws.rs.NotFoundException) Timed(com.codahale.metrics.annotation.Timed) RegistrationRequest(org.graylog.plugins.sidecar.rest.requests.RegistrationRequest) List(java.util.List) SidecarSummary(org.graylog.plugins.sidecar.rest.models.SidecarSummary) Response(javax.ws.rs.core.Response) RequiresAuthentication(org.apache.shiro.authz.annotation.RequiresAuthentication) ConfigurationAssignment(org.graylog.plugins.sidecar.rest.requests.ConfigurationAssignment) PathParam(javax.ws.rs.PathParam) Sidecar(org.graylog.plugins.sidecar.rest.models.Sidecar) SearchQueryParser(org.graylog2.search.SearchQueryParser) GET(javax.ws.rs.GET) SidecarRegistrationConfiguration(org.graylog.plugins.sidecar.rest.models.SidecarRegistrationConfiguration) NodeConfigurationRequest(org.graylog.plugins.sidecar.rest.requests.NodeConfigurationRequest) ApiResponses(io.swagger.annotations.ApiResponses) Inject(javax.inject.Inject) RequiresPermissions(org.apache.shiro.authz.annotation.RequiresPermissions) RegistrationResponse(org.graylog.plugins.sidecar.rest.responses.RegistrationResponse) AuditEvent(org.graylog2.audit.jersey.AuditEvent) Api(io.swagger.annotations.Api) SidecarRestPermissions(org.graylog.plugins.sidecar.permissions.SidecarRestPermissions) SearchQuery(org.graylog2.search.SearchQuery) ActiveSidecarFilter(org.graylog.plugins.sidecar.filter.ActiveSidecarFilter) DateTime(org.joda.time.DateTime) SidecarAuditEventTypes(org.graylog.plugins.sidecar.audit.SidecarAuditEventTypes) RestResource(org.graylog2.shared.rest.resources.RestResource) SidecarListResponse(org.graylog.plugins.sidecar.rest.responses.SidecarListResponse) ActionService(org.graylog.plugins.sidecar.services.ActionService) ApiResponse(io.swagger.annotations.ApiResponse) NotEmpty(org.hibernate.validator.constraints.NotEmpty) PUT(javax.ws.rs.PUT) SidecarStatusMapper(org.graylog.plugins.sidecar.mapper.SidecarStatusMapper) ConfigurationAssignment(org.graylog.plugins.sidecar.rest.requests.ConfigurationAssignment) NotFoundException(javax.ws.rs.NotFoundException) Sidecar(org.graylog.plugins.sidecar.rest.models.Sidecar) Path(javax.ws.rs.Path) RequiresPermissions(org.apache.shiro.authz.annotation.RequiresPermissions) Timed(com.codahale.metrics.annotation.Timed) ApiOperation(io.swagger.annotations.ApiOperation) NoAuditEvent(org.graylog2.audit.jersey.NoAuditEvent) AuditEvent(org.graylog2.audit.jersey.AuditEvent) PUT(javax.ws.rs.PUT)

Example 24 with NotNull

use of javax.validation.constraints.NotNull in project graylog2-server by Graylog2.

the class AdministrationResource method administration.

@POST
@Timed
@ApiOperation(value = "Lists existing Sidecar registrations including compatible sidecars using pagination")
@RequiresPermissions({ SidecarRestPermissions.SIDECARS_READ, SidecarRestPermissions.COLLECTORS_READ, SidecarRestPermissions.CONFIGURATIONS_READ })
@NoAuditEvent("this is not changing any data")
public SidecarListResponse administration(@ApiParam(name = "JSON body", required = true) @Valid @NotNull AdministrationRequest request) {
    final String sort = Sidecar.FIELD_NODE_NAME;
    final String order = "asc";
    final String mappedQuery = sidecarStatusMapper.replaceStringStatusSearchQuery(request.query());
    SearchQuery searchQuery;
    try {
        searchQuery = searchQueryParser.parse(mappedQuery);
    } catch (IllegalArgumentException e) {
        throw new BadRequestException("Invalid argument in search query: " + e.getMessage());
    }
    final long total = sidecarService.count();
    final Optional<Predicate<Sidecar>> filters = administrationFiltersFactory.getFilters(request.filters());
    final List<Collector> collectors = getCollectors(request.filters());
    final PaginatedList<Sidecar> sidecars = sidecarService.findPaginated(searchQuery, filters.orElse(null), request.page(), request.perPage(), sort, order);
    final List<SidecarSummary> sidecarSummaries = sidecarService.toSummaryList(sidecars, activeSidecarFilter);
    final List<SidecarSummary> summariesWithCollectors = sidecarSummaries.stream().map(collector -> {
        final List<String> compatibleCollectors = collectors.stream().filter(c -> c.nodeOperatingSystem().equalsIgnoreCase(collector.nodeDetails().operatingSystem())).map(Collector::id).collect(Collectors.toList());
        return collector.toBuilder().collectors(compatibleCollectors).build();
    }).filter(collectorSummary -> !filters.isPresent() || collectorSummary.collectors().size() > 0).collect(Collectors.toList());
    return SidecarListResponse.create(request.query(), sidecars.pagination(), total, false, sort, order, summariesWithCollectors, request.filters());
}
Also used : SearchQuery(org.graylog2.search.SearchQuery) CollectorActions(org.graylog.plugins.sidecar.rest.models.CollectorActions) Produces(javax.ws.rs.Produces) SidecarService(org.graylog.plugins.sidecar.services.SidecarService) Path(javax.ws.rs.Path) ApiParam(io.swagger.annotations.ApiParam) Configuration(org.graylog.plugins.sidecar.rest.models.Configuration) Valid(javax.validation.Valid) ApiOperation(io.swagger.annotations.ApiOperation) PaginatedList(org.graylog2.database.PaginatedList) AdministrationFilter(org.graylog.plugins.sidecar.filter.AdministrationFilter) MediaType(javax.ws.rs.core.MediaType) CollectorService(org.graylog.plugins.sidecar.services.CollectorService) SidecarConfiguration(org.graylog.plugins.sidecar.system.SidecarConfiguration) ClusterConfigService(org.graylog2.plugin.cluster.ClusterConfigService) Consumes(javax.ws.rs.Consumes) Locale(java.util.Locale) Map(java.util.Map) PluginRestResource(org.graylog2.plugin.rest.PluginRestResource) BadRequestException(javax.ws.rs.BadRequestException) NoAuditEvent(org.graylog2.audit.jersey.NoAuditEvent) Predicate(java.util.function.Predicate) CollectorAction(org.graylog.plugins.sidecar.rest.models.CollectorAction) NotNull(javax.validation.constraints.NotNull) Collectors(java.util.stream.Collectors) BulkActionRequest(org.graylog.plugins.sidecar.rest.requests.BulkActionRequest) Timed(com.codahale.metrics.annotation.Timed) List(java.util.List) SidecarSummary(org.graylog.plugins.sidecar.rest.models.SidecarSummary) Response(javax.ws.rs.core.Response) BulkActionsRequest(org.graylog.plugins.sidecar.rest.requests.BulkActionsRequest) Optional(java.util.Optional) RequiresAuthentication(org.apache.shiro.authz.annotation.RequiresAuthentication) ConfigurationService(org.graylog.plugins.sidecar.services.ConfigurationService) Sidecar(org.graylog.plugins.sidecar.rest.models.Sidecar) SearchQueryParser(org.graylog2.search.SearchQueryParser) ApiResponses(io.swagger.annotations.ApiResponses) ArrayList(java.util.ArrayList) Inject(javax.inject.Inject) RequiresPermissions(org.apache.shiro.authz.annotation.RequiresPermissions) ImmutableList(com.google.common.collect.ImmutableList) AdministrationFiltersFactory(org.graylog.plugins.sidecar.filter.AdministrationFiltersFactory) AuditEvent(org.graylog2.audit.jersey.AuditEvent) Api(io.swagger.annotations.Api) SidecarRestPermissions(org.graylog.plugins.sidecar.permissions.SidecarRestPermissions) SearchQuery(org.graylog2.search.SearchQuery) AdministrationRequest(org.graylog.plugins.sidecar.rest.requests.AdministrationRequest) POST(javax.ws.rs.POST) ActiveSidecarFilter(org.graylog.plugins.sidecar.filter.ActiveSidecarFilter) SidecarAuditEventTypes(org.graylog.plugins.sidecar.audit.SidecarAuditEventTypes) RestResource(org.graylog2.shared.rest.resources.RestResource) SidecarListResponse(org.graylog.plugins.sidecar.rest.responses.SidecarListResponse) ActionService(org.graylog.plugins.sidecar.services.ActionService) ApiResponse(io.swagger.annotations.ApiResponse) Collector(org.graylog.plugins.sidecar.rest.models.Collector) PUT(javax.ws.rs.PUT) SidecarStatusMapper(org.graylog.plugins.sidecar.mapper.SidecarStatusMapper) Predicate(java.util.function.Predicate) SidecarSummary(org.graylog.plugins.sidecar.rest.models.SidecarSummary) Collector(org.graylog.plugins.sidecar.rest.models.Collector) BadRequestException(javax.ws.rs.BadRequestException) Sidecar(org.graylog.plugins.sidecar.rest.models.Sidecar) RequiresPermissions(org.apache.shiro.authz.annotation.RequiresPermissions) POST(javax.ws.rs.POST) Timed(com.codahale.metrics.annotation.Timed) ApiOperation(io.swagger.annotations.ApiOperation) NoAuditEvent(org.graylog2.audit.jersey.NoAuditEvent)

Example 25 with NotNull

use of javax.validation.constraints.NotNull in project graylog2-server by Graylog2.

the class PipelineResource method parse.

@ApiOperation(value = "Parse a processing pipeline without saving it")
@POST
@Path("/parse")
@NoAuditEvent("only used to parse a pipeline, no changes made in the system")
public PipelineSource parse(@ApiParam(name = "pipeline", required = true) @NotNull PipelineSource pipelineSource) throws ParseException {
    final Pipeline pipeline;
    try {
        pipeline = pipelineRuleParser.parsePipeline(pipelineSource.id(), pipelineSource.source());
    } catch (ParseException e) {
        throw new BadRequestException(Response.status(Response.Status.BAD_REQUEST).entity(e.getErrors()).build());
    }
    final DateTime now = DateTime.now(DateTimeZone.UTC);
    return PipelineSource.builder().title(pipeline.name()).description(pipelineSource.description()).source(pipelineSource.source()).stages(pipeline.stages().stream().map(stage -> StageSource.create(stage.stage(), stage.match(), stage.ruleReferences())).collect(Collectors.toList())).createdAt(now).modifiedAt(now).build();
}
Also used : DateTimeZone(org.joda.time.DateTimeZone) PathParam(javax.ws.rs.PathParam) Produces(javax.ws.rs.Produces) SearchQueryParser(org.graylog2.search.SearchQueryParser) GET(javax.ws.rs.GET) ParseException(org.graylog.plugins.pipelineprocessor.parser.ParseException) LoggerFactory(org.slf4j.LoggerFactory) Path(javax.ws.rs.Path) ApiParam(io.swagger.annotations.ApiParam) ArrayList(java.util.ArrayList) Inject(javax.inject.Inject) ApiOperation(io.swagger.annotations.ApiOperation) PaginatedList(org.graylog2.database.PaginatedList) RequiresPermissions(org.apache.shiro.authz.annotation.RequiresPermissions) MediaType(javax.ws.rs.core.MediaType) Lists(com.google.common.collect.Lists) QueryParam(javax.ws.rs.QueryParam) PipelineService(org.graylog.plugins.pipelineprocessor.db.PipelineService) Consumes(javax.ws.rs.Consumes) SearchQueryField(org.graylog2.search.SearchQueryField) AuditEvent(org.graylog2.audit.jersey.AuditEvent) PluginRestResource(org.graylog2.plugin.rest.PluginRestResource) DefaultValue(javax.ws.rs.DefaultValue) PipelineRuleParser(org.graylog.plugins.pipelineprocessor.parser.PipelineRuleParser) BadRequestException(javax.ws.rs.BadRequestException) Api(io.swagger.annotations.Api) SearchQuery(org.graylog2.search.SearchQuery) NotFoundException(org.graylog2.database.NotFoundException) DELETE(javax.ws.rs.DELETE) NoAuditEvent(org.graylog2.audit.jersey.NoAuditEvent) Pipeline(org.graylog.plugins.pipelineprocessor.ast.Pipeline) Logger(org.slf4j.Logger) POST(javax.ws.rs.POST) ImmutableMap(com.google.common.collect.ImmutableMap) Predicate(java.util.function.Predicate) Collection(java.util.Collection) DateTime(org.joda.time.DateTime) RestResource(org.graylog2.shared.rest.resources.RestResource) PipelineDao(org.graylog.plugins.pipelineprocessor.db.PipelineDao) NotNull(javax.validation.constraints.NotNull) PipelineProcessorAuditEventTypes(org.graylog.plugins.pipelineprocessor.audit.PipelineProcessorAuditEventTypes) Collectors(java.util.stream.Collectors) List(java.util.List) Response(javax.ws.rs.core.Response) PaginatedPipelineService(org.graylog.plugins.pipelineprocessor.db.PaginatedPipelineService) PUT(javax.ws.rs.PUT) PaginatedResponse(org.graylog2.rest.models.PaginatedResponse) RequiresAuthentication(org.apache.shiro.authz.annotation.RequiresAuthentication) BadRequestException(javax.ws.rs.BadRequestException) ParseException(org.graylog.plugins.pipelineprocessor.parser.ParseException) DateTime(org.joda.time.DateTime) Pipeline(org.graylog.plugins.pipelineprocessor.ast.Pipeline) Path(javax.ws.rs.Path) POST(javax.ws.rs.POST) ApiOperation(io.swagger.annotations.ApiOperation) NoAuditEvent(org.graylog2.audit.jersey.NoAuditEvent)

Aggregations

NotNull (javax.validation.constraints.NotNull)76 List (java.util.List)24 Map (java.util.Map)18 Collectors (java.util.stream.Collectors)15 Inject (javax.inject.Inject)15 Logger (org.slf4j.Logger)14 ArrayList (java.util.ArrayList)13 LoggerFactory (org.slf4j.LoggerFactory)13 HashMap (java.util.HashMap)11 Set (java.util.Set)10 Optional (java.util.Optional)9 Response (javax.ws.rs.core.Response)9 Strings (com.google.common.base.Strings)8 Lists (com.google.common.collect.Lists)8 Api (io.swagger.annotations.Api)7 ApiParam (io.swagger.annotations.ApiParam)7 IOException (java.io.IOException)7 Collection (java.util.Collection)7 Nullable (javax.annotation.Nullable)7 Valid (javax.validation.Valid)7