blob: a1666a83856af9798d6c499cb21f11f440f36337 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.feedapi;
import com.yahoo.vespaxmlparser.FeedOperation;
/**
* Wrapper class for SimpleFeedAccess to send various XML operations.
*/
public class VespaFeedSender {
private final SimpleFeedAccess sender;
public VespaFeedSender(SimpleFeedAccess sender) {
this.sender = sender;
}
public boolean isAborted() {
return sender.isAborted();
}
public void sendOperation(FeedOperation op) {
switch (op.getType()) {
case DOCUMENT:
sender.put(op.getDocument(), op.getCondition());
break;
case REMOVE:
sender.remove(op.getRemove(), op.getCondition());
break;
case UPDATE:
sender.update(op.getDocumentUpdate(), op.getCondition());
break;
}
}
}
|