public interface IInstallMechanics extends IMechanics
Modifier and Type | Field and Description |
---|---|
static String |
CONTEXT_COMPONENT_PROPERTIES |
static String |
FOLDER_INSTALL |
static String |
FOLDER_INSTALL_COMPONENTS_DATA |
Modifier and Type | Method and Description |
---|---|
boolean |
canInstallComponent(IThingID userId,
String componentLocation,
Map<?,?> capabilities)
Returns true if the component can be installed, false if cannot be
|
boolean |
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.
|
String |
getComponentLocation(IURI componentUri)
Returns component location based on uri
|
Map<String,Object> |
getComponentProperties(String componentLocation)
Extracts map of properties out of component package file
|
IURI |
getComponentURI(String componentName)
Returns registered component uri from the given component name
|
Map<String,String> |
getDeployMap()
Returns current deploy folder name/time
|
void |
initInstallContext(String componentLocation,
Map<String,Object> installProperties) |
void |
installComponent(String componentLocation,
IThingID userId,
Map<String,Object> properties)
Installs new component from a specfied component file location
|
void |
installComponentSafe(String componentLocation,
IThingID userId,
Map<String,Object> properties)
Installs new component the same way as
installComponent(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 exception |
boolean |
isUptodate(String componentFileNameInDeployFolder)
Deprecated.
Use
IInstallMechanics#isUptodate(String, File) |
boolean |
isUptodate(String componentFileNameInDeployFolder,
File deployDir,
String deployMap)
Checks whether the component file in the deploy folder is up-to-date
|
IThingID |
registerComponent(String componentLocation,
IThingID userId)
Registers component in the content store and returns content thing id
|
void |
reinstallComponent(IURI componentUri,
IThingID userId,
Map<String,Object> properties)
Reinstalls (repairs) a specified component
|
void |
releaseInstallContext(String componentLocation) |
void |
uninstallComponent(String componentLocation,
IThingID userId,
Map<String,Object> properties)
Uninstalls a specified component
|
void |
unregisterComponent(String componentName)
Unregisters component from the content store
|
getComponentData, getComponentName, getComponentProvider, getURI, isInitialized, setComponentData, setComponentProvider
init, shutdown
static final String FOLDER_INSTALL
static final String FOLDER_INSTALL_COMPONENTS_DATA
static final String CONTEXT_COMPONENT_PROPERTIES
boolean canInstallComponents(IThingID userId, Map<?,?> capabilities) throws PortalException
userId
- the usercapabilities
- the capabilites mapPortalException
void checkInstallComponents(IThingID userId, Map<?,?> capabilities) throws PortalException, PortalAccessException
userId
- the usercapabilities
- the capabilites mapPortalException
PortalAccessException
boolean canInstallComponent(IThingID userId, String componentLocation, Map<?,?> capabilities) throws PortalException
componentLocation
- the component namePortalException
void checkInstallComponent(IThingID userId, String componentLocation, Map<?,?> capabilities) throws PortalException, PortalAccessException
componentLocation
- PortalException
PortalAccessException
boolean canUninstallComponent(IURI componentURI, IThingID userId, Map<?,?> capabilities) throws PortalException
componentURI
- the component item uriuserId
- the usercapabilities
- the capabilites mapPortalException
void checkUninstallComponent(IURI componentURI, IThingID userId, Map<?,?> capabilities) throws PortalException, PortalAccessException
componentURI
- the component item uriuserId
- the usercapabilities
- the capabilites mapPortalException
PortalAccessException
void installComponent(String componentLocation, IThingID userId, Map<String,Object> properties) throws PortalException
componentLocation
- the component file locationuserId
- the userproperties
- deployment properties, may be nullPortalException
void installComponentSafe(String componentLocation, IThingID userId, Map<String,Object> properties) throws PortalException, UnsatisfiedComponentDependencyException, InstallationFailedException, InstallationWarningException
installComponent(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:
componentLocation
- the component file locationuserId
- the userproperties
- deployment properties, may be nullPortalException
UnsatisfiedComponentDependencyException
InstallationFailedException
InstallationWarningException
void uninstallComponent(String componentLocation, IThingID userId, Map<String,Object> properties) throws PortalException, InstallationFailedException, InstallationWarningException
componentLocation
- the component file locationuserId
- the userproperties
- deployment properties, may be nullPortalException
InstallationFailedException
InstallationWarningException
String getComponentLocation(IURI componentUri) throws PortalException
componentUri
- PortalException
IURI getComponentURI(String componentName) throws PortalException
componentName
- the name of the componentPortalException
void reinstallComponent(IURI componentUri, IThingID userId, Map<String,Object> properties) throws PortalException
componentUri
- the component to reinstalluserId
- the userproperties
- deployment properties, may be nullPortalException
void fireDeployComponentEvent(IThingID userId, String componentName, String componentLocation) throws PortalException
PortalException
void fireUndeployComponentEvent(IThingID userId, String componentName, String componentLocation) throws PortalException
PortalException
void fireInstallComponentEvent(IThingID userId, int status, IURI componentUri) throws PortalException
userId
- the user.status
- Status of the event (sucessful, denied, error).componentUri
- installed component uri.PortalException
void fireUninstallComponentEvent(IThingID userId, int status, IURI componentUri, IURI containerUri) throws PortalException
userId
- the userstatus
- Status of the event (sucessful, denied, error).componentUri
- uninstalled component uri.PortalException
IThingID registerComponent(String componentLocation, IThingID userId) throws PortalException
componentLocation
- component locationuserId
- current userPortalException
void unregisterComponent(String componentName) throws PortalException
componentName
- the previously registered component namePortalException
void releaseInstallContext(String componentLocation)
void initInstallContext(String componentLocation, Map<String,Object> installProperties) throws PortalException
PortalException
Map<String,Object> getComponentProperties(String componentLocation) throws PortalException
componentLocation
- the component file locationPortalException
boolean isUptodate(String componentFileNameInDeployFolder) throws PortalException
IInstallMechanics#isUptodate(String, File)
componentFileNameInDeployFolder
- PortalException
boolean isUptodate(String componentFileNameInDeployFolder, File deployDir, String deployMap) throws PortalException
componentFileNameInDeployFolder
- deployDir
- deployMap
- PortalException
Map<String,String> getDeployMap() throws PortalException
PortalException