1 | /*
|
---|
2 | * NzdlService.java
|
---|
3 | * Copyright (C) 2001 New Zealand Digital Library Project
|
---|
4 | *
|
---|
5 | * This program is free software; you can redistribute it and/or modify
|
---|
6 | * it under the terms of the GNU General Public License as published by
|
---|
7 | * the Free Software Foundation; either version 2 of the License, or
|
---|
8 | * (at your option) any later version.
|
---|
9 | *
|
---|
10 | * This program is distributed in the hope that it will be useful,
|
---|
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
13 | * GNU General Public License for more details.
|
---|
14 | *
|
---|
15 | * You should have received a copy of the GNU General Public License
|
---|
16 | * along with this program; if not, write to the Free Software
|
---|
17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
---|
18 | */
|
---|
19 |
|
---|
20 | //the package we're in
|
---|
21 | package org.nzdl.gsdl.service;
|
---|
22 |
|
---|
23 | import java.util.Set;
|
---|
24 | import java.util.Map;
|
---|
25 | import java.util.List;
|
---|
26 |
|
---|
27 | /**
|
---|
28 | * An object that services CORBA client requests to a Greenstone Digital
|
---|
29 | * Library.
|
---|
30 | * @author Stuart Yeates ([email protected])
|
---|
31 | * @author Aziz Mahoui ([email protected])
|
---|
32 | * @author Gordon Paynter ([email protected])
|
---|
33 | * @author Brett Sheeran ([email protected]) (comments)
|
---|
34 | * @version $Revision: 2163 $
|
---|
35 | */
|
---|
36 | public interface NzdlService {
|
---|
37 |
|
---|
38 | /**
|
---|
39 | * Allow the client to configure a CORBA server.
|
---|
40 | * @param key the parameter to be set.
|
---|
41 | * @param values what that parameter will be set to.
|
---|
42 | */
|
---|
43 | public void configure( String key, Set values );
|
---|
44 |
|
---|
45 | /**
|
---|
46 | * Obtain the set of collection names for a Greenstone library.
|
---|
47 | * @return A set of collection names in string format.
|
---|
48 | */
|
---|
49 | public Set getCollectionSet( );
|
---|
50 |
|
---|
51 | /**
|
---|
52 | * Check if ORB knows of this collection.
|
---|
53 | * @param collectionName the name of a Greenstone collection.
|
---|
54 | * @return boolean <TT>true</TT> if collection is found, else <TT>false</TT>.
|
---|
55 | */
|
---|
56 | public boolean hasCollection( String collectionName );
|
---|
57 |
|
---|
58 | /**
|
---|
59 | * Check if ORB can communicate with of this collection.
|
---|
60 | * @param collectionName the name of a collection to be pinged.
|
---|
61 | * @return boolean <TT>true</TT> if collection returned ping, else
|
---|
62 | * <TT>false</TT>.
|
---|
63 | */
|
---|
64 | public boolean pingCollection( String collectionName );
|
---|
65 |
|
---|
66 | /**
|
---|
67 | * Extract information on this collection into a
|
---|
68 | * {@link NzdlCollectionInfo NzdlCollectionInfo} object
|
---|
69 | * @param collectionName the Greenstone collection to be retrieved.
|
---|
70 | * @return an instance of
|
---|
71 | * {@link NzdlCollectionInfo NzdlCollectionInfo} containing data on a
|
---|
72 | * collection
|
---|
73 | */
|
---|
74 | public NzdlCollectionInfo getCollectionInfo( String collectionName );
|
---|
75 |
|
---|
76 | /**
|
---|
77 | * Returns the set of filters for the service object.
|
---|
78 | * @param collectionName the name of the Greenstone collection.
|
---|
79 | * @return a set of strings that name the filters, for example
|
---|
80 | * BrowseFilter, QueryFilter and NullFilter.
|
---|
81 | */
|
---|
82 | public Set getFilterSet( String collectionName );
|
---|
83 |
|
---|
84 | /**
|
---|
85 | * Not Currently implemented.
|
---|
86 | */
|
---|
87 | public Set getMetaTagSet( String collectionName );
|
---|
88 |
|
---|
89 | /**
|
---|
90 | * Returns the Greenstone Markup Language (GML) text for a particular
|
---|
91 | * document from a collection.
|
---|
92 | * @param collectionName the name of the Greenstone collection.
|
---|
93 | * @param documentID the document identity string
|
---|
94 | * @return the GML document in the form of a string.
|
---|
95 | */
|
---|
96 | public String getDocument( String collectionName, String documentID );
|
---|
97 |
|
---|
98 | /**
|
---|
99 | * Returns the set of value(s) for a metatag from a particular document.
|
---|
100 | * @param collectionName the name of the Greenstone collection.
|
---|
101 | * @param documentID the document identifier.
|
---|
102 | * @param metaTag the metatag name such as: Title, Author, Date and Images.
|
---|
103 | * @return The set of value(s) for the requested metatag and document. In
|
---|
104 | * cases such as Title, Author, Date there will probably be only one value
|
---|
105 | * per document.
|
---|
106 | */
|
---|
107 | public Set getMetaData( String collectionName, String documentID, String metaTag );
|
---|
108 |
|
---|
109 | /**
|
---|
110 | * Returns a map of value(s) for a metatag from a list of documents.
|
---|
111 | * @param collectionName name of the Greenstone collection
|
---|
112 | * @param docIDs a list of document identifier strings.
|
---|
113 | * @param metaTag the metatag name such as: Title, Author, Date and Images.
|
---|
114 | * @return The map of value(s) for the requested metatag and document. In
|
---|
115 | * cases such as Title, Author, Date there will probably be only one value
|
---|
116 | * per document.
|
---|
117 | */
|
---|
118 | public Map getMetaData( String collectionName, List documentIDs, String metaTag );
|
---|
119 |
|
---|
120 | /**
|
---|
121 | * Services a {@link NzdlRequest NzdlRequest} to a collection and places
|
---|
122 | * the results into a {@link NzdlResponse NzdlResponse} object. <br>
|
---|
123 | * Pre: Created instances of NzdlRequest and NzdlResponse. <br>
|
---|
124 | * Post: Placed the result data into NzdlResponse object.
|
---|
125 | * @param collectionName name of the Greenstone collection.
|
---|
126 | * @param request an instance of NzdlRequest with query data to be serviced
|
---|
127 | * @param response an instance of NzdlResponse. where the results of
|
---|
128 | * sevciving the query will be placed
|
---|
129 | */
|
---|
130 | public void service( String collectionName, NzdlRequest request, NzdlResponse response );
|
---|
131 |
|
---|
132 | }
|
---|