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 PlatformProfile {
14: private static final String ATTRIBUTE_PREFIX = "iplanet-am-platform-";
15:
16: private static final String SERVICE_NAME = "iPlanetAMPlatformService";
17:
18: private static final String GET_REQUEST = "GET_GLOBALS";
19:
20: private static boolean initialised = false;
21:
22: private static Map result;
23:
24: // private contructor
25: private PlatformProfile() {
26: }
27:
28: public static void init(String sessionId)
29: throws SendRequestException, GetResponseException {
30: Request request = new Request(sessionId, SERVICE_NAME,
31: GET_REQUEST);
32: Response response = SrapClient.bootupExecute(request);
33: result = (Map) response.getReturnedObject();
34: initialised = true;
35: }
36:
37: public static boolean isInitialised() {
38: return initialised;
39: }
40:
41: public static String getString(String name, String defaultValue) {
42: return AttributeExtractor.getString(result, ATTRIBUTE_PREFIX
43: + name, defaultValue);
44:
45: }
46:
47: public static int getInt(String name, int defaultValue) {
48: return AttributeExtractor.getInt(result, ATTRIBUTE_PREFIX
49: + name, defaultValue);
50: }
51:
52: public static boolean getBoolean(String name, boolean defaultValue) {
53: return AttributeExtractor.getBoolean(result, ATTRIBUTE_PREFIX
54: + name, defaultValue);
55: }
56:
57: public static List getStringList(String name) {
58: return AttributeExtractor.getStringList(result,
59: ATTRIBUTE_PREFIX + name);
60: }
61:
62: }
|