Class TExportPackageICM.ImportOptions

java.lang.Object
  |
  +--TExportPackageICM.Options
        |
        +--TExportPackageICM.ImportOptions
Enclosing class:
TExportPackageICM

public static class TExportPackageICM.ImportOptions
extends TExportPackageICM.Options

This object specified the matrix of import options. It may be handed off to the import methods and may be modified by the tool as needed. This object is responsible for the full state of import options, including the constants, setting them, checking them, and possibly prompting the user.


Constructor Summary
TExportPackageICM.ImportOptions()
           Create an ImportOptions object, initializing with defaults.
TExportPackageICM.ImportOptions(java.lang.String iniFileName)
          Create an ImportOptions object with the settings specified in the given configuration file.
 
Method Summary
 boolean getAnswer_isFileVersionWarning_exception(java.lang.String fileVersion)
          Determines whether or not file version warning policy is set to throw exception.
 boolean getAnswer_isFileVersionWarning(int policySetting, java.lang.String fileVersion)
          Determines whether or not file version warning policy is set to the specified policy.
 boolean getAnswer_overwriteConfirm(com.ibm.mm.sdk.common.DKDDO existingDDO)
          Get an answer for Overwrite Confirmation.
 int getAnswer_uniqueDetectionPolicy(java.lang.String itemDesc)
          Get an answer for the Uniqueness Detection Policy.
 int getAnswer_versionGapHandling(java.lang.String itemid, java.lang.String objectType, java.lang.String lastVersion, java.lang.String nextVersion)
          Gets the Version Gap Handling Policy.
 int getConflictHandling()
          Get the Conflict Handling Setting.
 int getFileVersionWarning()
          Get the File Version Warning Policy.
 boolean getOverwriteConfirmEnable()
          Determine if Overwrite Confirmation is enabled or not.
 java.lang.String getTrackingFileName()
          Get the Import Operation Tracking File Name or 'null' if disabled.
 int getUniqueDetectionPolicy()
          Get the Uniqueness Detection Policy.
 java.lang.String getUserSpecifiedUniqueAttr()
          Get the User-Specified Unique Attr, if any.
 int getVersionGapHandling()
          Get the Version Gap Handling Policy.
 int prompt_conflictHandling_noneFound(java.lang.String itemDesc)
          If no items are found in the target system based on the uniqueness detection policy specified, this will prompt the user with the options available.
 java.lang.String prompt_userSpecifiedUniqueAttr(java.lang.String itemDesc, java.lang.String autoDetectedList)
          If no items are found in the target system based on the uniqueness detection policy specified, this will prompt the user with the options available.
 void read(java.lang.String iniFileName)
          Read in settings in configuration file.
 void setConflictHandling(int policySetting)
          Set Conflict Handling Setting.
 void setFileVersionWarning(int policySetting)
          Set File Version Warning Policy.
 void setOverwriteConfirmEnable(boolean setting)
          Enable or Disable Overwrite Confirmation for existing items upon import.
 void setTrackingFileName(java.lang.String trackingFileName)
          Set or Disable Import Operation Tracking File Name.
 void setUniqueDetectionPolicy(int policySetting)
          Set the Uniqueness Detection Policy.
 void setUserSpecifiedUniqueAttr(java.lang.String attrName)
          Set the User-Specified Unique Attribute to use in the Uniqueness Detection Policy's 'USER_SPECIFIED' setting.
 void setVersionGapHandling(int policySetting)
          Set Version Gap Handling Policy.
 java.lang.String toString()
          Returns a string representation of this object.
 void write(java.lang.String iniFileName)
          Write current settings to configuration file.
 
Methods inherited from class TExportPackageICM.Options
getPrintDebugEnable, getPrintTraceEnable, setPrintDebugEnable, setPrintTraceEnable
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TExportPackageICM.ImportOptions

public TExportPackageICM.ImportOptions()
 Create an ImportOptions object, initializing with defaults.  For traceEnable
 and debugEnable defaults, please refer to the javadoc for Options().         

 Defaults:
       File Version Warning       = TExportPackageICM.OPTION_FILE_VERSION_WARNING_EXCEPTION
       Version Gap Handling       = TExportPackageICM.OPTION_VERSION_GAP_HANDLING_ENFORCE_NO_GAPS
       Conflict Handling          = TExportPackageICM.OPTION_CONFLICTS_UNIQUE_THEN_NEW
       Unique Detection Policy    = TExportPackageICM.OPTION_UNIQUENESS_DETECT_THEN_PROMPT
       User-Specified Unique Attr = null
       Overwrite Confirmation     = false
       Tracking File Name         = TExportPackageICM.OPTION_TRACKING_FILE_DEFAULT
 

TExportPackageICM.ImportOptions

public TExportPackageICM.ImportOptions(java.lang.String iniFileName)
                                throws java.lang.Exception
Create an ImportOptions object with the settings specified in the given configuration file. For any settings not specified, defaults will be used. For information on configuration file format, please refer to the TExportPackageICM.ImportOptions.read() documention. For information on default settings, please refer to the primary constructor.

Parameters:
iniFileName - - Name of configuration file.
Method Detail

getConflictHandling

public int getConflictHandling()
Get the Conflict Handling Setting.

Returns:
Returns the current Conflict Handling Setting. Options are listed in the setConflictHandling() javadoc.

getFileVersionWarning

public int getFileVersionWarning()
Get the File Version Warning Policy.

Returns:
Returns the current File Version Warning policy. Options are listed in the setFileVersionWarning() javadoc.

getTrackingFileName

public java.lang.String getTrackingFileName()
Get the Import Operation Tracking File Name or 'null' if disabled.

Returns:
Returns the file name setting for the Import Operation Tracking. For for information, please refer to the setTrackingFileName() Javadoc.

getUniqueDetectionPolicy

public int getUniqueDetectionPolicy()
Get the Uniqueness Detection Policy.

Returns:
Returns the current Uniqueness Detection Policy. Options are listed in the setUniqueDetection() javadoc.

getUserSpecifiedUniqueAttr

public java.lang.String getUserSpecifiedUniqueAttr()
Get the User-Specified Unique Attr, if any.

Returns:
Returns the user-specified unique attr or null if none specified.

getVersionGapHandling

public int getVersionGapHandling()
Get the Version Gap Handling Policy.

Returns:
Returns the current Version Gap Handling policy. Options are listed in the setVersionGapHandling() javadoc.

getAnswer_overwriteConfirm

public boolean getAnswer_overwriteConfirm(com.ibm.mm.sdk.common.DKDDO existingDDO)
                                   throws java.io.IOException,
                                          java.lang.Exception
Get an answer for Overwrite Confirmation. Prompt the user if set to prompt, otherwise just return true.

Parameters:
existingDDO - - Existing DDO that is going to be overwritten.
Returns:
Returns the users choice for overwrite confirmation if set to prompt, otherwise returns the normal policy.

getAnswer_uniqueDetectionPolicy

public int getAnswer_uniqueDetectionPolicy(java.lang.String itemDesc)
                                    throws java.io.IOException,
                                           java.lang.Exception
Get an answer for the Uniqueness Detection Policy. The user will be prompted if policy is set to prompt, otherwise it will return the normal policy.

Parameters:
itemDesc - - Item being imported.
Returns:
Returns the users choice for unique detection policy if set to prompt, otherwise returns the normal policy.

getAnswer_isFileVersionWarning

public boolean getAnswer_isFileVersionWarning(int policySetting,
                                              java.lang.String fileVersion)
                                       throws java.io.IOException,
                                              java.lang.Exception
Determines whether or not file version warning policy is set to the specified policy. The user will be prompted if policy is set to prompt.

Parameters:
policySetting - - Policy Setting to check for.
fileVersion - - Actual File Version.

getAnswer_isFileVersionWarning_exception

public boolean getAnswer_isFileVersionWarning_exception(java.lang.String fileVersion)
                                                 throws java.io.IOException,
                                                        java.lang.Exception
Determines whether or not file version warning policy is set to throw exception. The user will be prompted if policy is set to prompt.

Parameters:
fileVersion - - Actual File Version.
Returns:
Returns true if user wants exception thrown, false if not.

getAnswer_versionGapHandling

public int getAnswer_versionGapHandling(java.lang.String itemid,
                                        java.lang.String objectType,
                                        java.lang.String lastVersion,
                                        java.lang.String nextVersion)
                                 throws java.io.IOException,
                                        java.lang.Exception
Gets the Version Gap Handling Policy. The user will be prompted if policy is set to prompt.

Parameters:
itemId - - Item ID of the item in question.
objectType - - Object Type of the item in question.
lastVersion - - Last Version.
nextVersion - - Next Version Found.
Returns:
Returns the users choice for Version Gap handling if set to prompt, otherwise returns the normal policy.

getOverwriteConfirmEnable

public boolean getOverwriteConfirmEnable()
Determine if Overwrite Confirmation is enabled or not.

Returns:
Returns true if overwrite confirmation is enabled, false if not.

prompt_conflictHandling_noneFound

public int prompt_conflictHandling_noneFound(java.lang.String itemDesc)
                                      throws java.io.IOException,
                                             java.lang.Exception
If no items are found in the target system based on the uniqueness detection policy specified, this will prompt the user with the options available.

Parameters:
itemDesc - - Description of the item being imported.
Returns:
Returns the user's answer.

prompt_userSpecifiedUniqueAttr

public java.lang.String prompt_userSpecifiedUniqueAttr(java.lang.String itemDesc,
                                                       java.lang.String autoDetectedList)
                                                throws java.io.IOException,
                                                       java.lang.Exception
If no items are found in the target system based on the uniqueness detection policy specified, this will prompt the user with the options available.

Parameters:
itemDesc - - Description of the item being imported.
autoDetectedList - - (Optional) List of auto-detected attributes that appear as good unique constraints.
Returns:
Returns the user's answer.

setConflictHandling

public void setConflictHandling(int policySetting)
                         throws java.lang.Exception
Set Conflict Handling Setting. This setting determines if and how existing items in the target datastore may be compared against those being imported. Existing items in the target system may be matched up to the import items based on attribute criteria and may be overwritten if desired.

Parameters:
policySetting - - Policy options are:
  • TExportPackageICM.OPTION_CONFLICTS_ALWAYS_NEW:
    Never check against existing items in the target system. Always import as a new item. If the item violates a unique attribute constraint, an exception will be thrown from the Information Integrator API.
  • TExportPackageICM.OPTION_CONFLICTS_UNIQUE_THEN_NEW:
    Based on the Uniqueness Determination Policy, check against existing items in the target system. If the item is identified, it can be overwritten or updated with the information in the imported items. If an existing item is not found matching the uniqueness criteria specified in that policy, then import it as a new item.
  • TExportPackageICM.OPTION_CONFLICTS_UNIQUE_THEN_ERROR:
    Based on the Uniqueness Determination Policy, check against existing items in the target system. If the item is identified, it can be overwritten or updated with the information in the imported items. If an existing item is not found, an exception will be thrown.
  • TExportPackageICM.OPTION_CONFLICTS_UNIQUE_THEN_SKIP:
    Based on the Uniqueness Determination Policy, check against existing items in the target system. If the item is identified, it can be overwritten or updated with the information in the imported items. If an existing item is not found, simply skip that item and move on.
  • TExportPackageICM.OPTION_CONFLICTS_UNIQUE_THEN_PROMPT:
    Based on the Uniqueness Determination Policy, check against existing items in the target system. If the item is identified, it can be overwritten or updated with the information in the imported items. If an existing item is not found, The user will be prompted on the commandline.

setFileVersionWarning

public void setFileVersionWarning(int policySetting)
                           throws java.lang.Exception
Set File Version Warning Policy. If an Export Package file is read that does not match the current version of this object, the user may be warned with an exception. With the warning, the user may they re-issue function call with warning turned off if desired.

Parameters:
policySetting - - Policy options are:
  • TExportPackageICM.OPTION_FILE_VERSION_WARNING_EXCEPTION:
    If the version of the file does not exactly match the version of the tool, an exception will be thrown to warn the user. The user may then re-issue the request with this setting turned off if desired.
  • TExportPackageICM.OPTION_FILE_VERSION_WARNING_IGNORE:
    Ignore any file version differences between that and the version of the tool used. File format changes may be incompatable with this version of the tool. Unexpected errors may occur.
  • TExportPackageICM.OPTION_FILE_VERSION_WARNING_PROMPT:
    The user will be prompted on the commandline.

setTrackingFileName

public void setTrackingFileName(java.lang.String trackingFileName)
                         throws java.lang.Exception
Set or Disable Import Operation Tracking File Name. By default import operation tracking is enabled and writes line-by-line status of import success to the default file name stored in TExportPackageICM.OPTION_TRACKING_FILE_DEFAULT. Import operation tracking may be disabled by setting to 'null'. An import operation log is required in order to restart import if it failed or was terminated before import completed for all items selected. Each import operation will overwrite file that already exists with the given name. The file extension specified in TExportPackageICM.OPTION_TRACKING_FILE_EXT should be used. If no extension is specified, this extension will be appended.

File Syntax:
Please refer to the documentation in TExportPackageICM.restartImport().

Parameters:
trackingFileName - - Desired import operation tracking file name or 'null' to disable.

setOverwriteConfirmEnable

public void setOverwriteConfirmEnable(boolean setting)
                               throws java.lang.Exception
Enable or Disable Overwrite Confirmation for existing items upon import. Depending on the Conflict Handling Setting, if an existing item in the target datstore is matched up with an item being imported, this will determine if the user will be prompted to confirm overwrite.

Parameters:
setting - - True to enable Overwrite Confirmation, false to disable.

setUniqueDetectionPolicy

public void setUniqueDetectionPolicy(int policySetting)
                              throws java.lang.Exception
Set the Uniqueness Detection Policy. This setting determines how the imported item(s) will be compared against existing items in the target system. This is the policy to simply identify them. This setting is used by the Conflict Handling process depending on the setting. The Conflict Handling Policy is then responsible for determining how to proceed once a unique item is or is not identified.

Parameters:
policySetting - - Policy options are:
  • TExportPackageICM.OPTION_UNIQUENESS_DETECT_THEN_ERROR:
    Automatically detect the uniqueness determination criteria. Uniqueness will be detected by a single attribute on the root level of the ItemType that is both unique and required (not nullable). If no unique attributes are required, then a single unique attribute attribute will be used. If multiple or no attributes are found during detection, an exception will be thrown.
  • TExportPackageICM.OPTION_UNIQUENESS_DETECT_THEN_PROMPT:
    Automatically detect the uniqueness determination criteria. Uniqueness will be detected by a single attribute on the root level of the ItemType that is both unique and required (not nullable). If no unique attributes are required, then a single unique attribute attribute will be used. If multiple or no attributes are found during detection, the user will be prompted on the commandline to make a choice.
  • TExportPackageICM.OPTION_UNIQUENESS_USER_SPECIFIED:
    Uniqueness will be determined based on the attribute name specified by the setUserSpecifiedUniqueAttr().
  • TExportPackageICM.OPTION_UNIQUENESS_PROMPT:
    Always prompt the user on the commandline for the Uniqueness Determination Policy.

setUserSpecifiedUniqueAttr

public void setUserSpecifiedUniqueAttr(java.lang.String attrName)
Set the User-Specified Unique Attribute to use in the Uniqueness Detection Policy's 'USER_SPECIFIED' setting. This attribute determines the exact attribute for which the the imported item(s) will be compared against existing items in the target system. The Uniqueness Detection Policy will automatically be set to TExportPackageICM.OPTION_UNIQUENESS_USER_SPECIFIED.

Parameters:
attrName - - Name of attribute on root level that uniquely identifies items in the target system. It must exist on all Item Types imported.

setVersionGapHandling

public void setVersionGapHandling(int policySetting)
                           throws java.lang.Exception
Set Version Gap Handling Policy.

Parameters:
policySetting - - Policy options are:
  • TExportPackageICM.OPTION_VERSION_GAP_HANDLING_ENFORCE_NO_GAPS:
    If a gap in versions is detected, an exception will be thrown.
  • TExportPackageICM.OPTION_VERSION_GAP_HANDLING_ELIMINATE_GAPS:
    If gaps are detected, they are eliminated by shifting all versions down.
  • TExportPackageICM.OPTION_VERSION_GAP_HANDLING_PROMPT:
    The user will prompted at the commandline for decision if a gap in versions is detected.

read

public void read(java.lang.String iniFileName)
          throws java.lang.Exception
Read in settings in configuration file. File may be created by the write() function, modified externally, or created from stracth. Please refer to the javadoc on the TExportPackageICM.Options.read() for more information.

File Syntax:
Please refer the TExportPackageICM.Options.read() for complete information.

Overrides:
read in class TExportPackageICM.Options
Parameters:
iniFileName - - Name of configuration file.

toString

public java.lang.String toString()
Returns a string representation of this object.

Overrides:
toString in class TExportPackageICM.Options
Returns:
Returns a string representation of this object.

write

public void write(java.lang.String iniFileName)
           throws java.lang.Exception
Write current settings to configuration file.

File Syntax:
Please refer to the read() method.

Overrides:
write in class TExportPackageICM.Options
Parameters:
iniFileName - - Name of configuration file.