public class ServerConfigurationManager extends Object
| Constructor and Description |
|---|
ServerConfigurationManager(org.wso2.carbon.automation.engine.context.AutomationContext autoCtx)
Create a ServerConfigurationManager
|
ServerConfigurationManager(String productGroup,
org.wso2.carbon.automation.engine.context.TestUserMode userMode)
Create a ServerConfigurationManager
|
| Modifier and Type | Method and Description |
|---|---|
void |
applyConfiguration(File newConfig)
apply configuration file and restart server to take effect the configuration
|
void |
applyConfiguration(File sourceFile,
File targetFile)
Methods to replace configuration files in products.
|
void |
applyConfiguration(File sourceFile,
File targetFile,
boolean backupConfigFile,
boolean restartServer) |
void |
applyConfigurationWithoutRestart(File newConfig)
apply configuration file and restart server to take effect the configuration
|
void |
applyConfigurationWithoutRestart(File sourceFile,
File targetFile,
boolean backup)
Apply configuration from source file to a target file without restarting.
|
void |
copyToComponentDropins(File jar)
/**
Copy Jar file to server component/dropins
|
void |
copyToComponentLib(File jar)
Copy Jar file to server component/lib
|
static String |
getCarbonHome() |
void |
removeFromComponentDropins(String fileName) |
void |
removeFromComponentLib(String fileName) |
void |
restartForcefully()
Restart Server forcefully from admin user
|
void |
restartGracefully()
Restart Server Gracefully from admin user
|
void |
restartGracefully(long timeout)
Restart Server Gracefully from admin user
|
void |
restartGracefully(String sessionCookie)
Restart server gracefully from current user session
|
void |
restoreToLastConfiguration()
restore to a last configuration and restart the server
|
void |
restoreToLastConfiguration(boolean isRestartRequired)
restore all files to last configuration and restart the server
|
public ServerConfigurationManager(String productGroup, org.wso2.carbon.automation.engine.context.TestUserMode userMode) throws org.wso2.carbon.integration.common.utils.exceptions.AutomationUtilException, XPathExpressionException, MalformedURLException
productGroup - product group nameuserMode - user modeorg.wso2.carbon.integration.common.utils.exceptions.AutomationUtilExceptionXPathExpressionExceptionMalformedURLExceptionpublic ServerConfigurationManager(org.wso2.carbon.automation.engine.context.AutomationContext autoCtx)
throws org.wso2.carbon.integration.common.utils.exceptions.AutomationUtilException,
XPathExpressionException,
MalformedURLException
autoCtx - automation contextXPathExpressionExceptionorg.wso2.carbon.integration.common.utils.exceptions.AutomationUtilExceptionMalformedURLExceptionpublic static String getCarbonHome()
public void applyConfigurationWithoutRestart(File sourceFile, File targetFile, boolean backup) throws IOException
sourceFile - Source file to copy.targetFile - Target file that is to be backed up and replaced.backup - boolean value, set this to true if you want to backup the original file.IOException - - throws if apply configuration failspublic void applyConfiguration(File sourceFile, File targetFile, boolean backupConfigFile, boolean restartServer) throws org.wso2.carbon.integration.common.utils.exceptions.AutomationUtilException, IOException
sourceFile - file of the new configuration filetargetFile - configuration file required to replace in the server. File must be created
with the absolute path.backupConfigFile - require to back the existing filerestartServer - require to restart the server after replacing the config fileorg.wso2.carbon.integration.common.utils.exceptions.AutomationUtilExceptionIOExceptionpublic void restoreToLastConfiguration()
throws IOException,
org.wso2.carbon.integration.common.utils.exceptions.AutomationUtilException
IOExceptionorg.wso2.carbon.integration.common.utils.exceptions.AutomationUtilExceptionpublic void restoreToLastConfiguration(boolean isRestartRequired)
throws org.wso2.carbon.integration.common.utils.exceptions.AutomationUtilException,
IOException
org.wso2.carbon.integration.common.utils.exceptions.AutomationUtilException - - throws if restore to last configuration failsIOException - - throws if restore to last configuration failspublic void applyConfiguration(File newConfig) throws org.wso2.carbon.integration.common.utils.exceptions.AutomationUtilException, IOException
newConfig - configuration fileorg.wso2.carbon.integration.common.utils.exceptions.AutomationUtilException - - throws if apply configuration failsIOException - - throws if apply configuration failspublic void applyConfigurationWithoutRestart(File newConfig) throws IOException
newConfig - configuration fileIOException - - throws if apply configuration failspublic void applyConfiguration(File sourceFile, File targetFile) throws org.wso2.carbon.integration.common.utils.exceptions.AutomationUtilException, IOException
sourceFile - - configuration file to be copied for your local machine or carbon server it self.targetFile - - configuration file in carbon server. e.g - path to axis2.xml in config directoryorg.wso2.carbon.integration.common.utils.exceptions.AutomationUtilExceptionIOExceptionpublic void restartGracefully()
throws org.wso2.carbon.integration.common.utils.exceptions.AutomationUtilException
org.wso2.carbon.integration.common.utils.exceptions.AutomationUtilException - - throws if server restart failspublic void restartGracefully(long timeout)
throws org.wso2.carbon.integration.common.utils.exceptions.AutomationUtilException
timeout - - Server startup waiting timeorg.wso2.carbon.integration.common.utils.exceptions.AutomationUtilException - - throws if server restart failspublic void restartGracefully(String sessionCookie) throws org.wso2.carbon.integration.common.utils.exceptions.AutomationUtilException
sessionCookie - session cookieorg.wso2.carbon.integration.common.utils.exceptions.AutomationUtilException - - throws if server restart failspublic void restartForcefully()
throws org.wso2.carbon.integration.common.utils.exceptions.AutomationUtilException
org.wso2.carbon.integration.common.utils.exceptions.AutomationUtilException - - throws if forceful restart failspublic void copyToComponentLib(File jar) throws IOException, URISyntaxException
jar - jar fileIOExceptionURISyntaxExceptionpublic void removeFromComponentLib(String fileName) throws IOException, URISyntaxException
fileName - file nameIOExceptionURISyntaxExceptionpublic void copyToComponentDropins(File jar) throws IOException, URISyntaxException
jar - jar fileIOExceptionURISyntaxExceptionpublic void removeFromComponentDropins(String fileName) throws IOException, URISyntaxException
fileName - file nameIOExceptionURISyntaxExceptionCopyright © 2018 WSO2. All rights reserved.