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

Last change on this file since 2920 was 2920, checked in by cs025, 22 years ago

Added ability to cope with NzdlBrowse objects

  • Property svn:keywords set to Author Date Id Revision
File size: 4.3 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 * @author George Buchanan ([email protected])
40 * @version $Revision: 2920 $
41 */
42public class NzdlRequest extends java.lang.Object {
43
44 private corbaFilterRequest m_Filter = null;
45
46
47 public NzdlRequest( corbaFilterRequest request ) {
48 m_Filter = request;
49 }
50
51 /**
52 * Creates an instance of NzdlRequest based on a search string inside a
53 * {@link NzdlQuery NzdlQuery} object. When serviced by
54 * {@link NzdlService NzdlService}, this type of request will return
55 * references to zero or more documents. <br>
56 * Pre: Have already created instance of NzdlQuery object containing a
57 * search string.<br>
58 * Post: Created a query filter request that is ready for servicing.
59 * @param query a {@link NzdlQuery NzdlQuery} object containing a string
60 * search and options.
61 */
62 public NzdlRequest( NzdlQuery _query ) {
63 m_Filter = NzdlCorbaFactory.createQueryFilterRequest( _query );
64 }
65
66 /**
67 * Creates an instance of NzdlRequest based on a classifier string
68 * inside a {@link NzdlBrowse NzdlBrowse} object.
69 */
70 public NzdlRequest( NzdlBrowse _browse) {
71 m_Filter = NzdlCorbaFactory.createBrowseFilterRequest( _browse );
72 }
73
74 /**
75 * Creates an instance of NzdlRequest based on a document ID. When serviced
76 * by {@link NzdlService NzdlService} this type of request will return
77 * exactly one document reference. <br>
78 * Pre: Have obtained a valid document ID.<br>
79 * Post: Created a browse filter request
80 * @param docID a string containing a valid GSDL document identifier.
81 */
82 public NzdlRequest( String _docID ) {
83 m_Filter = NzdlCorbaFactory.createBrowseFilterRequest( _docID );
84 }
85
86 /**
87 * Creates an instance of NzdlRequest based on a document ID and
88 * a metatag. <br>
89 * Pre: Have obtained a valid document ID and a metatag field.<br>
90 * Post: Created a metadata filter request.
91 * @param docID a string containing a valid GSDL document identifier.
92 * @param metatag a string containing a valid GSDL metadata such as Title
93 * or Author.
94 */
95 public NzdlRequest( String _docID, String _metaTag ) {
96 m_Filter = NzdlCorbaFactory.createMetaDataFilterRequest( _docID, _metaTag );
97 }
98
99 /**
100 * Creates an instance of NzdlRequest based on a list of document ID's and
101 * a metatag. <br>
102 * Pre: Have obtained a list of valid document ID's and a metatag field.<br>
103 * Post: Created a metadata filter request.
104 * @param docIDs a list of strings containing a valid GSDL document
105 * identifiers.
106 * @param metatag a string containing a valid GSDL metadata type such as
107 * Title Author.
108 */
109 public NzdlRequest( List _docIDs, String _metaTag ) {
110 m_Filter = NzdlCorbaFactory.createMetaDataFilterRequest( _docIDs, _metaTag );
111 }
112
113 /**
114 * Returns the corbaFilterRequest for the NzdlRequest object.
115 * @return The corbaFilterRequest Object.
116 */
117 public corbaFilterRequest getFilter() {
118 return m_Filter;
119 }
120
121}
Note: See TracBrowser for help on using the repository browser.