Interface IInstallMechanics
- All Superinterfaces:
IComponent
,IInitializable
,IMechanics
,ISystemHandler
Base interface for all install mechanics.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionboolean
canInstallComponent
(IThingID userId, String componentLocation, Map<?, ?> capabilities) Returns true if the component can be installed, false if cannot beboolean
canInstallComponents
(IThingID userId, Map<?, ?> capabilities) Returns true if the specified user can install components.boolean
canUninstallComponent
(IURI componentURI, IThingID userId, Map<?, ?> capabilities) Returns true if the specified user can uninstall a specified component.void
checkInstallComponent
(IThingID userId, String componentLocation, Map<?, ?> capabilities) Checks the user can install this component.void
checkInstallComponents
(IThingID userId, Map<?, ?> capabilities) Checks the user has rights to install components.void
checkUninstallComponent
(IURI componentURI, IThingID userId, Map<?, ?> capabilities) Checks the user has rights to uninstall a specified component.void
fireDeployComponentEvent
(IThingID userId, String componentName, String componentLocation) void
fireInstallComponentEvent
(IThingID userId, int status, IURI componentUri) Fires an install component event.void
fireUndeployComponentEvent
(IThingID userId, String componentName, String componentLocation) void
fireUninstallComponentEvent
(IThingID userId, int status, IURI componentUri, IURI containerUri) Fires an uninstall component event.getComponentLocation
(IURI componentUri) Returns component location based on urigetComponentProperties
(String componentLocation) Extracts map of properties out of component package filegetComponentURI
(String componentName) Returns registered component uri from the given component nameReturns current deploy folder name/timevoid
initInstallContext
(String componentLocation, Map<String, Object> installProperties) void
Installs new component from a specfied component file locationvoid
Installs new component the same way asinstallComponent(java.lang.String, com.webmethods.portal.service.meta2.thing.IThingID, java.util.Map<java.lang.String, java.lang.Object>)
, but if the installation fails it tries to clean up the system using the following approach: If it was fresh install, it tries to uninstall the failed component If if was upgrade, it tries to reinstall previously installed version Then it throws original install failure exceptionboolean
isUptodate
(String componentFileNameInDeployFolder) Deprecated.boolean
isUptodate
(String componentFileNameInDeployFolder, File deployDir, String deployMap) Checks whether the component file in the deploy folder is up-to-dateregisterComponent
(String componentLocation, IThingID userId) Registers component in the content store and returns content thing idvoid
Reinstalls (repairs) a specified componentvoid
releaseInstallContext
(String componentLocation) void
Uninstalls a specified componentvoid
unregisterComponent
(String componentName) Unregisters component from the content storeMethods inherited from interface com.webmethods.portal.system.IComponent
getComponentData, getComponentName, getComponentProvider, getURI, isInitialized, setComponentData, setComponentProvider
Methods inherited from interface com.webmethods.portal.system.init.IInitializable
init, shutdown
-
Field Details
-
FOLDER_INSTALL
- See Also:
-
FOLDER_INSTALL_COMPONENTS_DATA
- See Also:
-
CONTEXT_COMPONENT_PROPERTIES
- See Also:
-
-
Method Details
-
canInstallComponents
Returns true if the specified user can install components.- Parameters:
userId
- the usercapabilities
- the capabilites map- Throws:
PortalException
-
checkInstallComponents
void checkInstallComponents(IThingID userId, Map<?, ?> capabilities) throws PortalException, PortalAccessExceptionChecks the user has rights to install components. Throws PortalAccessException if the user has no rights- Parameters:
userId
- the usercapabilities
- the capabilites map- Throws:
PortalException
PortalAccessException
-
canInstallComponent
boolean canInstallComponent(IThingID userId, String componentLocation, Map<?, ?> capabilities) throws PortalExceptionReturns true if the component can be installed, false if cannot be- Parameters:
componentLocation
- the component name- Returns:
- true if the component can be installed
- Throws:
PortalException
-
checkInstallComponent
void checkInstallComponent(IThingID userId, String componentLocation, Map<?, ?> capabilities) throws PortalException, PortalAccessExceptionChecks the user can install this component.- Parameters:
componentLocation
-- Throws:
PortalException
PortalAccessException
-
canUninstallComponent
boolean canUninstallComponent(IURI componentURI, IThingID userId, Map<?, ?> capabilities) throws PortalExceptionReturns true if the specified user can uninstall a specified component.- Parameters:
componentURI
- the component item uriuserId
- the usercapabilities
- the capabilites map- Throws:
PortalException
-
checkUninstallComponent
void checkUninstallComponent(IURI componentURI, IThingID userId, Map<?, ?> capabilities) throws PortalException, PortalAccessExceptionChecks the user has rights to uninstall a specified component. Throws PortalAccessException if the user has no rights- Parameters:
componentURI
- the component item uriuserId
- the usercapabilities
- the capabilites map- Throws:
PortalException
PortalAccessException
-
installComponent
void installComponent(String componentLocation, IThingID userId, Map<String, Object> properties) throws PortalExceptionInstalls new component from a specfied component file location- Parameters:
componentLocation
- the component file locationuserId
- the userproperties
- deployment properties, may be null- Throws:
PortalException
-
installComponentSafe
void installComponentSafe(String componentLocation, IThingID userId, Map<String, Object> properties) throws PortalException, UnsatisfiedComponentDependencyException, InstallationFailedException, InstallationWarningExceptionInstalls new component the same way asinstallComponent(java.lang.String, com.webmethods.portal.service.meta2.thing.IThingID, java.util.Map<java.lang.String, java.lang.Object>)
, but if the installation fails it tries to clean up the system using the following approach:- If it was fresh install, it tries to uninstall the failed component
- If if was upgrade, it tries to reinstall previously installed version
- Parameters:
componentLocation
- the component file locationuserId
- the userproperties
- deployment properties, may be null- Throws:
PortalException
UnsatisfiedComponentDependencyException
InstallationFailedException
InstallationWarningException
-
uninstallComponent
void uninstallComponent(String componentLocation, IThingID userId, Map<String, Object> properties) throws PortalException, InstallationFailedException, InstallationWarningExceptionUninstalls a specified component- Parameters:
componentLocation
- the component file locationuserId
- the userproperties
- deployment properties, may be null- Throws:
PortalException
InstallationFailedException
InstallationWarningException
-
getComponentLocation
Returns component location based on uri- Parameters:
componentUri
-- Returns:
- component file location
- Throws:
PortalException
-
getComponentURI
Returns registered component uri from the given component name- Parameters:
componentName
- the name of the component- Returns:
- uri or null if not found
- Throws:
PortalException
-
reinstallComponent
void reinstallComponent(IURI componentUri, IThingID userId, Map<String, Object> properties) throws PortalExceptionReinstalls (repairs) a specified component- Parameters:
componentUri
- the component to reinstalluserId
- the userproperties
- deployment properties, may be null- Throws:
PortalException
-
fireDeployComponentEvent
void fireDeployComponentEvent(IThingID userId, String componentName, String componentLocation) throws PortalException - Throws:
PortalException
-
fireUndeployComponentEvent
void fireUndeployComponentEvent(IThingID userId, String componentName, String componentLocation) throws PortalException - Throws:
PortalException
-
fireInstallComponentEvent
void fireInstallComponentEvent(IThingID userId, int status, IURI componentUri) throws PortalException Fires an install component event.- Parameters:
userId
- the user.status
- Status of the event (sucessful, denied, error).componentUri
- installed component uri.- Throws:
PortalException
-
fireUninstallComponentEvent
void fireUninstallComponentEvent(IThingID userId, int status, IURI componentUri, IURI containerUri) throws PortalException Fires an uninstall component event.- Parameters:
userId
- the userstatus
- Status of the event (sucessful, denied, error).componentUri
- uninstalled component uri.- Throws:
PortalException
-
registerComponent
Registers component in the content store and returns content thing id- Parameters:
componentLocation
- component locationuserId
- current user- Returns:
- thing id of the created content item
- Throws:
PortalException
-
unregisterComponent
Unregisters component from the content store- Parameters:
componentName
- the previously registered component name- Throws:
PortalException
-
releaseInstallContext
-
initInstallContext
void initInstallContext(String componentLocation, Map<String, Object> installProperties) throws PortalException- Throws:
PortalException
-
getComponentProperties
Extracts map of properties out of component package file- Parameters:
componentLocation
- the component file location- Returns:
- map with properties
- Throws:
PortalException
-
isUptodate
Deprecated.UseIInstallMechanics#isUptodate(String, File)
Checks whether the component file in the deploy folder is up-to-date- Parameters:
componentFileNameInDeployFolder
-- Returns:
- false if not uptodate and needs redeployment
- Throws:
PortalException
-
isUptodate
Checks whether the component file in the deploy folder is up-to-date- Parameters:
componentFileNameInDeployFolder
-deployDir
-deployMap
-- Returns:
- Throws:
PortalException
-
getDeployMap
Returns current deploy folder name/time- Returns:
- Throws:
PortalException
-
IInstallMechanics#isUptodate(String, File)