org.duracloud.services.webapputil.internal
Class WebAppUtilImpl

java.lang.Object
  extended by org.duracloud.services.BaseService
      extended by org.duracloud.services.webapputil.internal.WebAppUtilImpl
All Implemented Interfaces:
ComputeService, WebAppUtil, org.osgi.service.cm.ManagedService

public class WebAppUtilImpl
extends BaseService
implements WebAppUtil, org.osgi.service.cm.ManagedService

This class abstracts the details of managing appservers used to host DuraCloud services that run outside of an osgi-container.

Author:
Andrew Woods Date: Nov 30, 2009

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.duracloud.services.ComputeService
ComputeService.ServiceStatus
 
Field Summary
 
Fields inherited from interface org.duracloud.services.ComputeService
DELIM, ERROR_KEY, ERROR_REPORT_KEY, FAILURE_COUNT_KEY, ITEMS_PROCESS_COUNT, PASS_COUNT_KEY, REPORT_KEY, STARTTIME_KEY, STATUS_KEY, STOPTIME_KEY, SVC_LAUNCHING_USER, SYSTEM_PREFIX
 
Constructor Summary
WebAppUtilImpl()
           
 
Method Summary
 URL deploy(String serviceId, String portIndex, InputStream war)
          This method deploys the arg war to a newly created appserver under the arg serviceId context.
 URL deploy(String serviceId, String portIndex, InputStream war, Map<String,String> env)
          This method deploys the arg war to a newly created appserver under the arg serviceId context.
 URL filteredDeploy(String serviceId, String portIndex, InputStream war, Map<String,String> env, NamedFilterList filters)
          This method deploys the arg war to a newly created appserver under the arg serviceId context.
 int getInitialPort()
           
 void setInitialPort(int initialPort)
           
 void setTomcatUtil(TomcatUtil tomcatUtil)
           
 void unDeploy(URL url)
          This method undeploys the webapp currently deployed at the arg URL.
 void updated(Dictionary config)
           
 
Methods inherited from class org.duracloud.services.BaseService
addErrorReport, describe, doneWorking, getError, getErrorReportId, getServiceId, getServiceProps, getServiceStatus, getServiceWorkDir, getSvcLaunchingUser, setError, setErrorReportId, setErrorReportId, setReportId, setReportId, setServiceId, setServiceStatus, setServiceWorkDir, setSvcLaunchingUser, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.duracloud.services.ComputeService
describe, getServiceId, getServiceProps, getServiceStatus, getServiceWorkDir, setServiceWorkDir, start, stop
 

Constructor Detail

WebAppUtilImpl

public WebAppUtilImpl()
Method Detail

deploy

public URL deploy(String serviceId,
                  String portIndex,
                  InputStream war)
This method deploys the arg war to a newly created appserver under the arg serviceId context.

Specified by:
deploy in interface WebAppUtil
Parameters:
serviceId - is the name of the context of deployed webapp
war - to be deployed
portIndex - offset from configured base port
Returns:
URL of deployed webapp

deploy

public URL deploy(String serviceId,
                  String portIndex,
                  InputStream war,
                  Map<String,String> env)
This method deploys the arg war to a newly created appserver under the arg serviceId context.

Specified by:
deploy in interface WebAppUtil
Parameters:
serviceId - is the name of the context of deployed webapp
war - to be deployed
env - of tomcat that will be installed/started
Returns:
URL of deployed webapp

filteredDeploy

public URL filteredDeploy(String serviceId,
                          String portIndex,
                          InputStream war,
                          Map<String,String> env,
                          NamedFilterList filters)
This method deploys the arg war to a newly created appserver under the arg serviceId context.

Specified by:
filteredDeploy in interface WebAppUtil
Parameters:
serviceId - is the name of the context of deployed webapp
portIndex - offset from configured base port
war - to be deployed
env - of tomcat that will be installed/started
filters - are names of files in the arg war to be filtered with provided filters. Any filters that contain the strings $DURA_HOST$ or $DURA_PORT$ will be swapped with the host and port of the compute instance.
Returns:
URL of deployed webapp

unDeploy

public void unDeploy(URL url)
This method undeploys the webapp currently deployed at the arg URL.

Specified by:
unDeploy in interface WebAppUtil
Parameters:
url - of the currently deployed webapp

getInitialPort

public int getInitialPort()

setInitialPort

public void setInitialPort(int initialPort)

setTomcatUtil

public void setTomcatUtil(TomcatUtil tomcatUtil)

updated

public void updated(Dictionary config)
             throws org.osgi.service.cm.ConfigurationException
Specified by:
updated in interface org.osgi.service.cm.ManagedService
Throws:
org.osgi.service.cm.ConfigurationException


Copyright © 2009-2012 DuraSpace. All Rights Reserved.