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