Search in sources :

Example 6 with NoSuchKeyException

use of com.eightkdata.mongowp.exceptions.NoSuchKeyException in project torodb by torodb.

the class HandshakeReplSetUpdatePositionCommand method unmarshallArg.

@Override
public HandshakeArgument unmarshallArg(BsonDocument requestDoc) throws TypesMismatchException, NoSuchKeyException, BadValueException {
    BsonDocument doc = BsonReaderTool.getDocument(requestDoc, "handshake");
    HandshakeArgument result = super.unmarshallArg(doc);
    if (result.getMemberId() == null) {
        throw new NoSuchKeyException("replSetUpdatePosition handshake was missing 'member' field");
    }
    return result;
}
Also used : NoSuchKeyException(com.eightkdata.mongowp.exceptions.NoSuchKeyException) BsonDocument(com.eightkdata.mongowp.bson.BsonDocument)

Aggregations

BsonDocument (com.eightkdata.mongowp.bson.BsonDocument)6 NoSuchKeyException (com.eightkdata.mongowp.exceptions.NoSuchKeyException)6 BadValueException (com.eightkdata.mongowp.exceptions.BadValueException)4 TypesMismatchException (com.eightkdata.mongowp.exceptions.TypesMismatchException)4 BsonArray (com.eightkdata.mongowp.bson.BsonArray)2 BsonValue (com.eightkdata.mongowp.bson.BsonValue)2 BsonDocumentBuilder (com.eightkdata.mongowp.utils.BsonDocumentBuilder)2 OpTime (com.eightkdata.mongowp.OpTime)1 WriteConcern (com.eightkdata.mongowp.WriteConcern)1 MongoConnection (com.eightkdata.mongowp.client.core.MongoConnection)1 OplogOperationUnsupported (com.eightkdata.mongowp.exceptions.OplogOperationUnsupported)1 OplogStartMissingException (com.eightkdata.mongowp.exceptions.OplogStartMissingException)1 QueryOption (com.eightkdata.mongowp.messages.request.QueryMessage.QueryOption)1 QueryOptions (com.eightkdata.mongowp.messages.request.QueryMessage.QueryOptions)1 DbCmdOplogOperation (com.eightkdata.mongowp.server.api.oplog.DbCmdOplogOperation)1 DbOplogOperation (com.eightkdata.mongowp.server.api.oplog.DbOplogOperation)1 DeleteOplogOperation (com.eightkdata.mongowp.server.api.oplog.DeleteOplogOperation)1 InsertOplogOperation (com.eightkdata.mongowp.server.api.oplog.InsertOplogOperation)1 NoopOplogOperation (com.eightkdata.mongowp.server.api.oplog.NoopOplogOperation)1 OplogOperationType (com.eightkdata.mongowp.server.api.oplog.OplogOperationType)1