Package org.graylog2.database

Examples of org.graylog2.database.NotFoundException


    @Path("/{radioId}")
    @ApiResponses(value = {
            @ApiResponse(code = 404, message = "Radio not found.")
    })
    public String radio(@ApiParam(name = "radioId", required = true) @PathParam("radioId") String radioId) {
        Node radio = null;
        try {
            radio = nodeService.byNodeId(radioId);
        } catch (NodeNotFoundException e) {
            LOG.error("Radio <{}> not found.", radioId);
            throw new WebApplicationException(404);
View Full Code Here


            @ApiResponse(code = 404, message = "Radio not found."),
            @ApiResponse(code = 400, message = "Missing or invalid configuration")
    })
    public Response registerInput(@ApiParam(name = "JSON body", required = true) String body,
                                @ApiParam(name = "radioId", required = true) @PathParam("radioId") String radioId) {
        Node radio = null;
        try {
            radio = nodeService.byNodeId(radioId);
        } catch (NodeNotFoundException e) {
            LOG.error("Radio <{}> not found.", radioId);
            throw new WebApplicationException(404);
View Full Code Here

    @ApiResponses(value = {
            @ApiResponse(code = 404, message = "Radio not found.")
    })
    public Response unregisterInput(@ApiParam(name = "radioId", required = true) @PathParam("radioId") String radioId,
                                    @ApiParam(name = "inputId", required = true) @PathParam("inputId") String inputId) {
        final Node radio;
        try {
            radio = nodeService.byNodeId(radioId);
        } catch (NodeNotFoundException e) {
            LOG.error("Radio <{}> not found.", radioId);
            throw new NotFoundException("Radio <" + radioId + "> not found.");
View Full Code Here

    @Path("/{radioId}/inputs")
    @ApiResponses(value = {
            @ApiResponse(code = 404, message = "Radio not found.")
    })
    public String persistedInputs(@ApiParam(name = "radioId", required = true) @PathParam("radioId") String radioId) {
        Node radio = null;
        Map<String, Object> result = Maps.newHashMap();
        List<Map<String, Object>> inputs = Lists.newArrayList();
        try {
            radio = nodeService.byNodeId(radioId);
        } catch (NodeNotFoundException e) {
View Full Code Here

            throw new WebApplicationException(e, Response.Status.BAD_REQUEST);
        }

        LOG.debug("Ping from graylog2-radio node [{}].", radioId);

        Node node = null;
        try {
            node = nodeService.byNodeId(radioId);
        } catch (NodeNotFoundException e) {
            LOG.debug("There is no registered (or only outdated) graylog2-radio node [{}]. Registering.", radioId);
        }
View Full Code Here

    @Override
    public Dashboard load(String id) throws NotFoundException {
        BasicDBObject o = (BasicDBObject) get(DashboardImpl.class, id);

        if (o == null) {
            throw new NotFoundException();
        }

        return new DashboardImpl((ObjectId) o.get("_id"), o.toMap());
    }
View Full Code Here

    @Override
    public FilterDescription load(String filterId) throws NotFoundException {
        final FilterDescription filter = dbCollection.findOneById(new ObjectId(filterId));

        if (filter == null) {
            throw new NotFoundException();
        }
        return filter;
    }
View Full Code Here

    public ConfigurationBundle load(final String bundleId) throws NotFoundException {
        final ConfigurationBundle bundle = dbCollection.findOneById(new ObjectId(bundleId));

        if (bundle == null) {
            throw new NotFoundException();
        }

        return bundle;
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    public Stream load(ObjectId id) throws NotFoundException {
        DBObject o = get(StreamImpl.class, id);

        if (o == null) {
            throw new NotFoundException("Stream <" + id + "> not found!");
        }

        List<StreamRule> streamRules = streamRuleService.loadForStreamId(id.toHexString());

        Set<Output> outputs = loadOutputsForRawStream(o);
View Full Code Here

    public Stream load(String id) throws NotFoundException {
        try {
            return load(new ObjectId(id));
        } catch (IllegalArgumentException e) {
            throw new NotFoundException("Stream <" + id + "> not found!");
        }
    }
View Full Code Here

TOP

Related Classes of org.graylog2.database.NotFoundException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.