Class ZosDsn


  • public class ZosDsn
    extends Object
    ZosDsn class that provides CRUD operations on Datasets
    Version:
    1.0
    Author:
    Leonid Baranov
    • Constructor Detail

      • ZosDsn

        public ZosDsn​(ZOSConnection connection)
        ZosDsn Constructor
        Parameters:
        connection - connection information, see ZOSConnection object
      • ZosDsn

        public ZosDsn​(ZOSConnection connection,
                      ZoweRequest request)
        Alternative ZosDsn 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 type object
    • Method Detail

      • createDsn

        public Response createDsn​(String dataSetName,
                                  CreateParams params)
                           throws Exception
        Creates a new dataset with specified parameters
        Parameters:
        dataSetName - name of a dataset to create (e.g. 'DATASET.LIB')
        params - create dataset parameters, see CreateParams object
        Returns:
        http response object
        Throws:
        Exception - error processing request
      • deleteDsn

        public Response deleteDsn​(String dataSetName,
                                  String member)
                           throws Exception
        Delete a dataset member
        Parameters:
        dataSetName - name of a dataset (e.g. 'DATASET.LIB')
        member - name of member to delete
        Returns:
        http response object
        Throws:
        Exception - error processing request
      • deleteDsn

        public Response deleteDsn​(String dataSetName)
                           throws Exception
        Delete a dataset
        Parameters:
        dataSetName - name of a dataset (e.g. 'DATASET.LIB')
        Returns:
        http response object
        Throws:
        Exception - error processing request
      • getDataSetInfo

        public Dataset getDataSetInfo​(String dataSetName)
                               throws Exception
        Retrieves the information about a Dataset.
        Parameters:
        dataSetName - sequential or partition dataset (e.g. 'DATASET.LIB')
        Returns:
        dataset object
        Throws:
        Exception - error processing request
      • writeDsn

        public Response writeDsn​(String dataSetName,
                                 String member,
                                 String content)
                          throws Exception
        Replaces the content of a member of a partitioned data set (PDS or PDSE) with new content. A new dataset member will be created if the specified dataset member does not exist.
        Parameters:
        dataSetName - dataset name of where the member is located (e.g. 'DATASET.LIB')
        member - name of member to add new content
        content - new content
        Returns:
        http response object
        Throws:
        Exception - error processing request
      • writeDsn

        public Response writeDsn​(String dataSetName,
                                 String content)
                          throws Exception
        Replaces the content of an existing sequential data set with new content.
        Parameters:
        dataSetName - sequential dataset (e.g. 'DATASET.LIB')
        content - new content
        Returns:
        http response object
        Throws:
        Exception - error processing request