UNPKG

@zowe/cli

Version:

Zowe CLI is a command line interface (CLI) that provides a simple and streamlined way to interact with IBM z/OS.

33 lines (32 loc) 1.62 kB
import { AbstractSession, ICommandHandler, IHandlerParameters, IProfile } from "@zowe/imperative"; import { IZosFilesResponse } from "../api/doc/IZosFilesResponse"; /** * This class is used by the various zosfiles handlers as the base class for their implementation. * All handlers within zosfiles should extend this class. * * This class should not be used outside of the zosfiles package. * * @private */ export declare abstract class ZosFilesBaseHandler implements ICommandHandler { /** * This will grab the zosmf profile and create a session before calling the subclass * {@link ZosFilesBaseHandler#processWithSession} method. * * @param {IHandlerParameters} commandParameters Command parameters sent by imperative. * * @returns {Promise<void>} */ process(commandParameters: IHandlerParameters): Promise<void>; /** * This is called by the {@link ZosFilesBaseHandler#process} after it creates a session. Should * be used so that every class under files does not have to instantiate the session object. * * @param {IHandlerParameters} commandParameters Command parameters sent to the handler. * @param {AbstractSession} session The session object generated from the zosmf profile. * @param {IProfile} zosmfProfile The zosmf profile that was loaded for the command. * * @returns {Promise<IZosFilesResponse>} The response from the underlying zos-files api call. */ abstract processWithSession(commandParameters: IHandlerParameters, session: AbstractSession, zosmfProfile: IProfile): Promise<IZosFilesResponse>; }