01: package com.sun.portal.rproxy.configservlet.client;
02:
03: /*import com.sun.portal.rproxy.configservlet.client.GetResponseException;
04: import com.sun.portal.rproxy.configservlet.client.SendRequestException;
05: import com.sun.portal.log.common.PortalLogger;
06: import com.sun.portal.rproxy.configservlet.client.SrapClient;*/
07: import java.util.List;
08: import java.util.Map;
09:
10: import com.sun.portal.rproxy.configservlet.Request;
11: import com.sun.portal.rproxy.configservlet.Response;
12:
13: public class ProxyletProfile {
14:
15: private static final String ATTRIBUTE_PREFIX = "sunPortalProxylet";
16:
17: private static final String SERVICE_NAME = "srapProxyletService";
18:
19: private static final String GET_REQUEST = "GET_USERS";
20:
21: private static Map result;
22:
23: public ProxyletProfile(String sessionId)
24: throws SendRequestException, GetResponseException {
25: Request request = new Request(sessionId, SERVICE_NAME,
26: GET_REQUEST);
27: Response response = SrapClient.execute(request);
28: result = (Map) response.getReturnedObject();
29: }
30:
31: public static String getString(String name, String defaultValue) {
32: return AttributeExtractor.getString(result, ATTRIBUTE_PREFIX
33: + name, defaultValue);
34:
35: }
36:
37: public static int getInt(String name, int defaultValue) {
38: return AttributeExtractor.getInt(result, ATTRIBUTE_PREFIX
39: + name, defaultValue);
40: }
41:
42: public static boolean getBoolean(String name, boolean defaultValue) {
43: return AttributeExtractor.getBoolean(result, ATTRIBUTE_PREFIX
44: + name, defaultValue);
45: }
46:
47: public static List getStringList(String name) {
48: return AttributeExtractor.getStringList(result,
49: ATTRIBUTE_PREFIX + name);
50: }
51:
52: public String toString() {
53: return result.toString();
54: }
55:
56: }
|