Examples of toMap()


Examples of com.mongodb.BasicDBObject.toMap()

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

        return new StreamRuleImpl((ObjectId) o.get("_id"), o.toMap());
    }

    @Override
    public List<StreamRule> loadForStream(Stream stream) throws NotFoundException {
        return loadForStreamId(stream.getId());
View Full Code Here

Examples of com.mongodb.BasicDBObject.toMap()

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

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

Examples of com.mongodb.DBObject.toMap()

  public Map<String, Object> extractEntityTuple(SessionFactory sessionFactory, EntityKey key) {
    MongoDBDatastoreProvider provider = MongoDBTestHelper.getProvider( sessionFactory );
    DBObject finder = new BasicDBObject( MongoDBDialect.ID_FIELDNAME, key.getColumnValues()[0] );
    DBObject result = provider.getDatabase().getCollection( key.getTable() ).findOne( finder );
    replaceIdentifierColumnName( result, key );
    return result.toMap();
  }

  /**
   * The MongoDB dialect replaces the name of the column identifier, so when the tuple is extracted from the db
   * we replace the column name of the identifier with the original one.
View Full Code Here

Examples of com.mongodb.DBObject.toMap()

                    "Graylog2 does not yet support multiple LDAP backends, but {} configurations were found. This is a bug, ignoring LDAP config.",
                    results.size());
            return null;
        }
        final DBObject settingsObject = results.get(0);
        return ldapSettingsFactory.create((ObjectId) settingsObject.get("_id"), settingsObject.toMap());
    }

    @Override
    public void delete() {
        DBObject query = new BasicDBObject();
View Full Code Here

Examples of com.mongodb.DBObject.toMap()

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

        Set<Output> outputs = loadOutputsForRawStream(o);

        return new StreamImpl((ObjectId) o.get("_id"), o.toMap(), streamRules, outputs);
    }

    @Override
    public Stream create(Map<String, Object> fields) {
        return new StreamImpl(fields);
View Full Code Here

Examples of com.mongodb.DBObject.toMap()

    }

    @Override
    public AlarmCallbackConfiguration load(String alarmCallbackId) {
        DBObject rawModel = get(AlarmCallbackConfigurationImpl.class, alarmCallbackId);
        return (rawModel == null ? null : new AlarmCallbackConfigurationImpl((ObjectId) (rawModel.get("_id")), rawModel.toMap()));
    }

    @Override
    public AlarmCallbackConfiguration create(String streamId, CreateAlarmCallbackRequest request, String userId) {
        Map<String, Object> fields = Maps.newHashMap();
View Full Code Here

Examples of com.mongodb.DBObject.toMap()

        if (o == null || !o.containsField("node_id")) {
            throw new NodeNotFoundException("Unable to find node " + nodeId);
        }

        return new NodeImpl((ObjectId) o.get("_id"), o.toMap());
    }

    @Override
    public Node byNodeId(NodeId nodeId) throws NodeNotFoundException {
        return byNodeId(nodeId.toString());
View Full Code Here

Examples of com.mongodb.DBObject.toMap()

    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());
    }

    @Override
    public Input findForThisNodeOrGlobal(String nodeId, String id) throws NotFoundException {
        final List<BasicDBObject> forThisNodeOrGlobal = ImmutableList.of(
View Full Code Here

Examples of com.mongodb.DBObject.toMap()

        final List<BasicDBObject> query = ImmutableList.of(
                new BasicDBObject("_id", new ObjectId(id)),
                new BasicDBObject("$or", forThisNodeOrGlobal));

        final DBObject o = findOne(InputImpl.class, new BasicDBObject("$and", query));
        return new InputImpl((ObjectId) o.get("_id"), o.toMap());
    }

    @Override
    public Input findForThisRadioOrGlobal(final String radioId, String id) throws NotFoundException {
        final List<DBObject> radioIdOrGlobal = ImmutableList.<DBObject>of(
View Full Code Here

Examples of com.mongodb.DBObject.toMap()

        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());
        }
    }

    @Override
    public Input findForThisNode(String nodeId, String id) throws NotFoundException, IllegalArgumentException {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.