Class DsnCopy


  • public class DsnCopy
    extends Object
    Provides copy dataset and dataset member functionality
    Version:
    2.0
    Author:
    Leonid Baranov, Frank Giordano
    • Constructor Detail

      • DsnCopy

        public DsnCopy​(ZosConnection connection)
        DsnCopy constructor
        Parameters:
        connection - is a connection, see ZosConnection object
      • DsnCopy

        public DsnCopy​(ZosConnection connection,
                       ZosmfRequest request)
        Alternative DsnCopy constructor with ZoweRequest object. This is mainly used for internal code unit testing with mockito, and it is not recommended to be used by the larger community.
        Parameters:
        connection - connection information, see ZosConnection object
        request - any compatible ZoweRequest Interface object
    • Method Detail

      • copy

        public Response copy​(String fromDataSetName,
                             String toDataSetName,
                             boolean replace,
                             boolean copyAllMembers)
                      throws ZosmfRequestException
        This copy method allows the following copy operations:

        - sequential dataset to sequential dataset - sequential dataset to partition dataset member - partition dataset member to partition dataset member - partition dataset member to partition dataset non-existing member - partition dataset member to sequential dataset

        If copyAllMembers parameter value sent as true it will perform a copy of all members in source partition dataset to the target partition dataset if no member name included in the source partition dataset value (fromDataSetName).

        Parameters:
        fromDataSetName - is a name of source dataset (e.g. 'SOURCE.DATASET' or 'SOURCE.DATASET(MEMBER)')
        toDataSetName - is a name of target dataset (e.g. 'TARGET.DATASET' or 'TARGET.DATASET(MEMBER)')
        replace - if true members in the target dataset are replaced
        copyAllMembers - if true copy all members in source partition dataset specified
        Returns:
        http response object
        Throws:
        ZosmfRequestException - request error state
      • copyCommon

        public Response copyCommon​(CopyParams params)
                            throws ZosmfRequestException
        Copy dataset or dataset member request driven by CopyParams object settings
        Parameters:
        params - contains copy dataset parameters
        Returns:
        http response object
        Throws:
        ZosmfRequestException - request error state