Skip to content

Instantly share code, notes, and snippets.

@brianhsu
Created October 8, 2010 06:19
Show Gist options
  • Select an option

  • Save brianhsu/616429 to your computer and use it in GitHub Desktop.

Select an option

Save brianhsu/616429 to your computer and use it in GitHub Desktop.
package xmlimport;
import java.util.Properties;
import ftp.FINJFTP;
import props.PropsServiceProvider;
public class DoSwapServerIndex {
public static void main(String[] args) {
DoSwapServerIndex doSwapLuceneIndex = new DoSwapServerIndex();
doSwapLuceneIndex.swapLuceneIndex();
}
private void swapLuceneIndex() {
final PropsServiceProvider propsServiceProvider1 = new PropsServiceProvider(
"props/ServiceProvider.properties");
final PropsServiceProvider propsServiceProvider2 = new PropsServiceProvider(
"props/server115.properties");
Properties prosp = new Properties();
prosp = propsServiceProvider1.getProperties();
Properties pro115 = new Properties();
pro115 = propsServiceProvider2.getProperties();
new Thread(new SwapIndexThread(pro115, "XXX.XXX.XXX.XXX")).start();
new Thread(new SwapIndexThread(prosp, "XXX.XXX.XXX.XXX")).start();
new Thread(new SwapIndexThread(prosp, "XXX.XXX.XXX.XXX")).start();
// [2010-07-05-XXX]182專用知識網目前用不到Lucene
// new Thread(new SwapIndexThread(prosp, "XXX.XXX.XXX.XX")).start();
}
// ========Class End========
}
class SwapIndexThread implements Runnable {
String server = null;
Properties properties = null;
SwapIndexThread(Properties pro, String server) {
this.properties = pro;
this.server = server;
}
public void run() {
FINJFTP ftp = new FINJFTP(this.properties, this.server);
ftp.swapIndex(server);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment