01: /*
02: * Copyright 2001 Sun Microsystems, Inc. All rights reserved.
03: * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms.
04: */
05:
06: package com.sun.portal.search.rdm;
07:
08: import com.sun.portal.search.soif.*;
09:
10: /** RDM Response Message
11: *
12: * The message contains an RDMHeader with an appropriate response type
13: * RDM_RD_UPD_RES
14: * RDM_RD_DEL_RES
15: * RDM_SD_RES
16: * RDM_SCH_RES
17: * RDM_TAX_RES
18: * RDM_STAT_RES;
19: * and a SOIF Stream containing the result set of the objects that
20: * matched the request.
21: *
22: */
23: public class RDMResponse {
24:
25: RDMHeader header;
26: SOIFOutputStream out;
27: boolean headerSent = false;
28:
29: //XXX need to configure this with an outputstream, not inputstream !!!
30:
31: public RDMResponse(SOIFOutputStream ss) throws Exception {
32: header = new RDMHeader();
33: out = ss;
34: }
35:
36: public RDMHeader getHeader() {
37: return header;
38: }
39:
40: public void setHeader(RDMHeader h) {
41: header = h;
42: }
43:
44: public void sendHeader() throws java.io.IOException {
45: if (!headerSent) {
46: out.write(header.getSOIF());
47: headerSent = true;
48: }
49: }
50:
51: public boolean headerSent() {
52: return headerSent;
53: }
54:
55: public SOIFOutputStream getOutputStream() {
56: return out;
57: }
58:
59: }
|