Skip to content

Commit 9411865

Browse files
committed
Update property name based on review
1 parent 1a373b9 commit 9411865

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.idea/*
2+
.settings/org.eclipse.jdt.ui.prefs
23
.DS_Store
34
target/*
45
target-display/*

src/main/java/wa/client/Client.java

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public class Client extends WebSocketListener implements ThreadManager, Runnable
8282

8383
private WebSocket webSocket;
8484

85-
private String IAMAccessToken = null;
85+
private String iamAccessToken = null;
8686

8787
private String skillset = null;
8888

@@ -98,10 +98,6 @@ public class Client extends WebSocketListener implements ThreadManager, Runnable
9898

9999
private String userID = null;
100100

101-
private Debouncer<String> debouncer;
102-
103-
private final int watchDogTimeout = 5000;
104-
105101
private String watsonVoice = null;
106102

107103
private int commandSocketPort;
@@ -305,7 +301,7 @@ public void run() {
305301
}
306302
if (ServerConnectionStatus.NOTCONNECTED == getServerConnectionStatus()) {
307303
// IAMAccessToken should be retrieved from the IAM service by providing it with your cloud API Key (based on your IBM ID)
308-
IAMAccessToken = getIAMAccessToken(keyIAMAPI);
304+
iamAccessToken = getIAMAccessToken(iamAPiKey);
309305

310306
// We need to connect...
311307
connect();
@@ -930,7 +926,7 @@ private void continueConversation(String id, JSONObject complexPromptSttOptions)
930926

931927
private int writeToServerCount;
932928
private int writeToServerBytes;
933-
private String keyIAMAPI;
929+
private String iamAPiKey;
934930

935931
public synchronized void clearServerWriteLogging() {
936932
writeToServerCount = 0;
@@ -1046,7 +1042,7 @@ private void joinThreads(Exception e) {
10461042
private void initialize(Properties props) {
10471043
// Required parameters
10481044
watsonHost = props.getProperty("host");
1049-
keyIAMAPI = props.getProperty("IAMAPIKey");
1045+
iamAPiKey = props.getProperty("IAMAPIKey");
10501046
skillset = props.getProperty("skillset");
10511047

10521048
// Optional parameters
@@ -1075,12 +1071,12 @@ private void initialize(Properties props) {
10751071
LOG.info("WATSON HOST: " + watsonHost);
10761072
LOG.info("WATSON PORT (Optional): " + watsonPort);
10771073
LOG.info("SKILLSET: " + skillset);
1078-
LOG.info("WATSON IAM API Key: " + (null == keyIAMAPI ? "null" : "*****"));
1074+
LOG.info("WATSON IAM API Key: " + (null == iamAPiKey ? "null" : "*****"));
10791075
LOG.info("USER ID (Optional): " + userID);
10801076
LOG.info("Language (Optional): " + language);
10811077
LOG.info("Engine (Optional): " + engine);
10821078

1083-
if (StringUtils.isBlank(watsonHost) || StringUtils.isBlank(skillset) || StringUtils.isBlank(keyIAMAPI)) {
1079+
if (StringUtils.isBlank(watsonHost) || StringUtils.isBlank(skillset) || StringUtils.isBlank(iamAPiKey)) {
10841080
LocalAudio.playFlacFile(LocalAudio.ERROR_INVALID_CONFIG);
10851081
throw new Error("Missing required host, authentication or configuration information. Check the configure.properties file. Aborting...");
10861082
}
@@ -1201,7 +1197,7 @@ private synchronized void connect() throws InterruptedException {
12011197
+ (watsonPort == null ? "" : ":" + watsonPort) + "?skillset=" + skillset+"&userID=" + userID + "&language=" + language + "&engine=" + engine;
12021198
Request request = new Request.Builder()
12031199
.url(webSocketUrl)
1204-
.addHeader("Authorization", "Bearer " + IAMAccessToken)
1200+
.addHeader("Authorization", "Bearer " + iamAccessToken)
12051201
.build();
12061202

12071203
// initialize the watch dog

0 commit comments

Comments
 (0)