@broadcom/ca7-for-zowe-cli
Version:
CA 7 Workload Automation Plug-in for Zowe CLI
27 lines (26 loc) • 1.25 kB
TypeScript
import { Session, ICommandHandler, IHandlerParameters } from "@zowe/imperative";
/**
* This class is used by the various CA7 handlers as the base class for their implementation.
* All handlers should extend this class whenever possible
*/
export declare abstract class CA7BaseHandler implements ICommandHandler {
/**
* This will grab the CA7 profile and create a session before calling the subclass
* {@link CA7BaseHandler#processWithSession} method.
*
* @param {IHandlerParameters} commandParameters Command parameters sent by imperative.
*
* @returns {Promise<void>}
*/
process(commandParameters: IHandlerParameters): Promise<void>;
/**
* This is called by the {@link CA7BaseHandler#process} after it creates a session. Should
* be used so that every class does not have to instantiate the session object.
*
* @param {IHandlerParameters} commandParameters Command parameters sent to the handler.
* @param {Session} session The session object generated from the CA7 profile.
*
* @returns {Promise<void>} The response from the underlying CA7 api call.
*/
abstract processWithSession(commandParameters: IHandlerParameters, session: Session): Promise<void>;
}