com.ibm.dbb.migration

Class 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
    • 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 repository
        attributes - 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 of com.ibm.dbb.migration.MappingInfo for a given data set.
        Specified by:
        generateMapping in interface IMappingRule
        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

<IBM Copyright © 2018 IBM Corp. All Rights Reserved.