public class DeploymentManager extends Object implements IDeploymentManagerSPI
Constructor and Description |
---|
DeploymentManager() |
Modifier and Type | Method and Description |
---|---|
void |
changeComponentResolved(String componentId,
ITransaction transaction)
Changes the resolved value of the component based on the given component
identifier.
|
void |
changeModuleResolved(String moduleId,
ITransaction transaction)
Changes the resolved value of the module based on the given module
identifier.
|
protected void |
clearComponentChannel(IComponent component) |
IDeploymentExecutionPlan |
createModuleDeploymentExecutionPlan(IFile moduleFolder,
boolean forceReprocess,
boolean syncStructure)
Creates, validates and returns a module deployment execution plan.
|
IDeploymentExecutionPlan |
createModuleDeploymentExecutionPlan(IFile moduleFolder,
boolean forceReprocess,
boolean syncStructure,
boolean wasClosedModule)
Creates, validates and returns a module deployment execution plan.
|
IDeploymentExecutionPlan |
createModuleDeploymentProcess(InputStream moduleArchive,
boolean reprocessAllComponents)
Creates a
deployment execution plan for
deploying the given module. |
IDeploymentExecutionPlan |
createModuleUndeploymentProcess(List<IModule> modules)
Creates a
deployment execution plan for
undeployment of the given modules. |
IDeploymentExecutionPlan |
createPackageDeploymentProcess(File packageArchive,
boolean reprocessAllComponents)
Creates a
deployment execution plan for
deploying the given package. |
IDeploymentExecutionPlan |
createPackageDeploymentProcess(File packageArchive,
boolean reprocessAllComponents,
boolean syncStructure)
Creates a
deployment execution plan for
deploying the given package. |
void |
deployModuleSource(IFile moduleFolder)
Deploys the module referenced in the File parameter
|
void |
deployModuleSource(IFile moduleFolder,
boolean syncStructure)
Deploys the module referenced in the File parameter
|
void |
deployModuleSource(IModule module)
Deploys the module passed as a parameter.
|
void |
destroy()
Destroys the Deployment Manager.
|
ModuleType |
detectModuleType(InputStream moduleArchive)
Detects the module type of an archive, based on its contents.
|
IComponent |
getChannelComponent(String channelId)
Returns the component associated to the channel.
|
Class<?> |
getClass(String className)
Deprecated.
|
ClassLoader |
getClassLoader()
Returns a class loader that provides access to classes and resources
in all deployed JAR modules and the portal.
|
IComponent |
getComponent(String componentId)
Returns the component with the specified identifier.
|
List<IComponent> |
getComponents()
Returns the list of all installed components.
|
String |
getLastDeployInstallationId()
Returns the Last Deploy Installation identifier.
|
IModule |
getModule(String moduleId)
Returns the module with the specified identifier.
|
Collection<IModule> |
getModules(ModuleType moduleType)
Returns the currently installed modules of the specified type.
|
IPortalDeployer |
getPortalDeployer(DeployConfig deployConfig)
Deprecated.
|
String |
getResourceModuleId(String resource)
Returns the module id for the given resource
|
Set<String> |
getResources(URI basePath,
boolean recursively,
IResourceFilter resourceFilter)
Returns the available resources within the given base path.
|
void |
init()
Initializes the deployment manager.
|
boolean |
isInstallInProgress()
Returns whether a deploy installation is in progress.
|
void |
registerActivityStreamStructure()
Register activity-related structure.
|
void |
registerDeployer(IPortalDeployer deployer)
Deprecated.
|
void |
resetDeployment()
Resets the deployment status (and performs all required actions) to make a new deployment possible.
This method can make the portal unstable. |
String |
submit(IDeploymentExecutionPlan executionPlan)
Submits the
execution plan created by
this manager and returns the created process identifier. |
boolean |
unregisterDeployer(IPortalDeployer deployer)
Deprecated.
|
void |
updateChannelId(String componentId,
String channelId)
Updates the channelId of the given component.
|
void |
updateChannelId(String componentId,
String channelId,
boolean allowUpdateIfChannelBelongsToOtherComponent)
Updates the channelId of the given component.
|
void |
updateClassLoader(Collection<IModule> modulesToBeAdded,
Collection<IModule> modulesToBeRemoved,
ModuleDiff diff,
boolean forceReprocess)
Updates the portal classloader over the cluster..
|
@Deprecated public void registerDeployer(IPortalDeployer deployer)
IDeploymentManager
registerDeployer
in interface IDeploymentManager
deployer
- the deployer.@Deprecated public boolean unregisterDeployer(IPortalDeployer deployer)
IDeploymentManager
unregisterDeployer
in interface IDeploymentManager
deployer
- the deployer.@Deprecated public IPortalDeployer getPortalDeployer(DeployConfig deployConfig) throws PortalException
IDeploymentManager
getPortalDeployer
in interface IDeploymentManager
deployConfig
- the deployment specification.PortalException
- if there is no deployer that can handle the
specified deployment.public void init()
@Deprecated public Class<?> getClass(String className) throws ClassNotFoundException
IDeploymentManager
Class
object associated with the class or
interface with the given string name, within the deployed JAR library
modules or the shared level class loader.getClass
in interface IDeploymentManager
className
- the fully qualified name of the desired class.Class
object for the class with the specified name.ClassNotFoundException
- if the class cannot be located.Class#forName(String)}
public ClassLoader getClassLoader()
IDeploymentManager
When the returned class loader is used to obtain a class, the search is first done in the currently running modules and then in the portal main class loader.
When the returned class loader is used to obtain a resource,
the search is first done in the lumisdata/def
folder
(for backwards compatibility), then in currently running modules and
then in the portal main class loader.
Main uses are:
ClassLoader.loadClass(String)
: for obtaining a Class
.ClassLoader.getResourceAsStream(String)
, ClassLoader.getResource(String)
or ClassLoader.getResources(String)
:
for accessing resources.getClassLoader
in interface IDeploymentManager
public ModuleType detectModuleType(InputStream moduleArchive) throws IOException, IllegalModuleArchiveException
IDeploymentManager
detectModuleType
in interface IDeploymentManager
moduleArchive
- the archive content input stream.IOException
- if an I/O error occurs.IllegalModuleArchiveException
- if the archive module type
could not be recognized.public Collection<IModule> getModules(ModuleType moduleType) throws PortalException
IDeploymentManager
getModules
in interface IDeploymentManager
moduleType
- the module type.PortalException
public IModule getModule(String moduleId) throws PortalException
IDeploymentManager
getModule
in interface IDeploymentManager
moduleId
- the module identifier.PortalObjectNotFoundException
- if no module with the given
identifier was found.PortalException
public IDeploymentExecutionPlan createModuleDeploymentProcess(InputStream moduleArchive, boolean reprocessAllComponents) throws IllegalModuleArchiveException, PortalException
IDeploymentManager
deployment execution plan
for
deploying the given module. The returned Process
is not
yet ready to be executed.createModuleDeploymentProcess
in interface IDeploymentManager
moduleArchive
- the module archive input stream.reprocessAllComponents
- indicates if all components present in the module must be
reprocessed.IllegalModuleArchiveException
- if the given archive is not a valid module archive.PortalException
IDeploymentManager.submit(IDeploymentExecutionPlan)
public IDeploymentExecutionPlan createPackageDeploymentProcess(File packageArchive, boolean reprocessAllComponents) throws IllegalPackageArchiveException, PortalException
IDeploymentManager
deployment execution plan
for
deploying the given package.createPackageDeploymentProcess
in interface IDeploymentManager
packageArchive
- the package file.reprocessAllComponents
- indicates if all components present in the package must be
reprocessed.IllegalPackageArchiveException
- if the given archive is not a valid package archive.PortalException
IDeploymentManager.submit(IDeploymentExecutionPlan)
public IDeploymentExecutionPlan createPackageDeploymentProcess(File packageArchive, boolean reprocessAllComponents, boolean syncStructure) throws IllegalPackageArchiveException, PortalException
IDeploymentManagerSPI
deployment execution plan
for
deploying the given package.createPackageDeploymentProcess
in interface IDeploymentManagerSPI
packageArchive
- the package file.reprocessAllComponents
- indicates if all components present in the package must be
reprocessed.syncStructure
- indicates whether the components structures will be
synchronized if modified.IllegalPackageArchiveException
- if the given archive is not a valid package archive.PortalException
IDeploymentManager.submit(IDeploymentExecutionPlan)
public IDeploymentExecutionPlan createModuleUndeploymentProcess(List<IModule> modules) throws PortalException
IDeploymentManager
deployment execution plan
for
undeployment of the given modules.createModuleUndeploymentProcess
in interface IDeploymentManager
modules
- the modules to be undeployed.PortalException
IDeploymentManager.submit(IDeploymentExecutionPlan)
public String submit(IDeploymentExecutionPlan executionPlan) throws PortalException
IDeploymentManager
execution plan
created by
this manager and returns the created process
identifier.submit
in interface IDeploymentManager
executionPlan
- the execution plan.process
identifier.PortalException
public String getLastDeployInstallationId() throws PortalException
IDeploymentManagerSPI
getLastDeployInstallationId
in interface IDeploymentManagerSPI
PortalException
- if any error occurs during the process.public boolean isInstallInProgress() throws PortalException
IDeploymentManagerSPI
isInstallInProgress
in interface IDeploymentManagerSPI
PortalException
- if any error occurs during the process.public List<IComponent> getComponents() throws PortalException
IDeploymentManagerSPI
getComponents
in interface IDeploymentManagerSPI
PortalException
- if any error occurs during the process.public IComponent getComponent(String componentId) throws PortalException
IDeploymentManager
getComponent
in interface IDeploymentManager
componentId
- the component identifier.PortalObjectNotFoundException
- if no component with the given
identifier was found.PortalException
public void changeComponentResolved(String componentId, ITransaction transaction) throws PortalException
IDeploymentManagerSPI
changeComponentResolved
in interface IDeploymentManagerSPI
componentId
- the component identifier to be changes the signal value.transaction
- the transaction to be used to change the component signal
value.PortalException
- if any error occurs during the process.PortalObjectNotFoundException
- if the component cannot be located.public void changeModuleResolved(String moduleId, ITransaction transaction) throws PortalException
IDeploymentManagerSPI
changeModuleResolved
in interface IDeploymentManagerSPI
moduleId
- the module identifier to be changes the signal value.transaction
- the transaction to be used to change the module signal value.PortalException
- if any error occurs during the process.PortalObjectNotFoundException
- if the module cannot be located.public void updateChannelId(String componentId, String channelId) throws PortalException
IDeploymentManagerSPI
PortalException
will be
raised.updateChannelId
in interface IDeploymentManagerSPI
componentId
- the component identifier to be updated.channelId
- the channelId to be assigned.PortalException
- if any error occurs during the process.public IComponent getChannelComponent(String channelId) throws PortalException
IDeploymentManagerSPI
getChannelComponent
in interface IDeploymentManagerSPI
channelId
- the channel of the component searching for.PortalException
public void updateChannelId(String componentId, String channelId, boolean allowUpdateIfChannelBelongsToOtherComponent) throws PortalException
IDeploymentManagerSPI
PortalException
will be raised only if allowUpdateIfChannelBelongsToOtherComponent is set to false.updateChannelId
in interface IDeploymentManagerSPI
componentId
- the component identifier to be updated.channelId
- the channelId to be assigned.allowUpdateIfChannelBelongsToOtherComponent
- true if the update is to be performed even if there is another
component associated to the channel. In this case, that component will no longer be associated with the channel.PortalException
- if any error occurs during the process.protected void clearComponentChannel(IComponent component) throws IOException
IOException
public IDeploymentExecutionPlan createModuleDeploymentExecutionPlan(IFile moduleFolder, boolean forceReprocess, boolean syncStructure) throws PortalException
IDeploymentManagerSPI
createModuleDeploymentExecutionPlan
in interface IDeploymentManagerSPI
moduleFolder
- the folder that corresponds to the module root.forceReprocess
- indicates if must reprocess the module and its components.syncStructure
- indicates whether the components structures will be
synchronized if modified.PortalException
- if any error occurs during the process.public IDeploymentExecutionPlan createModuleDeploymentExecutionPlan(IFile moduleFolder, boolean forceReprocess, boolean syncStructure, boolean wasClosedModule) throws PortalException
IDeploymentManagerSPI
createModuleDeploymentExecutionPlan
in interface IDeploymentManagerSPI
moduleFolder
- the folder that corresponds to the module root.forceReprocess
- indicates if must reprocess the module and its components.syncStructure
- indicates whether the components structures will be
synchronized if modified.wasClosedModule
- Indicates whether the given module was closed before calling this method.PortalException
- if any error occurs during the process.public void deployModuleSource(IModule module) throws PortalException
deployModuleSource
in interface IDeploymentManagerSPI
module
- the module that needs to be deployed.PortalException
public void deployModuleSource(IFile moduleFolder) throws PortalException
deployModuleSource
in interface IDeploymentManagerSPI
PortalException
public void deployModuleSource(IFile moduleFolder, boolean syncStructure) throws PortalException
deployModuleSource
in interface IDeploymentManagerSPI
moduleFolder
- the source folder of module that needs to be deployed.syncStructure
- true if structure should be synchronizedPortalException
public String getResourceModuleId(String resource) throws PortalException
getResourceModuleId
in interface IDeploymentManagerSPI
PortalException
public Set<String> getResources(URI basePath, boolean recursively, IResourceFilter resourceFilter) throws PortalException
IDeploymentManagerSPI
It is important to notice that the given base path must include
a scheme
, which will be used to decide how and
where the resources will be searched.
getResources
in interface IDeploymentManagerSPI
basePath
- the base path to be used as root of search.recursively
- indicates whether the search will be recursive.resourceFilter
- optional resource filter to limit the resources returned.PortalException
public void resetDeployment() throws PortalException
IDeploymentManagerSPI
resetDeployment
in interface IDeploymentManagerSPI
PortalException
public void updateClassLoader(Collection<IModule> modulesToBeAdded, Collection<IModule> modulesToBeRemoved, ModuleDiff diff, boolean forceReprocess)
modulesToBeAdded
- the modules to be added in portal classloader.modulesToBeRemoved
- the modules to be removed from portal classloader.diff
- the module diff.forceReprocess
- indicates if reprocessing should be forced.public void destroy()
IDeploymentManagerSPI
destroy
in interface IDeploymentManagerSPI
public void registerActivityStreamStructure() throws PortalException
PortalException
LumisXP 12.0.0.190809 - Copyright © 2006–2019 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.