use of com.yahoo.documentapi.messagebus.protocol.UpdateDocumentReply in project vespa by vespa-engine.
the class MessageBusSyncSession method update.
@Override
public boolean update(DocumentUpdate update, DocumentProtocol.Priority pri) {
UpdateDocumentMessage msg = new UpdateDocumentMessage(update);
msg.setPriority(pri);
Reply reply = syncSend(msg);
if (reply.hasErrors()) {
throw new DocumentAccessException(MessageBusAsyncSession.getErrorMessage(reply), reply.getErrorCodes());
}
if (reply.getType() != DocumentProtocol.REPLY_UPDATEDOCUMENT) {
throw new DocumentAccessException("Received unknown response: " + reply);
}
return ((UpdateDocumentReply) reply).wasFound();
}
Aggregations