source: trunk/java-client/org/nzdl/gsdl/service/NzdlRequest.java@ 2284

Last change on this file since 2284 was 2284, checked in by say1, 23 years ago

Cross collection searching

  • Property svn:keywords set to Author Date Id Revision
File size: 4.0 KB
Line 
1/*
2 * NzdlRequest.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
21package org.nzdl.gsdl.service;
22
23import java.util.List;
24
25import org.nzdl.gsdl.corba.gsdlInterface.*;
26import org.nzdl.gsdl.util.*;
27
28/**
29 * An object that holds CORBA request data ready for by servicing by
30 * {@link NzdlService NzdlService}. NzdlRequest can receive data from: <br>
31 * - a {@link NzdlQuery NzdlQuery} object <br>
32 * - a document ID <br>
33 * - document ID's and a metatag.
34 *
35 * @author Stuart Yeates ([email protected])
36 * @author Aziz Mahoui ([email protected])
37 * @author Gordon Paynter ([email protected])
38 * @author Brett Sheeran ([email protected]) (comments)
39 * @version $Revision: 2284 $
40 */
41public class NzdlRequest extends java.lang.Object {
42
43 private corbaFilterRequest m_Filter = null;
44
45 public NzdlRequest( corbaFilterRequest request ) {
46 m_Filter = request;
47 }
48
49 /**
50 * Creates an instance of NzdlRequest based on a search string inside a
51 * {@link NzdlQuery NzdlQuery} object. When serviced by
52 * {@link NzdlService NzdlService}, this type of request will return
53 * references to zero or more documents. <br>
54 * Pre: Have already created instance of NzdlQuery object containing a
55 * search string.<br>
56 * Post: Created a query filter request that is ready for servicing.
57 * @param query a {@link NzdlQuery NzdlQuery} object containing a string
58 * search and options.
59 */
60 public NzdlRequest( NzdlQuery _query ) {
61 m_Filter = NzdlCorbaFactory.createQueryFilterRequest( _query );
62 }
63
64 /**
65 * Creates an instance of NzdlRequest based on a document ID. When serviced
66 * by {@link NzdlService NzdlService} this type of request will return
67 * exactly one document reference. <br>
68 * Pre: Have obtained a valid document ID.<br>
69 * Post: Created a browse filter request
70 * @param docID a string containing a valid GSDL document identifier.
71 */
72 public NzdlRequest( String _docID ) {
73 m_Filter = NzdlCorbaFactory.createBrowseFilterRequest( _docID );
74 }
75
76 /**
77 * Creates an instance of NzdlRequest based on a document ID and
78 * a metatag. <br>
79 * Pre: Have obtained a valid document ID and a metatag field.<br>
80 * Post: Created a metadata filter request.
81 * @param docID a string containing a valid GSDL document identifier.
82 * @param metatag a string containing a valid GSDL metadata such as Title
83 * or Author.
84 */
85 public NzdlRequest( String _docID, String _metaTag ) {
86 m_Filter = NzdlCorbaFactory.createMetaDataFilterRequest( _docID, _metaTag );
87 }
88
89 /**
90 * Creates an instance of NzdlRequest based on a list of document ID's and
91 * a metatag. <br>
92 * Pre: Have obtained a list of valid document ID's and a metatag field.<br>
93 * Post: Created a metadata filter request.
94 * @param docIDs a list of strings containing a valid GSDL document
95 * identifiers.
96 * @param metatag a string containing a valid GSDL metadata type such as
97 * Title Author.
98 */
99 public NzdlRequest( List _docIDs, String _metaTag ) {
100 m_Filter = NzdlCorbaFactory.createMetaDataFilterRequest( _docIDs, _metaTag );
101 }
102
103 /**
104 * Returns the corbaFilterRequest for the NzdlRequest object.
105 * @return The corbaFilterRequest Object.
106 */
107 public corbaFilterRequest getFilter() {
108 return m_Filter;
109 }
110
111}
Note: See TracBrowser for help on using the repository browser.