com.hyperion.lcm.clu
Class LCMClient

java.lang.Object
  extended bycom.hyperion.lcm.clu.LCMClient

public class LCMClient
extends java.lang.Object

This is a class designed for providing API to execute LCM Migrations. The execute method reads the migration definition file and executes the file in memory. On execution completion, an LCM handle is returned that has methods to track migration status. A successful migration is implied by "Success" status message and a status message of "Completed With Failures" indicates that the migration was completed with failures.

Sample use of API:

   
   try{
     LCMHandle handle = LCMClient.execute("C:/packagexmlfiles/MigrationDefinitionfile.xml","");
     System.out.println("Migration status: " +handle.getMessage());
   }catch(LCMException e)
   {
     //check error message for failure info
   }
  

Execution setup: Copy libraries folder (lib) and configuration folder (conf) from CLU Command Line Utility distribution. Update CLASSPATH in the run time environment to include conf folder location, and all files under lib. For example, if the files have been copied on your machine as:

C:/LCMAdmin/CLU/lib/lcm-clu.jar /audit-client.jar .. ..

C:/LCMAdmin/CLU/conf/migration.properties /log.xml .. ..

The CLASSPATH would need to be updated as CLASSPATH=%CLASSPATH%:C:/LCMAdmin/CLU/conf:C:/LCMAdmin/CLU/lib/lcm-clu.jar:C:/LCMAdmin/CLU/lib/audit-client.jar

Version:
1.1

Constructor Summary
LCMClient()
          The constructor creates a new LCMClient instance.
 
Method Summary
static LCMHandle execute(java.lang.String migDefFilePath, java.lang.String basePath)
          This method will execute the migration specified by the definition located at migDefFilePath.
static LCMHandle execute(java.lang.String username, java.lang.String password, java.lang.String migDefFilePath, java.lang.String basePath)
          This method will execute the migration specified by the definition located at migDefFilePath.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LCMClient

public LCMClient()
The constructor creates a new LCMClient instance.

Method Detail

execute

public static LCMHandle execute(java.lang.String migDefFilePath,
                                java.lang.String basePath)
                         throws com.hyperion.lcm.common.LCMException
This method will execute the migration specified by the definition located at migDefFilePath. On execution completion it returns the status associated with the execution. The migration definition file should have the relevant information about credentials, connections and tasks. Please refer to Artifact Lifecycle Management Utility guide for more details.

To export/import from a file system, the migration definition file should contain a file system connection. The folder parameter in the connection could either specify an aboslute path or a relative path. If the parameter is a relative path, the absolute path would be determined using the basePath parameter.

The following exercepts migration definition showing a FileSystem connection with absolute path:

ConnectionInfo name="FSConnection1" type="FileSystem" description="File System Location" filePath="file:/c:/lcmstorage/out"

Sample API usage: LCMClient.execute("c:/packagexmlfiles/MDF.xml", "")

The following exercepts migration definition showing a FileSystem connection with relative path:

ConnectionInfo name="FSConnection1" type="FileSystem" description="File System Location" filePath="/out"

Sample API usage: LCMClient.execute("c:/packagexmlfiles/MDF.xml","c:/lcmStorage")

Parameters:
migDefFilePath - a String to migration definition file filepath
basePath - a String Root folder of export import contents, valid only if the file system connection uses a relative path
Returns:
a LCMHandle object containing status message.
Throws:
com.hyperion.lcm.common.LCMException

execute

public static LCMHandle execute(java.lang.String username,
                                java.lang.String password,
                                java.lang.String migDefFilePath,
                                java.lang.String basePath)
                         throws com.hyperion.lcm.common.LCMException
This method will execute the migration specified by the definition located at migDefFilePath. On execution completion it returns the status associated with the execution. One usecase of this API is for running the Migration definition files saved from the Shared Services UI. These files will not have credentials saved as part of the file and hence this API can be used to run such files by providing the username and password values along with the path to the migration definition file.

To export/import from a file system, the migration definition file should contain a file system connection. The folder parameter in the connection could either specify an aboslute path or a relative path. If the parameter is a relative path, the absolute path would be determined using the basePath parameter.

The following exercepts migration definition showing a FileSystem connection with absolute path:

ConnectionInfo name="FSConnection1" type="FileSystem" description="File System Location" filePath="file:/c:/lcmstorage/out"

Sample API usage: LCMClient.execute("admin","password",c:/packagexmlfiles/MDF.xml", "")

The following exercepts migration definition showing a FileSystem connection with relative path:

ConnectionInfo name="FSConnection1" type="FileSystem" description="File System Location" filePath="/out"

Sample API usage: LCMClient.execute("admin","password",c:/packagexmlfiles/MDF.xml","c:/lcmStorage")

Parameters:
username - a String containing the username
password - a String containing the password
migDefFilePath - a String to migration definition file filepath
basePath - a String Root folder of export import contents, valid only if the file system connection uses a relative path
Returns:
a LCMHandle object with status message.
Throws:
com.hyperion.lcm.common.LCMException