Package com.ibm.dbb.migration
Class MappingRule
- java.lang.Object
-
- com.ibm.dbb.migration.AbstractMappingRule
-
- com.ibm.dbb.migration.MappingRule
-
- All Implemented Interfaces:
IMappingRule
public class MappingRule extends AbstractMappingRule implements IMappingRule
Define a mapping rule using HLQ. Given a HLQ and a set of data set, it generates the HFS path using each fragments in the data set, for example: Given a HLQ=MY.TEST, and a data set COBOL, all members found in MY.TEST.COBOL will be copied to a sub-directory of the local GIT repository under 'my/test/cobol'. The following attributes are known by this mapping rule: hlq - (optional) if no HLQ is specified, migration tool assumes the data sets are fully qualified. parent - (optional) the sub-directory of the local GIT repository to copy the members to convertPds - (optional) automatically converts the data set to the HFS paths, default is true pdsEncoding - (optional) the encoding of the members extension - (optional) the file extension toLower - (optional) convert the whole HFS path to lower case pdsMapping - (optional) whether to convert data set segments to directories, default is true tagFile - (optional) a file contains a list of members and their tag tagMapping - (optional) whether to add tag to the directory path, default is true
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ATTR_EXTENSION
static java.lang.String
ATTR_HLQ
static java.lang.String
ATTR_PDS_ENCODING
static java.lang.String
ATTR_PDS_MAPPING
static java.lang.String
ATTR_TAG_FILE
static java.lang.String
ATTR_TAG_MAPPING
static java.lang.String
ATTR_TARGET_DIR
static java.lang.String
ATTR_TO_LOWER
-
Constructor Summary
Constructors Constructor Description MappingRule(java.io.File repository, java.util.Map<java.lang.String,java.lang.String> attributes)
Construct a Mapping Rule from a local GIT repository and a list of attributes known by this mapping rule
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<MappingInfo>
generateMapping(java.lang.String selector)
Generate a list ofcom.ibm.dbb.migration.MappingInfo
for a given data set.-
Methods inherited from class com.ibm.dbb.migration.AbstractMappingRule
getAttr, getAttr, getBooleanAttr, getBooleanAttr, getFileAttr
-
-
-
-
Field Detail
-
ATTR_HLQ
public static final java.lang.String ATTR_HLQ
- See Also:
- Constant Field Values
-
ATTR_TARGET_DIR
public static final java.lang.String ATTR_TARGET_DIR
- See Also:
- Constant Field Values
-
ATTR_TO_LOWER
public static final java.lang.String ATTR_TO_LOWER
- See Also:
- Constant Field Values
-
ATTR_EXTENSION
public static final java.lang.String ATTR_EXTENSION
- See Also:
- Constant Field Values
-
ATTR_PDS_ENCODING
public static final java.lang.String ATTR_PDS_ENCODING
- See Also:
- Constant Field Values
-
ATTR_PDS_MAPPING
public static final java.lang.String ATTR_PDS_MAPPING
- See Also:
- Constant Field Values
-
ATTR_TAG_MAPPING
public static final java.lang.String ATTR_TAG_MAPPING
- See Also:
- Constant Field Values
-
ATTR_TAG_FILE
public static final java.lang.String ATTR_TAG_FILE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MappingRule
public MappingRule(java.io.File repository, java.util.Map<java.lang.String,java.lang.String> attributes)
Construct a Mapping Rule from a local GIT repository and a list of attributes known by this mapping rule- Parameters:
repository
- the local GIT repositoryattributes
- the attributes of the mapping rule
-
-
Method Detail
-
generateMapping
public java.util.List<MappingInfo> generateMapping(java.lang.String selector) throws java.io.IOException
Generate a list ofcom.ibm.dbb.migration.MappingInfo
for a given data set.- Specified by:
generateMapping
in interfaceIMappingRule
- Parameters:
selector
- the data set or tag to be migrated- Returns:
- a list of mappings based on the mapping strategy defined by the mapping rule
- Throws:
java.io.IOException
- an exception occurred when generating the mapping info- See Also:
IMappingRule
-
-