com.ibm.pim.utils
Interface ImportList


public interface ImportList

An interface representing an object that holds name, type and action mode of objects present in a zip file obtained from the environment export tool. Allows the user to create a new zip file containing selected objects from this list.

Since:
6.0.0

Method Summary
 void addHierarchyMap(java.lang.String sourceHierarchyName, java.lang.String destinationHierarchyName)
          Adds the hierarchy map to this list.
 void addObject(ExportList.Type type, java.lang.String objectName)
          Adds the object of specified type and name to this list.
 void addObjects(ExportList.Type type)
          Adds all the objects of the specified type to this list.
 boolean areAllRequisitesMet()
          Determines whether any object dependency is present.
 void createZip(java.lang.String documentPath)
          Creates a zip file containing only those objects present in this import list and stores it at the specified path in the docstore.
 void createZip(java.lang.String documentPath, boolean checkRequisites)
          Creates a zip file containing only those objects present in this import list and stores it at the specified path in the docstore after checking for pre-requisites if checkRequisites is true.
 ExportList.ActionMode getActionModeForObject(ExportList.Type type, java.lang.String objectName)
          Returns the action mode for the PIM object of specified type and name.
 java.util.List<java.util.HashMap> getHierarchyMaps()
          Fetches the names of all hierarchy maps as a list of HashMap.
 java.util.List<java.lang.String> getObjectNames(ExportList.Type type)
          Fetches the names of all objects of the given type in the list.
 java.util.Set<ExportList.Type> getObjectTypes()
          Fetches the object types in the Import list.
 ImportRequisiteList getRequisites()
          Fetches the names of objects that the objects in this export list are dependent on.
 void removeHierarchyMap(java.lang.String sourceHierarchyName, java.lang.String destinationHierarchyName)
          Removes the hierarchy map from this list.
 void removeObject(ExportList.Type type, java.lang.String objectName)
          Removes the object of specified type and name from this list.
 void removeObjects(ExportList.Type type)
          Removes all the objects of the specified type from this list
 

Method Detail

getObjectTypes

java.util.Set<ExportList.Type> getObjectTypes()
Fetches the object types in the Import list.

Returns:
A Set of object types present in the import list.
Throws:
PIMInternalException - If an internal error occurs.

getObjectNames

java.util.List<java.lang.String> getObjectNames(ExportList.Type type)
Fetches the names of all objects of the given type in the list.

Parameters:
type - The object type
Returns:
A List containing names of objects of the given type
Throws:
PIMInternalException - If an internal error occurs.
java.lang.IllegalArgumentException - If type is null or if the type is ExportList.Type.HIERARCHY_MAP Use getHierarchyMaps() to retrieve Hierarchy Map names

getHierarchyMaps

java.util.List<java.util.HashMap> getHierarchyMaps()
Fetches the names of all hierarchy maps as a list of HashMap.

Returns:
A List containing name(s) of hierarchy map(s) as a HashMap object.Each HashMap contains the source hierarchy name as the key and destination hierarchy name as value
Throws:
PIMInternalException - If an internal error occurs.

removeObjects

void removeObjects(ExportList.Type type)
Removes all the objects of the specified type from this list

Parameters:
type - The PIM object type
Throws:
PIMInternalException - If an internal error occurs.
java.lang.IllegalArgumentException - If type is null or if objects of the specified type are not present in the list.

removeObject

void removeObject(ExportList.Type type,
                  java.lang.String objectName)
Removes the object of specified type and name from this list.

Parameters:
type - The PIM object type
objectName - The name of the object to be removed from the list.
Throws:
PIMInternalException - If an internal error occurs.
java.lang.IllegalArgumentException - If type is null or objectName is null or if the objectName is an empty string or if the object specified is not in this list.

removeHierarchyMap

void removeHierarchyMap(java.lang.String sourceHierarchyName,
                        java.lang.String destinationHierarchyName)
Removes the hierarchy map from this list.

Parameters:
sourceHierarchyName - The name of the source hierarchy
destinationHierarchyName - The name of the destination hierarchy.
Throws:
PIMInternalException - If an internal error occurs.
java.lang.IllegalArgumentException - If the arguments are null or an empty string or if the hierarchy map specified is not in this list.

addObjects

void addObjects(ExportList.Type type)
Adds all the objects of the specified type to this list. Only object types which were present in this list when it was created and were removed using removeObjects(ExportList.Type type) can be added back to the list. Only objects which were persent in the list when the list was created are added back to the list.

Parameters:
type - The PIM object type
Throws:
PIMInternalException - If an internal error occurs.
java.lang.IllegalArgumentException - If type is null or if objects of the specified type were not present in the list when the list was created.

addObject

void addObject(ExportList.Type type,
               java.lang.String objectName)
Adds the object of specified type and name to this list. Only objects which were present in this list when it was created and were removed using removeObjects(ExportList.Type type) can be added back to the list.

Parameters:
type - The PIM object type
objectName - The name of the object to be added to the list.
Throws:
PIMInternalException - If an internal error occurs.
java.lang.IllegalArgumentException - If arguments are null or an empty string or the object specified was not in this list when this list was created.

addHierarchyMap

void addHierarchyMap(java.lang.String sourceHierarchyName,
                     java.lang.String destinationHierarchyName)
Adds the hierarchy map to this list. Only hierarchy maps which were present in this list when it was created and were removed using removeHierarchyMap(String sourceHierarchyName, String destinationHierarchyName) can be added back to the list.

Parameters:
sourceHierarchyName - The name of the source hierarchy.
destinationHierarchyName - The name of the destination hierarchy.
Throws:
PIMInternalException - If an internal error occurs.
java.lang.IllegalArgumentException - If arguments are null or an empty string or the object specified was not in this list when this list was created.

getActionModeForObject

ExportList.ActionMode getActionModeForObject(ExportList.Type type,
                                             java.lang.String objectName)
Returns the action mode for the PIM object of specified type and name.

Parameters:
type - The PIM object type.Return null if the type is any of the following
ExportList.Type.CATALOG_CONTENT,
ExportList.Type.HIERARCHY_CONTENT,
ExportList.Type.ORGANIZATION_HIERARCHY_CONTENT,
ExportList.Type.USER_DEFINED_LOG_CONTENT,
ExportList.Type.LOOKUP_TABLE_CONTENT
objectName - The PIM object name
Returns:
An ActionMode enumeration value.
Throws:
PIMInternalException - If an internal error occurs.
java.lang.IllegalArgumentException - If arguments are null or an empty string or the object of the specified type and objectName is not present in the list.

getRequisites

ImportRequisiteList getRequisites()
Fetches the names of objects that the objects in this export list are dependent on. The names of the required objects are fetched from the object representations in the zip file from which this ImportList was obtained. This does not check whether the required objects are present in the environment in which this method is invoked.

Assume Catalog Catalog1 needs Spec Spec1, Hierarchy hierarchy1 and Attribute Collection AttrColl1. Assuming that the zip file contains only Catalog1, calling getRequisites() on the ImportList obtained from this zip file would return Spec1, Hierarchy1 and AttrColl1, regardless of whether these objects are present in the target environment.

When the objects which are required are part of the zip file and need to be added back to this list, use the addObjects(ExportList.Type type) or addObject(ExportList.Type type, String objectName).

Returns:
An ImportRequisiteList
Throws:
PIMInternalException - If an internal error occurs.

createZip

void createZip(java.lang.String documentPath)
Creates a zip file containing only those objects present in this import list and stores it at the specified path in the docstore.

Parameters:
documentPath - The path in the docstore at which the zip file will be stored.The path must end with a file name.
Throws:
PIMInternalException - If an internal error occurs.
java.lang.IllegalArgumentException - If documentPath is null or an empty string or the documentPath does not end with '.zip'.

createZip

void createZip(java.lang.String documentPath,
               boolean checkRequisites)
Creates a zip file containing only those objects present in this import list and stores it at the specified path in the docstore after checking for pre-requisites if checkRequisites is true. Throws an exception if objects present in this list require objects not in this list for their creation.

Parameters:
documentPath - The path in the docstore at which the zip file will be stored.The path must end with a file name.
checkRequisites - When this parameter is true, the createZip method first checks whether all the required objects are present in the import list,throws an exception if objects present in this list require objects which are not in this list
Throws:
PIMInternalException - If an internal error occurs or if there is an object dependency found. getRequisites() method has to be invoked on this list to get the list of required objects. Required objects can then be added to the list, if they were part of the list when the list was created, using addObject(ExportList.Type type, String objectName) or addObjects(ExportList.Type type).
java.lang.IllegalArgumentException - If documentPath is null or an empty string or the documentPath does not end with '.zip'.
See Also:
createZip(String documentPath)

areAllRequisitesMet

boolean areAllRequisitesMet()
Determines whether any object dependency is present. Before calling getRequisites() method,user can call this method to identify whether any dependency is present.

Returns:
Return true if there is no object dependency found else false.
Throws:
PIMInternalException - If an internal error occurs.