Package mungbean.protocol.bson

Examples of mungbean.protocol.bson.MapBSONCoders


import mungbean.protocol.bson.MapBSONCoders;

public class MapDBCollection extends AbstractDBCollection<Map<String, Object>> {

    public MapDBCollection(DBOperationExecutor executor, String dbName, String collectionName) {
        super(executor, dbName, collectionName, new MapBSONCoders(), new MapBSONCoders());
    }
View Full Code Here


        doc.putAll(options.build());
        collection.execute(new DBConversation<Void>() {
            @SuppressWarnings("unchecked")
            @Override
            public Void execute(Connection connection) {
                connection.execute(new InsertRequest<Map<String, Object>>(collection.dbName() + ".system.indexes", new MapBSONCoders(), doc));
                return null;
            }
        });
    }
View Full Code Here

public class PojoDBCollection<T> extends AbstractDBCollection<T> {
    private final Class<T> typeClass;

    public PojoDBCollection(DBOperationExecutor executor, String dbName, String collectionName, final Class<T> typeClass) {
        this(executor, dbName, collectionName, typeClass, new PojoBSONCoders<T>(typeClass), new MapBSONCoders());
    }
View Full Code Here

@RunWith(JDaveRunner.class)
public class GetMoreRequestSpec extends Specification<DBTransaction<QueryResponse<Map<String, Object>>>> {
    public class WithValidRequest {
        public DBTransaction<QueryResponse<Map<String, Object>>> create() {
            return new DBTransaction<QueryResponse<Map<String, Object>>>(new GetMoreRequest<Map<String, Object>>("foozbar.foo", 123123L, 0, new BSONMap(), new MapBSONCoders()), 127);
        }
View Full Code Here

@RunWith(JDaveRunner.class)
public class InsertRequestSpec extends Specification<DBTransaction<NoResponseExpected>> {
    public class WithValidRequest {
        @SuppressWarnings("unchecked")
        public DBTransaction<NoResponseExpected> create() {
            InsertRequest<Map<String, Object>> message = new InsertRequest<Map<String, Object>>("foozbar.foo", new MapBSONCoders(), map("foo", "bar"));
            return new DBTransaction<NoResponseExpected>(message, 123);
        }
View Full Code Here

@RunWith(JDaveRunner.class)
public class QueryRequestSpec extends Specification<DBTransaction<QueryResponse<Map<String, Object>>>> {

    public class WithoutQueryRules {
        public DBTransaction<QueryResponse<Map<String, Object>>> create() {
            QueryRequest<Map<String, Object>> message = new QueryRequest<Map<String, Object>>("foozbar.foo", new QueryOptionsBuilder(), new Query(), new MapBSONCoders(), new BSONMap());
            return new DBTransaction<QueryResponse<Map<String, Object>>>(message, 124);
        }
View Full Code Here

        }
    }

    public class WithQueryContaingingRules {
        public DBTransaction<QueryResponse<Map<String, Object>>> create() {
            QueryRequest<Map<String, Object>> message = new QueryRequest<Map<String, Object>>("foozbar.foo", new QueryOptionsBuilder().slaveOk(), new Query().setLimit(10).field("foo").is("bar"), new MapBSONCoders(), new BSONMap());
            return new DBTransaction<QueryResponse<Map<String, Object>>>(message, 124);
        }
View Full Code Here

                    'o', 'k', 0, // 'ok'
                    0, 0, 0, 0, 0, 0, -16, 63, // 1
                    0 // eoo
            };
            ListQueryCallback<Map<String, Object>> callback = new ListQueryCallback<Map<String, Object>>();
            QueryResponse<Map<String, Object>> response = new QueryResponse<Map<String, Object>>(new LittleEndianDataReader(new ByteArrayInputStream(bytes)), new BSONMap(), new MapBSONCoders());
            response.readResponse(callback);
            return callback.values();
        }
View Full Code Here

public class UpdateRequestSpec extends Specification<DBTransaction<NoResponseExpected>> {
    public class WithValidRequest {
        public DBTransaction<NoResponseExpected> create() {
            QueryBuilder selector = new Query().field("foo").is("bar");
            Map<String, Object> document = map("zoo", 5);
            return new DBTransaction<NoResponseExpected>(new UpdateRequest<Map<String, Object>>("foozbar.foo", selector, new UpdateOptionsBuilder(), document, new MapBSONCoders(), new MapBSONCoders()), 126);
        }
View Full Code Here

    public class WithStructuralUpdateRequest {
        @SuppressWarnings("unchecked")
        public DBTransaction<NoResponseExpected> create() {
            QueryBuilder selector = new Query().field("foo").is("bar");
      Map<String, Object> document = merge(map("zoo", "5"), map("list", list("1","2","3")));
            return new DBTransaction<NoResponseExpected>(new UpdateRequest<Map<String, Object>>("foozbar.foo", selector, new UpdateOptionsBuilder(), document, new MapBSONCoders(), new MapBSONCoders()), 126);
        }
View Full Code Here

TOP

Related Classes of mungbean.protocol.bson.MapBSONCoders

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.