Skip navigation links

Oracle Internet Directory API Reference
11g Release 1 (11.1.1)

E10664-01


oracle.ldap.util
Class LDIFMigration

java.lang.Object
  extended by oracle.ldap.util.LDIFMigration


public class LDIFMigration
extends java.lang.Object

This class provides methods to migrate the user information present in the component specific repositories to OID. The input to this migration process is an intermediate LDIF file which contains the substitution variables that needs to be replaced. The output of this process is an LDIF file which could be used to upload the data using any one of the existing tools. Alternatively, the migration process itself could load the data to OiD transforming a entry that was read from an LDIF file


Constructor Summary
LDIFMigration(java.io.File inpF, java.util.Vector subsVect, java.io.File outF)
          This method constructs an object to read the LDIF entry from the specified File object, do the substitution and write the LDIF entries to the specified File object.
LDIFMigration(java.io.InputStream inpS, java.util.Vector subsVect, java.io.OutputStream outS)
          This method constructs an object to read the LDIF entries from the specified input stream, do the substitution and write the LDIF entries to the specified output stream.
LDIFMigration(java.lang.String inputFile, java.util.Vector subsVect, java.lang.String outFile)
          This method constructs an object to read the LDIF file, do the substitution and write the LDIF entries to a file.

 

Method Summary
 void cleanup()
          Closes the ldif reader and writer streams.
static void main(java.lang.String[] args)
          LDIFMigrationTool.
 int migrate()
          Call this method to read the intermediate LDIF file and do the substitution and write a new LDIF output file.
 int migrate(Subscriber subscriber)
          Call this method to read the intermediate LDIF file and do the substitution and write a new LDIF output file.

 

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

 

Constructor Detail

LDIFMigration

public LDIFMigration(java.lang.String inputFile,
                     java.util.Vector subsVect,
                     java.lang.String outFile)
              throws MigrationException
This method constructs an object to read the LDIF file, do the substitution and write the LDIF entries to a file.
Parameters:
inputFile - Name of the input file
subsVect - The vector containing the substitution variables and the values alternatively.
outFile - Name of the output file.
Throws:
MigrationException - A migration error could occur due to an I/O error or invalid input parameters. The error code and the the error message of this exception object describes the contexts.

LDIFMigration

public LDIFMigration(java.io.File inpF,
                     java.util.Vector subsVect,
                     java.io.File outF)
              throws MigrationException
This method constructs an object to read the LDIF entry from the specified File object, do the substitution and write the LDIF entries to the specified File object.
Parameters:
inpF - The input File Object
subsVect - The vector containing the substitution variables and the values alternatively.
outF - The output File Object
Throws:
MigrationException - A migration error could occur due to an I/O error or invalid input parameters. The error code and the the error message of this exception object describes the contexts.

LDIFMigration

public LDIFMigration(java.io.InputStream inpS,
                     java.util.Vector subsVect,
                     java.io.OutputStream outS)
              throws MigrationException
This method constructs an object to read the LDIF entries from the specified input stream, do the substitution and write the LDIF entries to the specified output stream.
Parameters:
inpS - The input stream from which provides the LDIF entries
subsVect - The vector containing the substitution variables and the values alternatively.
outS - The output stream to which the LDIF entries are written
Throws:
MigrationException - A migration error could occur due to an I/O error or invalid input parameters. The error code and the the error message of this exception object describes the contexts.

Method Detail

migrate

public int migrate()
            throws MigrationException,
                   java.io.IOException
Call this method to read the intermediate LDIF file and do the substitution and write a new LDIF output file.
Returns:
int number of entries successfully written.
Throws:
MigrationException - if an error occur while reading from or writing to an LDIF file
java.io.IOException

migrate

public int migrate(Subscriber subscriber)
            throws MigrationException,
                   java.io.IOException
Call this method to read the intermediate LDIF file and do the substitution and write a new LDIF output file. The sustitution variables will be automatically figured out by connecting to the directory server. Following is the list of substitution variables which will be determined from a given ldap host.
                s_SubscriberDN
                s_UserContainerDN
                s_GroupContainerDN
                s_SubscriberOracleContextDN
                s_RootOracleContextDN
                s_UserNicknameAttribute
                s_UserNamingAttribute
Parameters:
subscriber - the subscriber for which the substitution variables needs to be figured out.
Returns:
int number of entries successfully written.
Throws:
MigrationException - if error occur while reading from or writing to an LDIF file or a NamingException occur while performing a directory operation.
java.io.IOException

cleanup

public void cleanup()
             throws MigrationException
Closes the ldif reader and writer streams.
Throws:
MigrationException - if an I/O error occurs while closing the reader or writer streams.

main

public static void main(java.lang.String[] args)
LDIFMigrationTool. To migrate the user information that is present in the component specific repositories to the OID. The components will output the data in to an intermediate file. This intermediate file is the input to this tool. The input file contains a set of substituion variables which needs to be replaced with the values provided. The input file, the substitution variables and its values and the output file can be passed as the command line parameters.
    java LDIFMigration "input_file=my_users.dat"
    "output_file=my_users.ldif" "s_UserContainerDN=dc=oracle,dc=com"
    "s_UserNicknameAttribute=uid" [-lookup] [-load] -[reconcile SAFE |
    SAFE_EXTENDED | NORMAL] ["host=directoryName"] ["port=portnumber"] 
    ["dn=bindDn"] ["password=password"] [subscriber=subscribername]
 

Altenatively you may construct an object of this class and call migrate and cleanup methods. You can create an object of this class as

    .......
    .......
    LDIFMigration ldifMig = null;
    try {
          ldifMig = new LDIFMigration("InputFile.ldif",substituteVar,
                                      "OutputFile.ldif");
    }catch(MigrationException me) {
    }

 the substituteVar is a vector object containing the substitution 
 variables.
 for example the vector contains elements in this form.

    |------------------------|
    | s_subscriber_user_base | --- Substitution variable
    |------------------------|
    |  dc=oracle,dc=com      | --- Substitution value for the above value
    |------------------------|
    |  s_nickname_attr       | --- Substitution variable 
    |------------------------|
    |        uid             | --- Substitution value
    |------------------------|
 

Skip navigation links

Oracle Internet Directory API Reference
11g Release 1 (11.1.1)

E10664-01


Copyright © 1999, 2009 Oracle. All Rights Reserved.