01: /*
02: * Copyright 2003 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.instance.sra.common;
07:
08: //
09:
10: import com.sun.portal.config.context.IdentityPropertyContext;
11: import com.sun.portal.config.context.SRAFileContext;
12: import com.sun.portal.config.context.SRAPropertyContext;
13: import com.sun.portal.instance.sra.Instance;
14:
15: import java.util.Properties;
16:
17: //
18:
19: public abstract class SRAInstance implements Instance {
20: //
21: //
22: //
23: protected String installLocation = null;
24: protected String bootupConfigurationFile = null;
25:
26: protected String name = null;
27: protected String workingConfigurationFile = null;
28:
29: protected Properties p = null;
30: protected SRAPropertyContext spc = null;
31: protected SRAFileContext sfc = null;
32:
33: //
34: //
35: //
36: protected String getBootupConfigurationFile() {
37: return bootupConfigurationFile;
38: }
39:
40: protected void setBootupConfigurationFile(String fileName) {
41: bootupConfigurationFile = installLocation
42: + SRAFileContext.FORWARD_SLASH + fileName;
43: this .workingConfigurationFile = bootupConfigurationFile;
44: }
45:
46: public SRAInstance(String installLocation,
47: String bootupConfigurationFile) {
48: this .installLocation = installLocation;
49: setBootupConfigurationFile(bootupConfigurationFile);
50: }
51:
52: //
53: //
54: //
55: public Boolean setName(String instanceName) {
56: name = instanceName;
57: return Boolean.TRUE;
58: }
59:
60: protected Boolean updateConfigurationFile(
61: IdentityPropertyContext ipc, String propertiesHeader) {
62: if (spc.doCreateNewIdentitySDKInstance().booleanValue()) {
63: spc.setIdentityOrganizationDN(ipc.getDefaultOrganization());
64: spc.setIdentityEncryptionKey(ipc.getEncryptionKey());
65: spc.setPortalHost(ipc.getSessionServiceHost());
66: spc.setPortalPort(ipc.getSessionServicePort());
67: spc.setPortalProtocol(ipc.getSessionServiceProtocol());
68: spc.setIdentitySessionServiceWebAppContext(ipc
69: .getSessionServiceWebAppContextFromNamingURL());
70: }
71:
72: return spc.write(workingConfigurationFile, propertiesHeader);
73: }
74:
75: //
76: //
77: //
78: }
|