Package org.wso2.carbon.webapp.mgt
Class WebappAdmin
java.lang.Object
org.wso2.carbon.core.AbstractAdmin
org.wso2.carbon.webapp.mgt.WebappAdmin
public class WebappAdmin
extends org.wso2.carbon.core.AbstractAdmin
The Admin service for managing webapps
-
Field Summary
Fields inherited from class org.wso2.carbon.core.AbstractAdmin
axisConfig, configurationContext -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidchangeDefaultAppVersion(String appGroupName, String fileName, String hostName) voidDelete all faulty webappsvoidDelete all started webappsvoidDelete all stopped webappsvoiddeleteAllWebApps(String[] webappKey) Delete set of all types of webapps.voiddeleteFaultyWebapps(String[] webappKey) Delete a set of faulty webappsvoiddeleteStartedWebapps(String[] webappKey) Delete a set of started webappsvoiddeleteStoppedWebapps(String[] webappKey) Delete a set of stopped webappsprotected booleandoesWebappSatisfySearchString(WebApplication webapp, String searchString) downloadWarFileHandler(String fileName, String hostName, String webappType) Downloads the webapp archive (.war) filevoidexpireAllSessions(String webappKey) Expire a given session in a webappvoidexpireSessions(String webappFileName, String[] sessionIDs, String hostName) Expire a given session in a webappvoidExpire all sessions in all webappsvoidexpireSessionsInWebapp(String webappKey, long maxSessionLifetimeMillis) Expire all sessions in the specified webapp which has a lifetime >=maxSessionLifetimeMillisvoidexpireSessionsInWebapps(String[] webappKeySet) Expire all sessions in specified webappsgetActiveSessions(String webappFileName, int pageNumber, String hostName) Get all active sessions of a webappgetBamConfiguration(String webappFileName, String hostName) This method returns the bam configuration statistic enabled or notgetPagedFaultyWebappsSummary(String webappSearchString, String webappType, int pageNumber) getPagedWebappsSummary(String webappSearchString, String webappState, String webappType, int pageNumber) Get a page of started webappsgetStartedWebapp(String webappFileName, String hostName) Get the details of a deplyed webappgetStoppedWebapp(String webappFileName, String hostName) Get the details of an stopped webappprotected StringgetWebappDeploymentDirPath(String webappType) protected StringgetWebappDeploymentDirPath(String webappType, String hostName) protected StringgetWebappDeploymentFile(String fileName, String hostName, String webappType) Return the location of the actual webapp filebooleanbooleancheck if unpack wars enabledprotected booleanisWebappRelevant(WebApplication webapp, String webappType) This method can be used to check whether the given web app is relevant for this Webapp type.voidReload all webappsvoidreloadWebapps(String[] webappKey) Reload a set of webappsvoidsetBamConfiguration(String webappFileName, String value, String hostName) Reset the bam enable and disable option.voidRedeploy all webappsvoidstartWebapps(String[] webappKeys) Redeploy a set of webappsvoidUndeploy all webappsvoidstopWebapps(String[] webappKeys) Undeploy a set of webappsbooleanuploadWebapp(WebappUploadData[] webappUploadDataList) Upload a webappMethods inherited from class org.wso2.carbon.core.AbstractAdmin
getAxisConfig, getConfigContext, getConfigSystemRegistry, getConfigUserRegistry, getGovernanceRegistry, getGovernanceSystemRegistry, getGovernanceUserRegistry, getHttpSession, getLocalRepo, getRegistry, getTenantDomain, getUsername, getUserRealm, setConfigurationContext, setPermissionUpdateTimestamp
-
Constructor Details
-
WebappAdmin
public WebappAdmin() -
WebappAdmin
- Throws:
Exception
-
-
Method Details
-
getPagedWebappsSummary
public WebappsWrapper getPagedWebappsSummary(String webappSearchString, String webappState, String webappType, int pageNumber) throws org.apache.axis2.AxisFault Get a page of started webapps- Parameters:
webappSearchString- Search stringwebappState- State of the webapp. Can be either WebappsConstants.WebappState.STARTED or WebappsConstants.WebappState.STOPPEDwebappType- application typepageNumber- The pageNumber of the page to be fetched- Returns:
- WebappsWrapper
- Throws:
org.apache.axis2.AxisFault
-
getStartedWebapp
Get the details of a deplyed webapp- Parameters:
webappFileName-hostName-- Returns:
- meta data for webapp
-
getStoppedWebapp
Get the details of an stopped webapp- Parameters:
webappFileName-hostName-- Returns:
- meta data for webapp
-
getPagedFaultyWebappsSummary
public WebappsWrapper getPagedFaultyWebappsSummary(String webappSearchString, String webappType, int pageNumber) throws org.apache.axis2.AxisFault - Parameters:
webappSearchString-webappType- application typepageNumber-- Returns:
- Throws:
org.apache.axis2.AxisFault
-
doesWebappSatisfySearchString
-
isWebappRelevant
This method can be used to check whether the given web app is relevant for this Webapp type. Only generic webapps are relevant for this Admin service.- Parameters:
webapp- - WebApplication instancewebappType- application type- Returns:
- - true if relevant
-
deleteStartedWebapps
Delete a set of started webapps- Parameters:
webappKey- The name:hostname pairs of the webapp files to be deleted- Throws:
org.apache.axis2.AxisFault- If an error occurs while deleting a webapp
-
deleteStoppedWebapps
Delete a set of stopped webapps- Parameters:
webappKey- The name:hostname pairs of the webapp files to be deleted- Throws:
org.apache.axis2.AxisFault- If an error occurs while deleting a webapp
-
deleteFaultyWebapps
Delete a set of faulty webapps- Parameters:
webappKey- The name:hostname pairs of the webapp files to be deleted- Throws:
org.apache.axis2.AxisFault- If an error occurs while deleting a webapp
-
deleteAllWebApps
Delete set of all types of webapps. (started, stopped, faulty)- Parameters:
webappKey- The name:hostname pairs of the webapp files to be deleted- Throws:
org.apache.axis2.AxisFault- AxisFault If an error occurs while deleting a webapp
-
deleteAllStartedWebapps
public void deleteAllStartedWebapps() throws org.apache.axis2.AxisFaultDelete all started webapps- Throws:
org.apache.axis2.AxisFault- If an error occurs while deleting a webapp
-
deleteAllStoppedWebapps
public void deleteAllStoppedWebapps() throws org.apache.axis2.AxisFaultDelete all stopped webapps- Throws:
org.apache.axis2.AxisFault- If an error occurs while deleting a webapp
-
deleteAllFaultyWebapps
public void deleteAllFaultyWebapps() throws org.apache.axis2.AxisFaultDelete all faulty webapps- Throws:
org.apache.axis2.AxisFault- If an error occurs while deleting a webapp
-
reloadAllWebapps
public void reloadAllWebapps()Reload all webapps -
reloadWebapps
Reload a set of webapps- Parameters:
webappKey- The file_name:hostname pairs of the webapps to be reloaded
-
setBamConfiguration
Reset the bam enable and disable option.- Parameters:
webappFileName-value-
-
getBamConfiguration
This method returns the bam configuration statistic enabled or not- Parameters:
webappFileName-- Returns:
-
stopAllWebapps
public void stopAllWebapps() throws org.apache.axis2.AxisFaultUndeploy all webapps- Throws:
org.apache.axis2.AxisFault- If an error occurs while undeploying
-
stopWebapps
Undeploy a set of webapps- Parameters:
webappKeys- The hostname:file_name pairs of the webapps to be stopped- Throws:
org.apache.axis2.AxisFault- If an error occurs while undeploying
-
startAllWebapps
public void startAllWebapps() throws org.apache.axis2.AxisFaultRedeploy all webapps- Throws:
org.apache.axis2.AxisFault- If an error occurs while restarting webapps
-
startWebapps
Redeploy a set of webapps- Parameters:
webappKeys- The hostname:file_name pairs of the webapps to be restarted- Throws:
org.apache.axis2.AxisFault- If a deployment error occurs
-
getActiveSessions
Get all active sessions of a webapp- Parameters:
webappFileName- The names of the webapp filepageNumber- The number of the page to fetch, starting with 0- Returns:
- The session array
-
expireSessionsInAllWebapps
public void expireSessionsInAllWebapps()Expire all sessions in all webapps -
expireSessionsInWebapps
Expire all sessions in specified webapps- Parameters:
webappKeySet- The file names of the webapps whose sessions should be expired
-
expireSessionsInWebapp
Expire all sessions in the specified webapp which has a lifetime >=maxSessionLifetimeMillis- Parameters:
webappKey- The file name of the webapp whose sessions should be expiredmaxSessionLifetimeMillis- The max allowed lifetime for the sessions
-
expireSessions
public void expireSessions(String webappFileName, String[] sessionIDs, String hostName) throws org.apache.axis2.AxisFault Expire a given session in a webapp- Parameters:
webappFileName- The file name of the webapp whose sessions should be expiredsessionIDs- Array of session IDs- Throws:
org.apache.axis2.AxisFault- If an error occurs while retrieving sessions
-
expireAllSessions
Expire a given session in a webapp- Parameters:
webappKey- The hostname:file_name pairs of the webapp whose sessions should be expired
-
uploadWebapp
public boolean uploadWebapp(WebappUploadData[] webappUploadDataList) throws org.apache.axis2.AxisFault Upload a webapp- Parameters:
webappUploadDataList- Array of data representing the webapps that are to be uploaded- Returns:
- true - if upload was successful
- Throws:
org.apache.axis2.AxisFault- If an error occurrs while uploading
-
getWebappDeploymentDirPath
-
getWebappDeploymentDirPath
-
getWebappDeploymentFile
Return the location of the actual webapp file- Parameters:
fileName- name of the webapp filewebappType- type of the webapp- Returns:
-
downloadWarFileHandler
Downloads the webapp archive (.war) file- Parameters:
fileName- name of the .war that needs to be downloadedhostName- virtualhostwebappType- application type- Returns:
- the corresponding data handler of the .war that needs to be downloaded
-
isUnpackWARs
public boolean isUnpackWARs()check if unpack wars enabled- Returns:
- true if enabled.
-
changeDefaultAppVersion
public void changeDefaultAppVersion(String appGroupName, String fileName, String hostName) throws org.apache.axis2.AxisFault, org.wso2.carbon.core.persistence.metadata.ArtifactMetadataException - Throws:
org.apache.axis2.AxisFaultorg.wso2.carbon.core.persistence.metadata.ArtifactMetadataException
-
isDefaultVersionManagementEnabled
public boolean isDefaultVersionManagementEnabled() -
getVhostHolder
- Returns:
- new VhostHolder instance
-