001: /**
002: * $Id: WebContainer.java,v 1.27 2007/01/26 03:48:33 portalbld Exp $
003: * Copyright 2004 Sun Microsystems, Inc. All
004: * rights reserved. Use of this product is subject
005: * to license terms. Federal Acquisitions:
006: * Commercial Software -- Government Users
007: * Subject to Standard License Terms and
008: * Conditions.
009: *
010: * Sun, Sun Microsystems, the Sun logo, and Sun ONE
011: * are trademarks or registered trademarks of Sun Microsystems,
012: * Inc. in the United States and other countries.
013: */package com.sun.portal.fabric.tasks;
014:
015: import java.io.File;
016:
017: import com.sun.portal.util.ResourceLoader;
018: import com.sun.portal.admin.common.InstanceAttributes;
019: import com.sun.portal.admin.common.context.PSConfigContext;
020: import com.sun.portal.util.Platform;
021:
022: /**
023: * This class implements the functionality needed
024: * to do Portal Management tasks related to
025: * WebContainer instances
026: */
027: public interface WebContainer extends InstanceAttributes {
028:
029: static final String cps = Platform.pathSep;
030: static final String fs = Platform.fs;
031: static final String nl = System.getProperty("line.separator");
032:
033: static final String DOMAIN_ID = ResourceLoader.DOMAIN_ID;
034: static final String PORTAL_ID = ResourceLoader.PORTAL_ID;
035: static final String INSTANCE_ID = ResourceLoader.INSTANCE_ID;
036:
037: /**
038: * Strings defining the webcontainer types
039: */
040: static final String TYPE_JESAS81 = "SJSAS81";
041: static final String TYPE_JESWS7 = "SJSWS7";
042: static final String TYPE_JESWS6 = "SJSWS6";
043: static final String TYPE_BEAWL8 = "BEAWL8";
044: static final String TYPE_IBMWS5 = "IBMWAS5";
045:
046: /**
047: * String Array containing keys for attributes in the HashMap
048: * that is passed when webcontainer implementation objects are
049: * constructed.
050: * Note: all these attributes are persisted in the PAS
051: */
052: static final String[] wcAttrKeys = { NAME, DESCRIPTION, HOST, PORT,
053: SCHEME, WEB_CONTAINER_TYPE, WEB_CONTAINER_INSTANCE,
054: WEB_CONTAINER_DOMAIN, WEB_CONTAINER_INSTALL_DIR,
055: WEB_CONTAINER_INSTANCE_DIR, WEB_CONTAINER_DOC_ROOT,
056: WEB_CONTAINER_ADMIN_HOST, WEB_CONTAINER_ADMIN_PORT,
057: WEB_CONTAINER_ADMIN_SCHEME, WEB_CONTAINER_ADMIN_UID,
058: WEB_CONTAINER_ADMIN_PASSWORD, WEB_CONTAINER_DEPLOY_NODE,
059: WEB_CONTAINER_DEPLOY_CELL, WEB_CONTAINER_MANAGED_SERVER,
060: WEB_CONTAINER_JDK_DIR, WEB_CONTAINER_CERTDB_PASSWORD,
061: WEB_CONTAINER_MASTER_PASSWORD };
062:
063: /**
064: * Configures the webcontainer with the Identity
065: * Server and Portal Server classpath and other
066: * JVM options.
067: */
068: void configure(PSConfigContext configContext)
069: throws ConfigurationException;
070:
071: /**
072: * Removes the Identity Server and Portal Server
073: * related configuration in the WebContainer
074: * classpath and JVM options
075: */
076: void unconfigure(PSConfigContext configContext)
077: throws ConfigurationException;
078:
079: /**
080: * Configures the webcontainer for the portletApp
081: * given the /conf directory with the standard format
082: */
083: boolean configureApp(String configDir, PSConfigContext configContext)
084: throws ConfigurationException;
085:
086: /**
087: * Configures the webcontainer for Search
088: */
089: void configureSearch(String classpath, PSConfigContext configContext)
090: throws ConfigurationException;
091:
092: /**
093: * Removes the Search related configuration in the WebContainer
094: */
095: void unconfigureSearch(String classpath,
096: PSConfigContext configContext)
097: throws ConfigurationException;
098:
099: /**
100: * Deploys the WAR file on to the webcontainer instance, along with post Deploy step
101: *
102: * @param warFile WAR file including full path
103: * @param uri Deployment URI
104: */
105: void deploy(String warFile, String uri)
106: throws ConfigurationException;
107:
108: /**
109: * Deploys the WAR file on to the webcontainer instance
110: *
111: * @param warFile WAR file including full path
112: * @param uri Deployment URI
113: */
114: void justDeploy(String warFile, String uri)
115: throws ConfigurationException;
116:
117: /**
118: * Performs the post Deploy step
119: *
120: */
121: void postDeploy() throws ConfigurationException;
122:
123: /**
124: * Undeploys the WAR file from the webcontainer instance
125: *
126: * @param uri Deployment URI
127: */
128: void undeploy(String uri) throws ConfigurationException;
129:
130: /**
131: * Starts the webcontainer instance
132: *
133: */
134: void start() throws ConfigurationException;
135:
136: /**
137: * Stops the webcontainer instance
138: *
139: */
140: void stop() throws ConfigurationException;
141:
142: /**
143: * Validate the web container
144: */
145: void validate() throws ValidationException;
146:
147: /**
148: * Post validation business
149: */
150: void postValidationInit() throws ConfigurationException;
151:
152: /**
153: * To do initial web container VM memory settings
154: */
155: boolean doJVMMemorySettings();
156:
157: /**
158: * Is Portal Configured on underlying Web Container ?
159: */
160: boolean isPortalConfigured();
161:
162: /**
163: * Get printable name of web container instance.
164: */
165: String getPrintableWebContainerInstanceName();
166:
167: /**
168: * Get type of underlying web container.
169: */
170: String getWebContainerType();
171: }
|