aboutsummaryrefslogtreecommitdiffstats
path: root/vespaclient-core/src/main/java/com/yahoo/feedapi/XMLFeeder.java
blob: 9a86a170bba8ff1eb1347249dd76c62dec35ea60 (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
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.feedapi;

import com.yahoo.document.DocumentTypeManager;
import com.yahoo.vespaxmlparser.FeedReader;
import com.yahoo.vespaxmlparser.VespaXMLFeedReader;

import java.io.InputStream;

/**
 * Unpack a stream of document operations represented as XML and push to a feed
 * access point.
 *
 * @author Thomas Gundersen
 * @author Steinar Knutsen
 */
public class XMLFeeder extends Feeder {
    public XMLFeeder(DocumentTypeManager docMan, SimpleFeedAccess sender, InputStream stream) {
        super(docMan, new VespaFeedSender(sender), stream);
    }

    @Override
    protected FeedReader createReader() throws Exception {
        return new VespaXMLFeedReader(stream, docMan);
    }
}