Skip to main content

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.

Jump to: navigation, search

Difference between revisions of "COSMOS Design 275881"

(New page: = Resource Handler to check for installed products = This is the design document for [http://bugs.eclipse.org/275731 bugzilla 275731]. = Change History = {|{{BMTableStyle}} !align="left"...)
 
Line 1: Line 1:
 
= Resource Handler to check for installed products =
 
= Resource Handler to check for installed products =
  
This is the design document for [http://bugs.eclipse.org/275731 bugzilla 275731].
+
This is the design document for [http://bugs.eclipse.org/275881 bugzilla 275881].
  
 
= Change History =
 
= Change History =
Line 9: Line 9:
 
!align="left"|Revised Sections:
 
!align="left"|Revised Sections:
 
|-
 
|-
|Jeff Hamm
+
|Josh Hester
 
|May 18, 2009
 
|May 18, 2009
 
|<ul><li>Initial version</li></ul>
 
|<ul><li>Initial version</li></ul>
Line 25: Line 25:
 
| align="left" | Design
 
| align="left" | Design
 
| 1
 
| 1
| Jeff Hamm
+
| Josh Hester
 
|-
 
|-
 
| align="left" | Code
 
| align="left" | Code
 
| 1
 
| 1
| Jeff Hamm
+
| Josh Hester
 
|-
 
|-
 
| align="left" | Test
 
| align="left" | Test
 
| 1
 
| 1
| Jeff Hamm
+
| Josh Hester
 
|-
 
|-
 
| align="left" | Documentation
 
| align="left" | Documentation
Line 55: Line 55:
  
 
=Purpose=
 
=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.
+
This resource handler will be used to discover an instance of a postgres server on a machine in order to satisfy its requirement in an SDD.
  
 
=Requirements=
 
=Requirements=
 
* The InstalledProductHandler must implement the IResourceHandler from the org.eclipse.cosmos.me.sdd.cr bundle.
 
* 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 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.
+
* This handler will look for postgres on the current machine only
*Based on the current CIM profile, the InstalledProductHandler will recognize the following types as defined in the CIM_InstalledProduct schema:
+
* This handler will be able to identify postgres and its version on both Windows and Linux
**CIM_InstalledProduct.ProductName
+
**CIM_InstalledProduct.ProductVersion
+
**CIM_InstalledProduct.ProductVendor
+
  
 
=Design details=
 
=Design details=
*InstalledProductHandler
+
* This handler will attempt to determine the OS it is running onIf it is on windows, it will check the windows registry for the key that Postgres uses to identify itself, if it's not found it will look to the default directory it is installed under. If it is linux, it will look for postgres in the /opt and /usr/local directories, following the same pattern as the installed products handler, [[COSMOS_Design_275731]]
** The InstalledProductHandler will be introduced into the "org.eclipse.cosmos.me.sdd.cim.profile" project in eclipse CVS.
+
 
+
<source lang="Java">
+
  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>
+
 
+
** 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 [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 resolve a deployment descriptor that defines an installed product.
+
* The SDD runtime will be able to resolve a deployment descriptor that defines a relational database of postgres.
  
 
=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]]

Revision as of 17:12, 18 May 2009

Resource Handler to check for installed products

This is the design document for bugzilla 275881.

Change History

Name: Date: Revised Sections:
Josh Hester May 18, 2009
  • Initial version

Workload Estimation

Rough workload estimate in person weeks
Process Sizing Names of people doing the work
Design 1 Josh Hester
Code 1 Josh Hester
Test 1 Josh Hester
Documentation 0
Build and infrastructure 0
Code review, etc.* 1
TOTAL 4

'* - includes other committer work (e.g. check-in, contribution tracking)

Purpose

This resource handler will be used to discover an instance of a postgres server on a machine in order to satisfy its requirement in an SDD.

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.
  • This handler will look for postgres on the current machine only
  • This handler will be able to identify postgres and its version on both Windows and Linux

Design details

  • This handler will attempt to determine the OS it is running on. If it is on windows, it will check the windows registry for the key that Postgres uses to identify itself, if it's not found it will look to the default directory it is installed under. If it is linux, it will look for postgres in the /opt and /usr/local directories, following the same pattern as the installed products handler, COSMOS_Design_275731

Impacts of this enhancement

  • The SDD runtime will be able to resolve a deployment descriptor that defines a relational database of postgres.

Open Issues/Questions

Back to the top