Thursday, October 10, 2013

Creating a new SQLServer 2012 Provisioning Engine

After getting the Microsoft SQLServer 2012 installed I was able to turn my attention to the code to integrate to UCDT.

The first step is to get your IDE up and running and create a new project to build the engine you want.

For me, I created a Java structure to hold a class you need to start with, and then a package to hold my code.

Now, be sure to keep track of any Jar's you need to get your product working because you will need to drop them into the UCDT WebApps Lib folder in order for it to work.

Ok, so the first thing to know is that there is an Inteface class you need to use and adhere to: GenericProvisionInterface.class.  There is a Jar file in the lib path of UCDT and you can get it from there, any system will allow you to open a Jar file and pull the files out, but I am including the interface definition here so we can talk about it:

package com.cisco.ucspt;

public interface GenericProvisionInterface {
public boolean setupConnection(String hostIP, 
                                       String portNumber, 
                                       String userId,
                                       String password, 
                                       String dbName,
                                       String version);
public boolean releaseConnection();
public String provision(String template);

}

There are three public class you need to design. First, setupConnection(); Second, releaseConnection(); and third provision().

The method setupConnection, as you can see, has all the data being passed in dealing with connection information. You might not need all of these, but they are there for your use. The origin of this information is found within the UCDT application on the Enterprise/Application menu item:


Notice that there is a tab titled "Third Party", this is where you will define all your server information. Also, note the column headers for the data, left to right you have Enterprise Name, Server Name, IP Address, User Name, Port, Version, Database Name, Throttle Speed and Test Status. We drill into each of these later, but, for now just know that you need to define the Server Name, the IP and Port if necessary and you will need to supply the User ID and Password. Also, notice that Test Status reports that no connectivity test is available, that is because this is a third party engine and not a native engine to UCDT. If we really like your OEM engine we might integrate it into the product thereby making it native.

Now, writing the code is a simple matter of creating an abstract class that will implement GenericProvisionInterface. And, of course, you can create any support class you might need to actually create your OEM solution.

My recommendation is that your package should be at the high level of WebApps/classes, since that is where all the other provisioning classes are stored.

So, just two more things to update and you are ready to start testing your code.

First, you need to update the provision.xml file, and that is located in WEV-INF/provision. Here is the contents of that file along with an edit that I made to support my MS SQLServer entry:


Line 9 contains the entry for the MS SQL Server entry that I added. The important thing to note here is that the provisionProduct field must be "ThirdParty"  and the provisionProductVersion field must match the database table entry for this server type. Finally, the provisionClass must be the name of the class that contains your code. 

The database table that needs to be updated is the ucsystems table, within that table you need to add an entry must also have a ucproduct value of "ThirdParty" and the version you add must match the provisionProductVersion added to the provisionxml file.

Ok, that is all you need to integrate, next we will talk about testing.

No comments:

Post a Comment