Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "COSMOS Design 275731"
(→Requirements) |
(→Open Issues/Questions) |
||
(4 intermediate revisions by the same user not shown) | |||
Line 73: | Line 73: | ||
package org.eclipse.cosmos.me.sdd.advisor; | package org.eclipse.cosmos.me.sdd.advisor; | ||
− | + | public class InstalledProductHandler implements IResourceHandler { | |
− | + | static final QName IP = new QName("http://docs.oasis-open.org/sdd/ns/cim-profile", "CIM_InstalledProduct"); | |
− | + | static final QName IP_PNAME = new QName("http://docs.oasis-open.org/sdd/ns/cim-profile", "CIM_InstalledProduct.ProductName"); | |
− | + | static final QName IP_PVENDOR = new QName("http://docs.oasis-open.org/sdd/ns/cim-profile", "CIM_InstalledProduct.ProductVendor"); | |
− | + | static final QName IP_PVERSION = new QName("http://docs.oasis-open.org/sdd/ns/cim-profile", "CIM_InstalledProduct.ProductVersion"); | |
− | + | ||
− | + | // vendor = {0}, product = {1}, version = {2} | |
− | + | static final String WIN_1 = "{0}\\{1}\\{2}"; // vendor\product\version | |
+ | static final String WIN_2 = "{1}\\{2}"; // product\version | ||
+ | static final String WIN_3 = "{1}-{2}"; // product-version | ||
+ | static final String WIN_4 = "{0}\\{1}{2}"; // vendor\productversion | ||
+ | static final String WIN_5 = "{0}\\{1}-{2}"; // vendor\product-version | ||
+ | static final String WIN_6 = "{1}{2}"; // productversion | ||
+ | |||
+ | |||
+ | static final String UNIX_1 = "{0}/{1}/{2}"; // vendor/product/version | ||
+ | static final String UNIX_2 = "{1}/{2}"; // product/version | ||
+ | static final String UNIX_3 = "{1}-{2}"; // product-version | ||
+ | static final String UNIX_4 = "{0}/{1}{2}"; // vendor/productversion | ||
+ | static final String UNIX_5 = "{0}/{1}-{2}"; // vendor/product-version | ||
+ | static final String UNIX_6 = "{1}{2}"; // productversion | ||
+ | |||
+ | String [] unixRoots = new String [] {"/opt/", "/usr/local/"}; | ||
+ | String [] unixPatterns = new String [] {UNIX_1, UNIX_2, UNIX_3, UNIX_4, UNIX_5, UNIX_6}; | ||
+ | |||
+ | String [] winRoots = new String [] {"C:", "C:\\Program Files"}; | ||
+ | String [] winPatterns = new String [] {WIN_1, WIN_2, WIN_3, WIN_4, WIN_5, WIN_6}; | ||
+ | |||
</source> | </source> | ||
− | ** The | + | ** The InstalledProductHandler uses various pattern matches to determine if a product is installed on the target host. |
− | ** The | + | ** The InstalledProductHandler searches well know locations as defined by work done by the Filesystem Hierarchy Standard Group. Reference to this work is provided [http://www.pathname.com/fhs/pub/fhs-2.3.pdf here]. |
− | + | ||
− | + | ||
− | + | ||
=Impacts of this enhancement= | =Impacts of this enhancement= | ||
− | * The SDD runtime will be able to | + | * The SDD runtime will be able to resolve a deployment descriptor that defines an installed product. |
=Open Issues/Questions= | =Open Issues/Questions= | ||
− | + | Currently, the resolution of installed products on Windows platforms is handled in the same architecturally way as on Linux. An extension of this design would be to provide JNI libraries that can query the Windows Registry for the information. This could be a possible replacement for the current implementation strategy for Windows or an augmentation that allows for multiple ways to detect installed products on a host machine. | |
[[Category:COSMOS_Bugzilla_Designs]] | [[Category:COSMOS_Bugzilla_Designs]] |
Latest revision as of 11:35, 18 May 2009
Contents
Resource Handler to check for installed products
This is the design document for bugzilla 275731.
Change History
Name: | Date: | Revised Sections: |
---|---|---|
Jeff Hamm | May 18, 2009 |
|
Workload Estimation
Process | Sizing | Names of people doing the work |
---|---|---|
Design | 1 | Jeff Hamm |
Code | 1 | Jeff Hamm |
Test | 1 | Jeff Hamm |
Documentation | 0 | |
Build and infrastructure | 0 | |
Code review, etc.* | 1 | |
TOTAL | 4 |
'* - includes other committer work (e.g. check-in, contribution tracking)
Purpose
This enhancement will provide a basic resource handler that can discover if an application as described by the SDD is installed on the system the runtime is interacting with.
Requirements
- The InstalledProductHandler must implement the IResourceHandler from the org.eclipse.cosmos.me.sdd.cr bundle.
- The IResourceHandler class is an interface that the runtime uses to load and run bundles dynamically. The IResourceHandler uses the CIM QName as defined by the component.xml data for the implemented handler as the way the ResourceHandler will discover and run the bundle.
- The InstalledProductHandler will discover products installed on both Windows and Linux platform types.
- Based on the current CIM profile, the InstalledProductHandler will recognize the following types as defined in the CIM_InstalledProduct schema:
- CIM_InstalledProduct.ProductName
- CIM_InstalledProduct.ProductVersion
- CIM_InstalledProduct.ProductVendor
Design details
- InstalledProductHandler
- The InstalledProductHandler will be introduced into the "org.eclipse.cosmos.me.sdd.cim.profile" project in eclipse CVS.
package org.eclipse.cosmos.me.sdd.advisor; public class InstalledProductHandler implements IResourceHandler { static final QName IP = new QName("http://docs.oasis-open.org/sdd/ns/cim-profile", "CIM_InstalledProduct"); static final QName IP_PNAME = new QName("http://docs.oasis-open.org/sdd/ns/cim-profile", "CIM_InstalledProduct.ProductName"); static final QName IP_PVENDOR = new QName("http://docs.oasis-open.org/sdd/ns/cim-profile", "CIM_InstalledProduct.ProductVendor"); static final QName IP_PVERSION = new QName("http://docs.oasis-open.org/sdd/ns/cim-profile", "CIM_InstalledProduct.ProductVersion"); // vendor = {0}, product = {1}, version = {2} static final String WIN_1 = "{0}\\{1}\\{2}"; // vendor\product\version static final String WIN_2 = "{1}\\{2}"; // product\version static final String WIN_3 = "{1}-{2}"; // product-version static final String WIN_4 = "{0}\\{1}{2}"; // vendor\productversion static final String WIN_5 = "{0}\\{1}-{2}"; // vendor\product-version static final String WIN_6 = "{1}{2}"; // productversion static final String UNIX_1 = "{0}/{1}/{2}"; // vendor/product/version static final String UNIX_2 = "{1}/{2}"; // product/version static final String UNIX_3 = "{1}-{2}"; // product-version static final String UNIX_4 = "{0}/{1}{2}"; // vendor/productversion static final String UNIX_5 = "{0}/{1}-{2}"; // vendor/product-version static final String UNIX_6 = "{1}{2}"; // productversion String [] unixRoots = new String [] {"/opt/", "/usr/local/"}; String [] unixPatterns = new String [] {UNIX_1, UNIX_2, UNIX_3, UNIX_4, UNIX_5, UNIX_6}; String [] winRoots = new String [] {"C:", "C:\\Program Files"}; String [] winPatterns = new String [] {WIN_1, WIN_2, WIN_3, WIN_4, WIN_5, WIN_6};
- The InstalledProductHandler uses various pattern matches to determine if a product is installed on the target host.
- The InstalledProductHandler searches well know locations as defined by work done by the Filesystem Hierarchy Standard Group. Reference to this work is provided here.
Impacts of this enhancement
- The SDD runtime will be able to resolve a deployment descriptor that defines an installed product.
Open Issues/Questions
Currently, the resolution of installed products on Windows platforms is handled in the same architecturally way as on Linux. An extension of this design would be to provide JNI libraries that can query the Windows Registry for the information. This could be a possible replacement for the current implementation strategy for Windows or an augmentation that allows for multiple ways to detect installed products on a host machine.