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 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 interface IAdvisor{
+
public class InstalledProductHandler implements IResourceHandler {
public Integer requestParameter(IntegerParameterType ipt);
+
static final QName IP = new QName("http://docs.oasis-open.org/sdd/ns/cim-profile", "CIM_InstalledProduct");
        public String requestParameter(StringParameterType spt);
+
static final QName IP_PNAME = new QName("http://docs.oasis-open.org/sdd/ns/cim-profile", "CIM_InstalledProduct.ProductName");
        public Boolean requestParameter(BooleanParameterType bpt);
+
static final QName IP_PVENDOR = new QName("http://docs.oasis-open.org/sdd/ns/cim-profile", "CIM_InstalledProduct.ProductVendor");
        public URI requestParameter(URIParameterType upt);
+
static final QName IP_PVERSION = new QName("http://docs.oasis-open.org/sdd/ns/cim-profile", "CIM_InstalledProduct.ProductVersion");
+
 
         public String displayMessage(String message);
+
// 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 implementation of the four requestParameter(<>ParameterType parameter) methods will query for the values set for id, value, required, sensitive, defaultValue, and operation as defined by the BaseParameterType and determine what to display to the user. It will then read from System.in and wait for the user to interact with the tool, using return to terminate the input stream. The implementation will then return the value as entered by the user to the calling method, in the object form as defined by the calling method.
+
** The InstalledProductHandler uses various pattern matches to determine if a product is installed on the target host.
** The implementation of displayMessage will allow other services to call the method in order to provide messages such as status or details about the operation(s) being performed.
+
** 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].
** Validation of ParameterTypes must be handled is handled by the implementation of the requestParameter methods.
+
** The first phase of implementation will focus on integrating the CLI into the Orchestrator through method calls in an attempt to flesh out the CLI methods and functions.
+
** The second phase of implementation will introduce the concepts of an event bus or listener model that will allow the Orchestrator and the Advisor interfaces to be married in a more dynamic approach.
+
  
 
=Impacts of this enhancement=
 
=Impacts of this enhancement=
* The SDD runtime will be able to interact with the user via the CLI interface for ParameterType information as defined by the SDD. In response to the user, the runtime will perform resolution with the provided data in order to successfully resolve and operate on a SDD succcessfully. Also, feedback of the resolution and the operation(s) that are performed will be provided to the CLI.
+
* 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

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
  • Initial version

Workload Estimation

Rough workload estimate in person weeks
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.

Back to the top