View Javadoc

1   /*
2    * SymmetricDS is an open source database synchronization solution.
3    *   
4    * Copyright (C) Chris Henson <chenson42@users.sourceforge.net>
5    *               Eric Long <erilong@users.sourceforge.net>
6    *
7    * This library is free software; you can redistribute it and/or
8    * modify it under the terms of the GNU Lesser General Public
9    * License as published by the Free Software Foundation; either
10   * version 3 of the License, or (at your option) any later version.
11   *
12   * This library is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15   * Lesser General Public License for more details.
16   *
17   * You should have received a copy of the GNU Lesser General Public
18   * License along with this library; if not, see
19   * <http://www.gnu.org/licenses/>.
20   */
21  
22  package org.jumpmind.symmetric.service;
23  
24  import java.io.BufferedWriter;
25  import java.io.IOException;
26  import java.io.OutputStream;
27  
28  import org.jumpmind.symmetric.extract.DataExtractorContext;
29  import org.jumpmind.symmetric.extract.IExtractorFilter;
30  import org.jumpmind.symmetric.model.Node;
31  import org.jumpmind.symmetric.model.OutgoingBatch;
32  import org.jumpmind.symmetric.model.Trigger;
33  import org.jumpmind.symmetric.transport.IOutgoingTransport;
34  
35  public interface IDataExtractorService {
36  
37      public void extractConfiguration(Node node, BufferedWriter writer, DataExtractorContext ctx) throws IOException;
38      
39      public void extractConfigurationStandalone(Node node, OutputStream out) throws IOException;
40  
41      public void extractConfigurationStandalone(Node node, BufferedWriter out) throws IOException;
42  
43      public OutgoingBatch extractInitialLoadFor(Node node, Trigger config, BufferedWriter writer);
44  
45      public void extractInitialLoadWithinBatchFor(Node node, Trigger trigger, BufferedWriter writer,
46              DataExtractorContext ctx);
47  
48      /***
49       * @return true if work was done or false if there was no work to do.
50       */
51      public boolean extract(Node node, IOutgoingTransport transport) throws Exception;
52  
53      public boolean extract(Node node, final IExtractListener handler) throws Exception;
54  
55      public boolean extractBatchRange(IOutgoingTransport transport, String startBatchId, String endBatchId)
56              throws Exception;
57  
58      public boolean extractBatchRange(IExtractListener handler, String startBatchId, String endBatchId) throws Exception;
59  
60      public void addExtractorFilter(IExtractorFilter extractorFilter);
61  
62  }