OutputConfigクラスは、レコード・ストア・インスタンスにクロール出力を書き込むクロールを構成します。
レコード・ストアのプロパティ・キー名 | キー値 |
---|---|
host | レコード・ストアを実行しているホストの名前。デフォルトはlocalhostです。 |
port | レコード・ストアがリスニングしているポート番号。デフォルトは8510です。 |
contextPath | サービス・ロケーションのWebLogicコンテキスト・パス。このパスは、WebLogicにインストールされたIASに必要です。JettyにインストールされているIASでは、パスは空の文字列でなくてはなりません。デフォルトは空の文字列です。 |
isPortSsl | port設定を解釈する方法を指定します。
trueの値は、portがSSLポートで、APIが接続にHTTPSを使用していることを意味します。 falseの値は、portが非SSLポートで、APIが接続にHTTPを使用していることを意味します。デフォルトはfalseです。 HTTPSリダイレクトを有効化している場合は、falseを指定します。 |
instanceName | 出力を書き込むレコード・ストア・インスタンスの名前。デフォルトは、<crawlID>です。 |
isManaged | レコード・ストア・インスタンスが管理されているかいないかを示すブール値。管理すると、レコード・ストア・インスタンスが、それに相当するクロール構成に関連付けられます。trueを指定すると、クロールを実行したときにレコード・ストア・インスタンスがすでに存在しない場合、レコード・ストア・インスタンスが作成されます。また、trueを指定すると、クロール構成を削除した場合、それに相当するレコード・ストア・インスタンスが削除されます。デフォルトは、true (管理対象)です。 |
// Create the output configuration. OutputConfig outputConfig = new OutputConfig(); // Create a Record Store module ID. ModuleId moduleId = new ModuleId("Record Store"); // Set the module ID in the output configuration. outputConfig.setModuleId(moduleId); // Create a module property object. ModuleProperty host = new ModuleProperty(); // Set the key for specifying the host name. host.setKey("host"); host.setValues("localhost"); // Create a module property object. ModuleProperty port = new ModuleProperty(); // Set the key for specifying the port number. port.setKey("port"); port.setValues("8401"); // Create a module property object. ModuleProperty contextPath =new ModuleProperty(); contextPath.setKey("contextPath"); contextPath.setValues(""); // Create a module property object. ModuleProperty instanceName = new ModuleProperty(); // Set the key for specifying the instance name of the Record Store. instanceName.setKey("instanceName"); instanceName.setValues("RS1"); // Create a module property object. ModuleProperty isManaged = new ModuleProperty(); // Set the key for specifying whether the Record Store is managed. isManaged.setKey("isManaged"); isManaged.setValues("true"); // Create a list for the module property objects. List<ModuleProperty> outputPropsList = new ArrayList<ModuleProperty>(); // Set the module property objects in the list. outputPropsList.add(host); outputPropsList.add(port); outputPropsList.add(contextPath); outputPropsList.add(instanceName); outputPropsList.add(isManaged); // Set the module property in the output config (if not already done). outputConfig.setModuleProperties(outputPropsList); // Set the output configuration in the main crawl configuration. crawlConfig.setOutputConfig(outputConfig); // Create the crawl. crawler.createCrawl(crawlConfig);