Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Business Rules
11g Release 1 (11.1.1)

E10663-03


oracle.rules.tools.migrator
Class MigrateRuleRepository

java.lang.Object
  extended by oracle.rules.tools.migrator.MigrateRuleRepository


public class MigrateRuleRepository
extends java.lang.Object

Migrate an SDK1 format repository to a SDK2 format repository.
The conversion process relies on the use of Map (from which SDK1 classes are descended) to retrieve the instance data for a SDK1 class instance. Migration, with some special exceptions, copies the key - value pairs from the SDK1 object to an SDK2 object.

 P Code to desribe conversion
 //create a Migrateer instance
 RepositoryMigrateer conv = new MigrateRuleRepository();
 //set the output buffer
 conv.setOutLog(somewriter-instance)

 //set input repository (SDK1 format)
 conv.setOriginLocation( String-file-repo-file-and-path )
 conv.setOriginType(MigrateRuleRepository.FILE_REPO);
 conv.setOriginDictionaryName(MigrateRuleRepository.MIGRATE_ALL)
 conv.setOriginVersionName(MigrateRuleRepository.MIGRATE_ALL);

 conv.setDestinationLocation( string-directory-path )
 //the output pkg and dictionary will be created from the origin
 //version and dictionary by mkDefaultPackageName()

 try {
   conv.migrate()
   String results = conv.getTotalStats()
   display results;
 }
   catch (MigrationException e)
 {
   display exception;
   display some-writer-instance;
 }
 

The SDK1 dictionary name is used for the SDK2 dictionary name and the SDK1 version name is used as part of the SDK2 package name.

 SDK1               SDK2
 dictionary name  --->  dictionary name
 version name    --->  package name :=   version name + "." + dictionary name
 


The SDK2 package name and dictionary name will form the directory structure for SDK2 File dictionaries.
Migration may operate on a single SDK1 dictionary/version from a repository. In such a case the OriginDictionaryName and OriginVersionName must be set to a specifidc dictionary/version pair.
If greater program control is required, the getDictionaryNames() and getVersionNames() methods return a list of the names and versions found in a SDK1 repository. These names may be used to set the origin properties and migrateSingleDictionary() may be invoked to migrate a single dictionary/version.


Field Summary
static java.lang.String FILE
          An xml file containing a dictionary.
static java.lang.String FILE_REPO
          Indicates an Oracle Business Rules file based repository.
static java.lang.String MIGRATE_ALL
          Value used to indicate all.
static java.lang.String WEBDAV_REPO
          An Oracle Business Rules WebDav based repository.

 

Constructor Summary
MigrateRuleRepository()
          Migrates an SDK1 Oracle Rules Repository to SDK2 format.

 

Method Summary
 java.lang.String getDestinationDictionaryName()
          return the destination dictionary name property.
 java.lang.String getDestinationLocation()
          return the destination location String.
 java.lang.String getDestinationPackageName()
          return the destination package name property.
 java.lang.String getDestinationType()
          Deprecated. 
 java.lang.String getImportedClasspath()
          return the imported classpath String.
 java.lang.String getOriginDictionaryName()
          return the orgin dictionary name.
 java.lang.String getOriginLocation()
          return the origin location String.
 java.lang.String getOriginPassword()
          returns the specified WebDav passwd.
 java.lang.String getOriginPasswordSource()
          returns the specified WebDav passwd source file
 java.lang.String getOriginProxyHost()
          returns the specified WebDav proxyhost.
 java.lang.String getOriginProxyPassword()
          returns the specified proxy password.
 java.lang.String getOriginProxyPort()
          returns the specified WebDav proxyport.
 java.lang.String getOriginProxyUserid()
          returns the specified WebDav proxy userid.
 java.lang.String getOriginType()
          return the type of origin repository
 java.lang.String getOriginUserid()
          returns the specified WebDav userid.
 java.lang.String getOriginVersionName()
          return the origin version name
 java.io.Writer getOutLog()
           
 java.lang.String getTotalStats()
          Return a String with the numbers of each type of first class object migrateed.
 java.lang.String getXSDLocation()
          return the imported xsds String.
 java.lang.String getXSDOutputDir()
          return the imported xsds String.
 boolean isLogWithStackTrace()
          Gets the boolean property that controls if logging should log the stack trace of an exception.
static void main(java.lang.String[] args)
          Migration of a repository may be invoked by main.
 void migrate()
           
 void migrateSingleDictionary()
          Deprecated. 
 java.lang.String mkDefaultPackageName(java.lang.String verName, java.lang.String dictName)
          Create a package name for SDK2 dictionaries.
static oracle.rules.sdk.dictionary.RuleDictionary openDict(oracle.rules.sdk.repository.RuleRepository repo, java.lang.String dictName, java.lang.String verName)
          open load the origin SDK1 version dictionary.
 void setDestinationDictionaryName(java.lang.String odictName)
          set the dictionary name for destination dictionary If this is not set (null) then the dictionary name from the origin dictionary will be used.
 void setDestinationLocation(java.lang.String loc)
          set the String with the location of the destination Repository.
 void setDestinationPackageName(java.lang.String opkg)
          set the destination package name.
 void setDestinationType(java.lang.String otype)
          Deprecated. 
 void setExecuteRL(boolean b)
          Sets the boolean property that controls if the migrated dictionary should generate and execute RL as part of validation
 void setImportedClasspath(java.lang.String loc)
          set the String with the location of the classes in the the Datamodel.
 void setLogWithStackTrace(boolean b)
          Sets the boolean property that controls if logging should log the stack trace of an exception.
 void setOriginDictionaryName(java.lang.String odictName)
          set the dictionary name for origin dictionary.
 void setOriginLocation(java.lang.String loc)
          set the String with the location of the origin repository.
 void setOriginPassword(java.lang.String passw)
          set the WebDav password.
 void setOriginPasswordSource(java.lang.String passw)
          set the WebDav password source file
 void setOriginProxyHost(java.lang.String proxyhost)
          set the WebDav proxy host
 void setOriginProxyPassword(java.lang.String passw)
          set the WebDav proxy password.
 void setOriginProxyPort(java.lang.String proxyport)
          set the WebDav proxy port
 void setOriginProxyUserid(java.lang.String uid)
          set the WebDav Proxy userid
 void setOriginType(java.lang.String otype)
          set the String denoting origin repository type.
 void setOriginUserid(java.lang.String uid)
          set the WebDav userid
 void setOriginVersionName(java.lang.String over)
          set the origin version name. if this is MigrateRuleRepository.MIGRATE_ALL and dictionary name is MigrateRuleRepository.MIGRATE_ALL, all versions and all dictionaries will be migrateed.
 void setOutLog(java.io.Writer tw)
          Set the output message Writer.
 void setXSDLocation(java.lang.String loc)
          set the String with the location of the XSDs in the the Datamodel.
 void setXSDOutputDir(java.lang.String loc)
          set the String with the location of the XSDs in the the Datamodel.
 boolean shouldExecuteRL()
          Gets the boolean property that controls if the migrated dictionary should generate and execute RL as part of validation
static java.lang.String usageAll()
          return usage for migrating all dicitonaries in a origin repository

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

FILE_REPO

public static final java.lang.String FILE_REPO
Indicates an Oracle Business Rules file based repository. Both SDK1 and SDK2 support this style of repository. Both origin and destination type may have this value. When this is used as an origin or destination value, then the associated repository location is expected to contain the complete path to an Oracle Business Rule repository file. If both the origin and destinations use this repository type, they man not point to the same file.
See Also:
Constant Field Values

WEBDAV_REPO

public static final java.lang.String WEBDAV_REPO
An Oracle Business Rules WebDav based repository. Only SDK1 supports this style of repository, therefore, only the origin repository type may have this value. When this value is used for type the origin repository location should have a a URL of the WebDav installation containing the repository.
See Also:
Constant Field Values

FILE

public static final java.lang.String FILE
An xml file containing a dictionary. Only SDK2 libraries can output a dictionary as a file. Therefore, this value may only be used for destination type. When destination type property uses this value, the destination location should contain a path (a directory, NOT a file).
See Also:
Constant Field Values

MIGRATE_ALL

public static final java.lang.String MIGRATE_ALL
Value used to indicate all. When used for origin dictionary name, all dictionaries in the origin repository will be migrated.
See Also:
Constant Field Values

Constructor Detail

MigrateRuleRepository

public MigrateRuleRepository()
Migrates an SDK1 Oracle Rules Repository to SDK2 format.

Method Detail

setOutLog

public void setOutLog(java.io.Writer tw)
Set the output message Writer. Used for error, warning, and summary messages. The user of the MigrateRuleRepository can use this to display the results of a run to a user.
Parameters:
tw - a Writer instance to receive errors, warnings, and progress messages

getOutLog

public java.io.Writer getOutLog()

setExecuteRL

public void setExecuteRL(boolean b)
Sets the boolean property that controls if the migrated dictionary should generate and execute RL as part of validation
Parameters:
b - a boolean value, true means RL will be generated and executed false is it will not.

shouldExecuteRL

public boolean shouldExecuteRL()
Gets the boolean property that controls if the migrated dictionary should generate and execute RL as part of validation
Returns:
value of validate execute RL flag

setLogWithStackTrace

public void setLogWithStackTrace(boolean b)
Sets the boolean property that controls if logging should log the stack trace of an exception.
Parameters:
b - true means the stack trace will be logged, false means it will not

isLogWithStackTrace

public boolean isLogWithStackTrace()
Gets the boolean property that controls if logging should log the stack trace of an exception.
Returns:
value of log with stack trace

getTotalStats

public java.lang.String getTotalStats()
Return a String with the numbers of each type of first class object migrateed. These are the total number of items migrateed for dictionaries migrateed by a single migrate invocation.

setOriginLocation

public void setOriginLocation(java.lang.String loc)
set the String with the location of the origin repository. The requirements for the content of this string are dependent on the m_originType property.

getOriginLocation

public java.lang.String getOriginLocation()
return the origin location String.

setImportedClasspath

public void setImportedClasspath(java.lang.String loc)
set the String with the location of the classes in the the Datamodel. The requirements for the content of this string are dependent on the m_originType property.

getImportedClasspath

public java.lang.String getImportedClasspath()
return the imported classpath String.

setXSDLocation

public void setXSDLocation(java.lang.String loc)
set the String with the location of the XSDs in the the Datamodel. The requirements for the content of this string are dependent on the m_originType property.

getXSDLocation

public java.lang.String getXSDLocation()
return the imported xsds String.

setXSDOutputDir

public void setXSDOutputDir(java.lang.String loc)
set the String with the location of the XSDs in the the Datamodel. The requirements for the content of this string are dependent on the m_originType property.

getXSDOutputDir

public java.lang.String getXSDOutputDir()
return the imported xsds String.

setOriginType

public void setOriginType(java.lang.String otype)
set the String denoting origin repository type. This must be set for a migration. One of MigrateRuleRepository.FILE_REPO or MigrateRuleRepository.WEBDAV_REPO.
For type FILE_REPO the location should contain a complete path to a SDK1 File based repository.
For type WEBDAV_REPO the location should contain a URL that points to the webdav location containing a repository.

getOriginType

public java.lang.String getOriginType()
return the type of origin repository

setOriginDictionaryName

public void setOriginDictionaryName(java.lang.String odictName)
set the dictionary name for origin dictionary. if set to MigrateRuleRepository.MIGRATE_ALL all dictionaries in the origin repository will be migrateed.

getOriginDictionaryName

public java.lang.String getOriginDictionaryName()
return the orgin dictionary name.

setOriginVersionName

public void setOriginVersionName(java.lang.String over)
set the origin version name. if this is MigrateRuleRepository.MIGRATE_ALL and dictionary name is MigrateRuleRepository.MIGRATE_ALL, all versions and all dictionaries will be migrateed.

getOriginVersionName

public java.lang.String getOriginVersionName()
return the origin version name

setDestinationLocation

public void setDestinationLocation(java.lang.String loc)
set the String with the location of the destination Repository. This is dependent on the type of destination repository For MigrateRuleRepository.FILE_REPO this must be an SDK2 repository file.

getDestinationLocation

public java.lang.String getDestinationLocation()
return the destination location String. This is the repository location.
Returns:
a String containing the destination location

setDestinationType

@Deprecated
public void setDestinationType(java.lang.String otype)
Deprecated. 

getDestinationType

@Deprecated
public java.lang.String getDestinationType()
Deprecated. 

setDestinationDictionaryName

public void setDestinationDictionaryName(java.lang.String odictName)
set the dictionary name for destination dictionary If this is not set (null) then the dictionary name from the origin dictionary will be used.

getDestinationDictionaryName

public java.lang.String getDestinationDictionaryName()
return the destination dictionary name property.

setDestinationPackageName

public void setDestinationPackageName(java.lang.String opkg)
set the destination package name. If this is set to null, then MigrateRuleRespository will create a package name from the version and dictionary names of the origin. mkDefauiltPackageName()
If this is set to an 0 length string ("") the migrated dictionary will have no package name.

getDestinationPackageName

public java.lang.String getDestinationPackageName()
return the destination package name property.

setOriginPasswordSource

public void setOriginPasswordSource(java.lang.String passw)
set the WebDav password source file
Parameters:
passw - a string with password used to login to the WebDav server

getOriginPasswordSource

public java.lang.String getOriginPasswordSource()
returns the specified WebDav passwd source file
Returns:
String with origin WebDav password property

setOriginUserid

public void setOriginUserid(java.lang.String uid)
set the WebDav userid
Parameters:
uid - a string with userid used to login to the WebDav server

getOriginUserid

public java.lang.String getOriginUserid()
returns the specified WebDav userid.
Returns:
String with origin WebDav property

setOriginPassword

public void setOriginPassword(java.lang.String passw)
set the WebDav password.
Parameters:
passw - a string with password used to login to the WebDav server

getOriginPassword

public java.lang.String getOriginPassword()
returns the specified WebDav passwd.
Returns:
String with origin WebDav password property

setOriginProxyHost

public void setOriginProxyHost(java.lang.String proxyhost)
set the WebDav proxy host
Parameters:
proxyhost - a string with proxy host required to contact to the WebDav server containing the origin repository. This is only required if the migration must contact the WebDav server through a proxy.

getOriginProxyHost

public java.lang.String getOriginProxyHost()
returns the specified WebDav proxyhost.
Returns:
String with origin proxyhost WebDav property

setOriginProxyPort

public void setOriginProxyPort(java.lang.String proxyport)
set the WebDav proxy port
Parameters:
proxyport - a string with proxy port to login to the WebDav server. This only required if the WebDav based repository must be contacted via a proxy server.

getOriginProxyPort

public java.lang.String getOriginProxyPort()
returns the specified WebDav proxyport.
Returns:
String with origin WebDav proxyport property

setOriginProxyUserid

public void setOriginProxyUserid(java.lang.String uid)
set the WebDav Proxy userid
Parameters:
uid - a string with userid used to login to the proxy server specified in ProxyHost. This is only required if the proxy server is specified that requires authentication.

getOriginProxyUserid

public java.lang.String getOriginProxyUserid()
returns the specified WebDav proxy userid.
Returns:
String with origin WebDav proxy userid property

setOriginProxyPassword

public void setOriginProxyPassword(java.lang.String passw)
set the WebDav proxy password.
Parameters:
passw - a string with password required to login to specified proxy server. If no proxy server is in use or the specified proxy server does not use authentication, then this property is not necessary.

getOriginProxyPassword

public java.lang.String getOriginProxyPassword()
returns the specified proxy password.
Returns:
String with origin WebDav Proxy password property

openDict

public static oracle.rules.sdk.dictionary.RuleDictionary openDict(oracle.rules.sdk.repository.RuleRepository repo,
                                                                  java.lang.String dictName,
                                                                  java.lang.String verName)
                                                           throws MigrationException
open load the origin SDK1 version dictionary. This loads the specified dictionary and version from the already open repository.
When this has suceeded, the origin dictionary has been set. A SDK1 repository MUST be connected.
Throws:
MigrationException - when the dicitonary/version can not be loaded

usageAll

public static java.lang.String usageAll()
return usage for migrating all dicitonaries in a origin repository

mkDefaultPackageName

public java.lang.String mkDefaultPackageName(java.lang.String verName,
                                             java.lang.String dictName)
Create a package name for SDK2 dictionaries. Use the a dictionary name and version name parameters to create a valid SDK2 package name. SDK2 repositories have package names (like a java package). An SDK2 repository is thought of as residing in a package. See the SDK2 repository documentation for more detailed explanations.
For a dictionary name of "dict" and a version name of "ver1", the generted package name would be: "dict.ver1".
NOTE: SDK2 package names must be valid java identifiers any non-valid java identifier in the version or dictionary name will be replaced by an underscore ("_").
Parameters:
dictName - String containing a dictionary name
verName - String containing aversion name
Returns:
String containing a legal package name

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Migration of a repository may be invoked by main. This is only supported for testing. Command line invocation of MigrateRuleRepository is through the ASCTL utility.
Throws:
java.lang.Exception

migrateSingleDictionary

@Deprecated
public void migrateSingleDictionary()
                             throws MigrationException
Deprecated. 
Throws:
MigrationException

migrate

public void migrate()
             throws MigrationException
Throws:
MigrationException

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Business Rules
11g Release 1 (11.1.1)

E10663-03


Copyright © 2010, Oracle and/or its affiliates. All rights reserved.