public interface ModuleAdminAgent
SpecialistsBroker.requireSpecialist(ModuleAdminAgent.TYPE)
Modifier and Type | Interface and Description |
---|---|
static interface |
ModuleAdminAgent.ModuleResult
The module installation/update result containing the installed/upgraded module descriptor
and the process log message.
|
Modifier and Type | Field and Description |
---|---|
static SpecialistType<ModuleAdminAgent> |
TYPE
Agent providing administrative methods for maintaining FirstSpirit server modules.
|
Modifier and Type | Method and Description |
---|---|
GlobalWebAppId |
createGlobalWebApp(String globalWebAppId,
String contextName,
String name)
Creates a global web-app.
|
boolean |
deployWebApp(WebAppId webAppId)
Deploys the given web app to its web-server.
|
boolean |
deployWebApps(Iterable<WebAppId> webAppIds)
Deploys the given web apps to their corresponding web-servers.
|
InputStream |
downloadWebApp(WebAppId webAppId)
Download the specified web app as
.war -file. |
Collection<GlobalWebAppId> |
getGlobalWebApps()
Returns all configurable global web-apps.
|
Collection<GlobalWebAppId> |
getGlobalWebApps(boolean includeSystem)
Returns all configurable global web-apps with the option to include the ones from the system.
|
String |
getInstalledVersion(String moduleName)
Returns the version of the given module.
|
Collection<ModuleDescriptor> |
getModules()
Return descriptors of all installed modules.
|
FileSystem<?> |
getProjectAppConfig(String moduleName,
String projectAppName,
Project project)
Returns an access to the project-app configuration directory; read-write-access if the user is project admin,
read-only-access if the user is project user, otherwise a
SecurityException will be thrown. |
Collection<Project> |
getProjectAppUsages(String moduleName,
String projectAppName)
Returns ids of all projects using the specified project application.
|
FileSystem<?> |
getServiceConfig(String serviceName)
Provides access to the configuration of a service.
|
FileSystem<?> |
getWebAppConfig(String moduleName,
String webAppComponent,
WebAppId webAppId)
Returns the configuration directory of the specified web-app.
|
Collection<WebAppId> |
getWebAppUsages(String moduleName,
String webAppComponent)
Returns all usages of the given web-app component.
|
FileSystem<?> |
getWebServerConfiguration(String moduleName,
String componentName,
String instanceName)
Returns the configuration file system specified by the given web server.
|
ModuleAdminAgent.ModuleResult |
install(InputStream fsmStream,
boolean updateUsages)
Installs or updates the given module.
|
ModuleAdminAgent.ModuleResult |
install(InputStream fsmStream,
boolean updateUsages,
boolean deployWebApps)
Installs or updates the given module.
|
void |
installProjectApp(String moduleName,
String projectAppName,
Project project)
Installs or updates a project application to the specified project.
|
void |
installWebApp(String moduleName,
String webAppComponent,
WebAppId webAppId)
Installs or updates the given web-app component into the specified web app and deploys the web app
to its web-server.
|
void |
installWebApp(String moduleName,
String webAppComponent,
WebAppId webAppId,
boolean deploy)
Installs or updates the given web-app component into the specified web app and deploys the web app
to its web-server, if
deploy is set to true . |
boolean |
isActive(String moduleName)
Check if the module with the specified name is currently active.
|
boolean |
isAutostart(String serviceName)
Returns
true if the given service is automatically started after FirstSpirit server start. |
boolean |
isRunning(String serviceName)
Returns
true if the given service is currently running. |
boolean |
isTrusted(String moduleName)
Returns the trusted flag of the given module.
|
void |
registerWebServer(String moduleName,
String componentName,
String instanceName)
Registers a new web server with the specified instance name.
|
void |
removeGlobalWebApp(GlobalWebAppId globalWebAppId)
Undeploys and destroys the given global web-app.
|
boolean |
setAutostart(String serviceName,
boolean autostart)
Sets whether the given service should start automatically after FirstSpirit server start.
|
boolean |
setTrusted(String moduleName,
boolean trusted)
Sets whether to trust the codebase of the specified module.
|
void |
startService(String serviceName)
Starts the service with the given
serviceName . |
void |
stopService(String serviceName)
Stops the service with the given
serviceName . |
boolean |
undeployWebApp(WebAppId webAppId)
Undeploys the given web app from its web-server.
|
void |
uninstall(String moduleName,
boolean removeUsages)
Uninstalls the given module.
|
void |
uninstallProjectApp(String moduleName,
String projectAppName,
Project project)
Removes the project application from the specified project.
|
void |
uninstallWebApp(String moduleName,
String webAppComponent,
WebAppId webAppId)
Removes the given web-app component from the specified web app and deploys the web
to its web-server.
|
void |
unregisterWebServer(String moduleName,
String componentName,
String instanceName)
Removes the specified web server and deletes its directories from the configuration directory.
|
static final SpecialistType<ModuleAdminAgent> TYPE
SpecialistsBroker
.@NotNull ModuleAdminAgent.ModuleResult install(@NotNull InputStream fsmStream, boolean updateUsages) throws IOException, ModuleException
updateUsages
is true
all project-app
and web-app components will be updated and the appropriate web-apps will be deployed.
Important:
fsmStream
will be closed, automatically. The caller is not responsible for
closing the stream.fsmStream
- fsm file stream.updateUsages
- true
to update all project- and web-components (related web-apps will be deployed).IOException
- if any io operation fails.ModuleException
- if the fsm isn't valid or in case of a circular dependency (e.g. module A needs B, B needs C, C needs A).SecurityException
- if the current user is not a server admin.uninstall(String, boolean)
@NotNull ModuleAdminAgent.ModuleResult install(@NotNull InputStream fsmStream, boolean updateUsages, boolean deployWebApps) throws IOException, ModuleException
updateUsages
is true
all project-app
and web-app components will be updated. If deployWebApps
is true
all related web-apps be deployed.
Important:
fsmStream
will be closed, automatically. The caller is not responsible for
closing the stream.fsmStream
- fsm file stream.updateUsages
- true
to update all project- and web-componentsdeployWebApps
- true
to directly deploy the related web-apps after the install process has finished.IOException
- if any io operation fails.ModuleException
- if the fsm isn't valid or in case of a circular dependency (e.g. module A needs B, B needs C, C needs A).SecurityException
- if the current user is not a server admin.uninstall(String, boolean)
boolean isActive(String moduleName) throws IllegalArgumentException
moduleName
- name of the module.true
if the module is active.IllegalArgumentException
- if the module is not found.boolean isTrusted(String moduleName)
moduleName
- name of the moduleboolean setTrusted(String moduleName, boolean trusted)
moduleName
- name of the moduletrusted
- new valueSecurityException
- if the current user is not a server admin.void uninstall(String moduleName, boolean removeUsages) throws ModuleException
removeUsages
is true
all project-app and
and web-app components will be removed and appropriate web-apps will be deployed.
If removeUsages
is false
and there still exist any usages, a
ModuleException
will be thrown.moduleName
- name of the module which should be uninstalled.removeUsages
- true
to remove all usages.ModuleException
- if unloading of the given module fails.SecurityException
- if the current user is not a server admin.install(InputStream, boolean)
void installProjectApp(String moduleName, String projectAppName, @NotNull Project project) throws ModuleException
moduleName
- name of the module containing the project application.projectAppName
- name of the project-app component.project
- where to install the component.ModuleException
- if installing the component fails.SecurityException
- if the current user is not a project administrator.uninstallProjectApp(String, String, Project)
@NotNull FileSystem<?> getProjectAppConfig(String moduleName, String projectAppName, @NotNull Project project) throws SecurityException
SecurityException
will be thrown.moduleName
- name of the module containing the project application.projectAppName
- name of the project-app component.project
- project where the app is installed.SecurityException
- if the current user has no project access.IllegalArgumentException
- if there is no project app installed in the given project matching the given names@NotNull FileSystem<?> getServiceConfig(@NotNull String serviceName)
SecurityException
is thrown.serviceName
- name of the service to retrieve the configuration for, must not be null
.SecurityException
- if the current user is not a server admin.ServiceNotFoundException
- if the service could not be found.@NotNull Collection<Project> getProjectAppUsages(String moduleName, String projectAppName)
moduleName
- name of the module containing the project application.projectAppName
- name of project-app component.void uninstallProjectApp(String moduleName, String projectAppName, @NotNull Project project) throws ModuleException
moduleName
- name of the module containing the project application.projectAppName
- name of the project-app component.project
- target project.ModuleException
- if uninstalling the project-app fails.SecurityException
- if the current user is not a project administrator.installProjectApp(String, String, Project)
void registerWebServer(@NotNull String moduleName, @NotNull String componentName, @NotNull String instanceName)
moduleName
- name of module containing the web server component, must not be null
.componentName
- name of web server component, must not be null
.instanceName
- name of the web server instance to be created, must not be null
.ModuleException
- if the module could not be found.IllegalStateException
- if the module component could not be found.ModuleException
- if the web server could not be found.UncheckedIOException
- if an error occurred while copying required files.SecurityException
- if the current user is not a server admin.void unregisterWebServer(@NotNull String moduleName, @NotNull String componentName, @NotNull String instanceName)
moduleName
- name of module containing the web server component, must not be null
.componentName
- name of web server component, must not be null
.instanceName
- name of the web server instance to remove, must not be null
.IllegalStateException
- if the web server is still marked as active for at least one web application.ModuleException
- if the web server or file system could not be found.SecurityException
- if the current user is not a server admin.FileSystem<?> getWebServerConfiguration(@NotNull String moduleName, @NotNull String componentName, @NotNull String instanceName)
Attention: Please remember to close the FileSystem after usage.
moduleName
- name of module containing the web server component, must not be null
.componentName
- name of web server component, must not be null
.instanceName
- name of the web server instance, must not be null
.Optional
if it's not defined.SecurityException
- if the current user is not a server admin.void installWebApp(String moduleName, String webAppComponent, @NotNull WebAppId webAppId) throws ModuleException
moduleName
- name of the module containing the web-app component.webAppComponent
- web-app component name.webAppId
- target web-app.ModuleException
- if the installation or update failed.SecurityException
- if the web-app is global and the current user is not a server admin or
if it is a project-local web-app and the current user is not a project admin.uninstallWebApp(String, String, WebAppId)
void installWebApp(String moduleName, String webAppComponent, @NotNull WebAppId webAppId, boolean deploy) throws ModuleException
deploy
is set to true
.moduleName
- name of the module containing the web-app component.webAppComponent
- web-app component name.webAppId
- target web-app.deploy
- whether the related web app should be deployed to its web-server or notModuleException
- if the installation or update failed.SecurityException
- if the web-app is global and the current user is not a server admin or
if it is a project-local web-app and the current user is not a project admin.uninstallWebApp(String, String, WebAppId)
@NotNull InputStream downloadWebApp(WebAppId webAppId) throws IOException
.war
-file.webAppId
- identifies the web-app to download..war
-fileIOException
- if any io related operation fails.SecurityException
- if the web-app is global and the current user is not a server admin or
if it is a project-local web-app and the current user is not a project admin.boolean deployWebApp(@NotNull WebAppId webAppId)
webAppId
- identifies web-app to deploy.true
if the web-app could be deployed.SecurityException
- if the web-app is global and the current user is not a server admin or
if it is a project-local web-app and the current user is not a project admin.boolean deployWebApps(@NotNull Iterable<WebAppId> webAppIds)
webAppIds
- web-apps to deploy.true
if all web-apps could be deployed.SecurityException
- if one (or more) web-app is global and the current user is not a server admin or
if one (or more) web-app is project-local and the current user is not a project admin.@NotNull FileSystem<?> getWebAppConfig(String moduleName, String webAppComponent, WebAppId webAppId)
webAppId
- identifies the web-app.SecurityException
- if the web-app is global and the current user is not a server admin or
if it is a project-local web-app and the current user is not a project admin.boolean undeployWebApp(WebAppId webAppId)
webAppId
- identifies web-app to undeploy.true
if the web-app could be undeployed.SecurityException
- if the web-app is global and the current user is not a server admin or
if it is a project-local web-app and the current user is not a project admin.@NotNull Collection<WebAppId> getWebAppUsages(String moduleName, String webAppComponent)
moduleName
- name of the module containing the web-app component.webAppComponent
- web-app component name.SecurityException
- if a used web-app is project-local and the user does has no access to that project.void uninstallWebApp(String moduleName, String webAppComponent, WebAppId webAppId) throws ModuleException
moduleName
- name of the module containing the web-app component.webAppComponent
- web-app component name.webAppId
- target web-app.SecurityException
- if the web-app is global and the current user is not a server admin or
if it is a project-local web-app and the current user is not a project admin.ModuleException
installWebApp(String, String, WebAppId)
GlobalWebAppId createGlobalWebApp(String globalWebAppId, String contextName, String name)
deploy
this new web-app, a web-server instance
must be set, using ServerConfiguration
.globalWebAppId
- new global web-app identifier.contextName
- web-server context where to install the web-app.name
- name of this global web-app, visible in the FirstSpirit ServerManager.SecurityException
- if the current user is not a server adminremoveGlobalWebApp(GlobalWebAppId)
@NotNull Collection<GlobalWebAppId> getGlobalWebApps()
@NotNull Collection<GlobalWebAppId> getGlobalWebApps(boolean includeSystem)
includeSystem
- If true
the system apps are included.void removeGlobalWebApp(GlobalWebAppId globalWebAppId)
globalWebAppId
- global web-app identifier.SecurityException
- if the current user is not a server admincreateGlobalWebApp(String, String, String)
@NotNull String getInstalledVersion(String moduleName) throws IllegalArgumentException
moduleName
- name of module to look for.IllegalArgumentException
- if the module couldn't be found@NotNull Collection<ModuleDescriptor> getModules()
void startService(String serviceName) throws ServiceNotFoundException
serviceName
.serviceName
- service nameServiceNotFoundException
- if the specified service couldn't be found.SecurityException
- if the current user is not a server adminboolean isAutostart(String serviceName)
true
if the given service is automatically started after FirstSpirit server start.serviceName
- service to check.true
if autostart is enabledboolean isRunning(String serviceName)
true
if the given service is currently running.serviceName
- service to check.true
if the service is running.boolean setAutostart(String serviceName, boolean autostart)
serviceName
- service to set.autostart
- flag.SecurityException
- if the current user is not a server adminvoid stopService(String serviceName) throws ServiceNotFoundException
serviceName
.serviceName
- service nameServiceNotFoundException
- if the specified service couldn't be found.SecurityException
- if the current user is not a server adminCopyright © 2021 e-Spirit AG. All Rights Reserved. Build 5.2.210210