01: package com.sun.portal.search.rdmserver;
02:
03: import com.sun.portal.search.rdm.*;
04: import com.sun.portal.search.soif.*;
05: import com.sun.portal.search.util.*;
06: import com.sun.portal.search.db.SToken;
07: import com.sun.portal.log.common.PortalLogger;
08:
09: import java.util.logging.Logger;
10: import java.util.logging.Level;
11:
12: /**
13: * Java side of rdmui nsapi - rdmserver bridge.
14: */
15: public class RDMUIBridge {
16:
17: public static byte[] rdmui_to_srv(byte[] request) throws Exception {
18: return rdmui_to_srv(request, null);
19: }
20:
21: public static byte[] rdmui_to_srv(byte[] request, SToken st)
22: throws Exception {
23: Logger logger = SearchLogger.getLogger();
24: logger.log(Level.FINE, "PSSH_CSPSRDMS0070");
25: try {
26: // Create RDM request and response objects
27: RDMRequest rdmreq = new RDMRequest(new SOIFInputStream(
28: request));
29: rdmreq.setSToken(st);
30: SOIFBuffer response = new SOIFBuffer();
31: RDMResponse rdmres = new RDMResponse(new SOIFOutputStream(
32: response));
33: // Service the request
34: RDMServer.rdmsvr.service(rdmreq, rdmres);
35: return response.toByteArray();
36: } catch (Exception e) {
37: logger.log(Level.WARNING, "PSSH_CSPSRDMS0071", e);
38: throw e;
39: }
40: }
41:
42: }
|