Package org.graylog2.database

Examples of org.graylog2.database.NotFoundException


    @Override
    public StreamRule load(ObjectId id) throws NotFoundException {
        BasicDBObject o = (BasicDBObject) get(StreamRuleImpl.class, id);

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

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


    @Override
    public Output load(String streamOutputId) throws NotFoundException {
        DBObject o = get(OutputImpl.class, streamOutputId);

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

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

    @Override
    public Input find(String id) throws NotFoundException {
        final DBObject o = get(org.graylog2.inputs.InputImpl.class, id);
        if (o == null) {
            throw new NotFoundException("Input <" + id + "> not found!");
        }
        return new org.graylog2.inputs.InputImpl((ObjectId) o.get("_id"), o.toMap());
    }
View Full Code Here

                new BasicDBObject("_id", new ObjectId(id)),
                new BasicDBObject("$or", radioIdOrGlobal));

        final DBObject o = findOne(InputImpl.class, new BasicDBObject("$and", query));
        if (o == null) {
            throw new NotFoundException();
        } else {
            return new InputImpl((ObjectId) o.get("_id"), o.toMap());
        }
    }
View Full Code Here

                new BasicDBObject("_id", new ObjectId(id)),
                new BasicDBObject("$and", forThisNode));

        final DBObject o = findOne(InputImpl.class, new BasicDBObject("$and", query));
        if (o == null) {
            throw new NotFoundException();
        } else {
            return new InputImpl((ObjectId) o.get("_id"), o.toMap());
        }
    }
View Full Code Here

                new BasicDBObject(MessageInput.FIELD_RADIO_ID, radioId),
                QueryBuilder.start(MessageInput.FIELD_GLOBAL).in(list).get());

        final DBObject o = findOne(InputImpl.class, new BasicDBObject("$and", query));
        if (o == null) {
            throw new NotFoundException();
        } else {
            return new InputImpl((ObjectId) o.get("_id"), o.toMap());
        }
    }
View Full Code Here

    @Override
    public IndexRange get(String index) throws NotFoundException {
        DBObject dbo = findOne(IndexRangeImpl.class, new BasicDBObject("index", index));

        if (dbo == null)
            throw new NotFoundException("Index " + index + " not found.");

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

    @SuppressWarnings("unchecked")
    public SavedSearchImpl load(String id) throws NotFoundException {
        BasicDBObject o = (BasicDBObject) get(SavedSearchImpl.class, id);

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

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

        final StreamRule streamRule;
        try {
            streamRule = streamRuleService.load(loadObjectId(streamRuleId));
            if (!streamRule.getStreamId().equals(streamid)) {
                throw new NotFoundException();
            }
        } catch (org.graylog2.database.NotFoundException e) {
            throw new javax.ws.rs.NotFoundException(e);
        }
View Full Code Here

        try {
            StreamRule streamRule = streamRuleService.load(loadObjectId(streamRuleId));
            if (streamRule.getStreamId().equals(streamid)) {
                streamRuleService.destroy(streamRule);
            } else {
                throw new NotFoundException();
            }
        } catch (org.graylog2.database.NotFoundException e) {
            throw new javax.ws.rs.NotFoundException("Stream rule <" + streamRuleId + "> 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.