⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pollnetnewscollection.java

📁 关于Ultraseek的一些用法,刚初学,所以都是比较简单
💻 JAVA
字号:
/* -*- mode:java; indent-tabs-mode:nil; c-basic-offset:2 -*- * *  $RCSFile$ $Revision: 1.17 $ $Date: 2006/02/01 00:20:30 $ * *  Copyright (c) 2000-2002 Autonomy Corp.  All Rights Reserved. *  Permission to use, copy, modify, and distribute this file is hereby *  granted without fee, provided that the above copyright notice appear *  in all copies. */import java.io.BufferedReader;import java.io.InputStreamReader;import com.ultraseek.xpa.server.UltraseekServer;import com.ultraseek.xpa.server.CollectionAdmin;import com.ultraseek.xpa.server.NetnewsAdmin;import com.ultraseek.xpa.server.ServerAdmin;import com.ultraseek.xpa.server.UltraseekCollection;/** *  A simple demo application  *  that polls the remote server *  for an Ultraseek netnews collection. */public class PollNetnewsCollection {  PollNetnewsCollection() { }  public static void main(String[] args) throws Exception {    InputStreamReader inputStreamReader = new InputStreamReader(System.in);    BufferedReader bufferedReader = new BufferedReader(inputStreamReader);    System.out.println();    System.out.println("This is a simple demo application");    System.out.println("that polls a remote server");    System.out.println("for an Ultraseek netnews collection.");    System.out.println();    System.out.println("Enter the hostname and TCP port of your");    System.out.println("running Ultraseek instance.");    System.out.print("hostname: ");    String host = bufferedReader.readLine();    System.out.print("TCP port: ");    int port = Integer.parseInt(bufferedReader.readLine());    UltraseekServer server = new UltraseekServer(host,port);    System.out.println();    System.out.println("Here is the UltraseekServer object:");    System.out.println(server);    System.out.println();    System.out.println("Enter your Ultraseek admin username");    System.out.println("and password.");    System.out.print("username: ");    String username = bufferedReader.readLine();    System.out.print("password: ");    String password = bufferedReader.readLine();    ServerAdmin serverAdmin = server.admin(username,password);    System.out.println();    System.out.println("Here is the UltraseekServerAdmin object:");    System.out.println(serverAdmin);    System.out.println();    System.out.println("Enter the internal name of the collection.");    System.out.print("collection: ");    String id = bufferedReader.readLine();    UltraseekCollection collection       = (UltraseekCollection)server.getSearchCollection(id);    System.out.println();    System.out.println("Here is the UltraseekCollection object:");    System.out.println(collection);    CollectionAdmin collectionAdmin = collection.admin(serverAdmin);    System.out.println();    System.out.println("Here is the UltraseekCollectionAdmin object:");    System.out.println(collectionAdmin);    if (collectionAdmin instanceof NetnewsAdmin) {      System.out.println();      System.out.println("Sending poll command.");      ((NetnewsAdmin)collectionAdmin).poll();      System.out.println("Done.");    } else {      System.out.println("The collection is not a netnews collection.");    }  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -