001: //=============================================================================
002: //=== Copyright (C) 2001-2007 Food and Agriculture Organization of the
003: //=== United Nations (FAO-UN), United Nations World Food Programme (WFP)
004: //=== and United Nations Environment Programme (UNEP)
005: //===
006: //=== This program is free software; you can redistribute it and/or modify
007: //=== it under the terms of the GNU General Public License as published by
008: //=== the Free Software Foundation; either version 2 of the License, or (at
009: //=== your option) any later version.
010: //===
011: //=== This program is distributed in the hope that it will be useful, but
012: //=== WITHOUT ANY WARRANTY; without even the implied warranty of
013: //=== MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: //=== General Public License for more details.
015: //===
016: //=== You should have received a copy of the GNU General Public License
017: //=== along with this program; if not, write to the Free Software
018: //=== Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
019: //===
020: //=== Contact: Jeroen Ticheler - FAO - Viale delle Terme di Caracalla 2,
021: //=== Rome - Italy. email: geonetwork@osgeo.org
022: //==============================================================================
023:
024: package org.fao.geonet.services.util.z3950;
025:
026: import jeeves.server.context.ServiceContext;
027: import jeeves.server.UserSession;
028: import jeeves.interfaces.Logger;
029:
030: import java.util.*;
031: import javax.naming.*;
032:
033: import com.k_int.IR.*;
034: import com.k_int.util.LoggingFacade.*;
035:
036: //=============================================================================
037:
038: public class GNSearchable implements Searchable, Scanable // RGFIX: should I implement Scanable?
039: {
040: private LoggingContext cat = LogContextFactory
041: .getContext("GeoNetwork"); // RGFIX: maybe should use servlet name
042:
043: private Properties properties = null;
044: private Context naming_context = null;
045:
046: ServiceContext _srvContext;
047:
048: //--------------------------------------------------------------------------
049:
050: public GNSearchable() {
051: cat.debug("New GNSearchable");
052: }
053:
054: //--------------------------------------------------------------------------
055:
056: public void init(Properties p) {
057: this .properties = p;
058:
059: _srvContext = (ServiceContext) p.get("srvContext");
060: }
061:
062: public void init(Properties p, Context naming_context) {
063: init(p);
064: this .naming_context = naming_context;
065: }
066:
067: //--------------------------------------------------------------------------
068:
069: public void destroy() {
070: // TODO: check if empty method is correct
071: }
072:
073: //--------------------------------------------------------------------------
074:
075: public int getManagerType() {
076: return com.k_int.IR.Searchable.SPECIFIC_SOURCE;
077: }
078:
079: //--------------------------------------------------------------------------
080: // Evaluate the enquiry, waiting at most will_wait_for seconds for a response
081: public SearchTask createTask(IRQuery q, Object user_data) {
082: return this .createTask(q, user_data, null);
083: }
084:
085: //--------------------------------------------------------------------------
086:
087: public SearchTask createTask(IRQuery q, Object user_data,
088: Observer[] observers) {
089: GNSearchTask retval = new GNSearchTask(q, this , observers,
090: properties, _srvContext);
091: return retval;
092: }
093:
094: //--------------------------------------------------------------------------
095:
096: public boolean isScanSupported() {
097: return false;
098: }
099:
100: //--------------------------------------------------------------------------
101:
102: public ScanInformation doScan(ScanRequestInfo req) {
103: return null;
104: }
105: }
106: //=============================================================================
|