Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions src/main/java/zowe/client/sdk/parse/JsonParseFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ public static JsonParse buildParser(final ParseType type) {
case MEMBER:
parseResponse = MemberJsonParse.getInstance();
break;
case MVS_CONSOLE:
parseResponse = MvsConsoleJsonParse.getInstance();
break;
case PROPS:
parseResponse = PropsJsonParse.getInstance();
break;
Expand Down
76 changes: 0 additions & 76 deletions src/main/java/zowe/client/sdk/parse/MvsConsoleJsonParse.java

This file was deleted.

4 changes: 0 additions & 4 deletions src/main/java/zowe/client/sdk/parse/type/ParseType.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ public enum ParseType {
* member type
*/
MEMBER,
/**
* mvs console type
*/
MVS_CONSOLE,
/**
* property type
*/
Expand Down
41 changes: 41 additions & 0 deletions src/main/java/zowe/client/sdk/utility/ConsoleUtils.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* This program and the accompanying materials are made available under the terms of the
* Eclipse Public License v2.0 which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-v20.html
*
* SPDX-License-Identifier: EPL-2.0
*
* Copyright Contributors to the Zowe Project.
*/
package zowe.client.sdk.utility;

/**
* Utility class contains helper methods for console processing.
*
* @author Frank Giordano
* @version 5.0
*/
public final class ConsoleUtils {

/**
* Private constructor defined to avoid instantiation of class
*/
private ConsoleUtils() {
throw new IllegalStateException("Utility class");
}

/**
* Process response from console command. Add a line break if needed.
*
* @param response string value of response from console command
* @return string value of response with line break added if needed
*/
public static String processCmdResponse(String response) {
response = response.replace('\r', '\n');
if (!response.isBlank() && response.charAt(response.length() - 1) != '\n') {
response = response + "\n";
}
return response;
}

}
2 changes: 1 addition & 1 deletion src/main/java/zowe/client/sdk/utility/EncodeUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import java.util.Base64;

/**
* Utility class contains helper methods for encoding processing
* Utility class contains helper methods for encoding processing.
*
* @author Frank Giordano
* @version 5.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@
import zowe.client.sdk.rest.exception.ZosmfRequestException;

/**
* Utility class contains helper methods for JSON parse processing
* Utility class contains helper methods for JSON parse processing.
*
* @author Frank Giordano
* @version 5.0
*/
public final class JsonParserUtil {
public final class JsonParserUtils {

private static final Logger LOG = LoggerFactory.getLogger(JsonParserUtil.class);
private static final Logger LOG = LoggerFactory.getLogger(JsonParserUtils.class);

private static final String PARSE_ERROR_MSG = "json response parse error";

/**
* Private constructor defined to avoid instantiation of class
*/
private JsonParserUtil() {
private JsonParserUtils() {
throw new IllegalStateException("Utility class");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@
import java.util.concurrent.atomic.AtomicInteger;

/**
* Utility class contains helper methods for response processing
* Utility class contains helper methods for TSO response processing.
*
* @author Frank Giordano
* @version 5.0
*/
public class TsoUtil {
public final class TsoUtils {

/**
* Private constructor defined to avoid instantiation of class
*/
private TsoUtil() {
private TsoUtils() {
throw new IllegalStateException("Utility class");
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/zowe/client/sdk/utility/ValidateUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import java.util.Optional;

/**
* Utility class contains helper methods for validation processing
* Utility class contains helper methods for validation processing.
*
* @author Frank Giordano
* @version 5.0
Expand Down
19 changes: 10 additions & 9 deletions src/main/java/zowe/client/sdk/zosconsole/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ import zowe.client.sdk.core.ZosConnectionFactory;
import zowe.client.sdk.examples.TstZosConnection;
import zowe.client.sdk.rest.exception.ZosmfRequestException;
import zowe.client.sdk.zosconsole.ConsoleConstants;
import zowe.client.sdk.zosconsole.input.IssueConsoleInputData;
import zowe.client.sdk.zosconsole.method.IssueConsole;
import zowe.client.sdk.zosconsole.input.ConsoleCmdInputData;
import zowe.client.sdk.zosconsole.method.ConsoleCmd;
import zowe.client.sdk.zosconsole.response.ConsoleGetResponse;
import zowe.client.sdk.zosconsole.response.ConsoleResponse;

/**
Expand Down Expand Up @@ -50,10 +51,10 @@ public class IssueConsoleExp extends TstZosConnection {
* @author Frank Giordano
*/
public static void issueCommand(ZosConnection connection, String cmd) {
ConsoleResponse response;
ConsoleGetResponse response;
try {
IssueConsole issueConsole = new IssueConsole(connection);
response = issueConsole.issueCommand(cmd);
ConsoleCmd consoleCmd = new ConsoleCmd(connection);
response = consoleCmd.issueCommand(cmd);
} catch (ZosmfRequestException e) {
String errMsg = (String) e.getResponse().getResponsePhrase().orElse(e.getMessage());
throw new RuntimeException(errMsg);
Expand All @@ -70,12 +71,12 @@ public class IssueConsoleExp extends TstZosConnection {
* @author Frank Giordano
*/
public static void issueCommandCommon(ZosConnection connection, String cmd) {
ConsoleResponse response;
ConsoleGetResponse response;
try {
IssueConsole issueConsole = new IssueConsole(connection);
IssueConsoleInputData consoleInputData = new IssueConsoleInputData(cmd);
ConsoleCmd consoleCmd = new ConsoleCmd(connection);
ConsoleCmdInputData consoleInputData = new ConsoleCmdInputData(cmd);
consoleInputData.setProcessResponse();
response = issueConsole.issueCommandCommon(ConsoleConstants.RES_DEF_CN, consoleInputData);
response = consoleCmd.issueCommandCommon(ConsoleConstants.RES_DEF_CN, consoleInputData);
} catch (ZosmfRequestException e) {
String errMsg = (String) e.getResponse().getResponsePhrase().orElse(e.getMessage());
throw new RuntimeException(errMsg);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
import java.util.Optional;

/**
* The z/OSMF console API parameters. See the z/OSMF REST API documentation for full details.
* The z/OSMF console command API parameters. See the z/OSMF REST API documentation for full details.
*
* @author Frank Giordano
* @version 5.0
*/
public class IssueConsoleInputData {
public class ConsoleCmdInputData {

/**
* The z/OS console command to issue.
Expand All @@ -28,7 +28,7 @@ public class IssueConsoleInputData {

/**
* The solicited keyword to check for in the response. Causes the API to return immediately when the keyword
* is found, however, it may include solicited command response messages beyond the keyword itself.
* is found; however, it may include solicited command response messages beyond the keyword itself.
*/
private String solKey;

Expand All @@ -38,8 +38,10 @@ public class IssueConsoleInputData {
private String system;

/**
* The z/OSMF Console API returns '\r' or '\r\n' where line-breaks. Can attempt to replace these
* sequences with '\n', but there may be cases where that are not preferable. Specify false to prevent processing.
* The z/OSMF Console API returns '\r' or '\r\n' where line-breaks.
* You can use the following flag variable to replace these sequences with '\n'.
* But there may be cases where this may not be preferable.
* Specify false to prevent processing.
*/
private boolean processResponse = false;

Expand All @@ -49,7 +51,7 @@ public class IssueConsoleInputData {
* @param command console command to issue
* @author Frank Giordano
*/
public IssueConsoleInputData(final String command) {
public ConsoleCmdInputData(final String command) {
ValidateUtils.checkIllegalParameter(command, "command");
this.cmd = command;
}
Expand Down
Loading