Skip to content

Commit 9845197

Browse files
author
lb13810398408
committed
变量声明部分修改
1 parent b2efee9 commit 9845197

1 file changed

Lines changed: 10 additions & 11 deletions

File tree

client/java/Httpsqs_client.java

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@
77
import java.net.*;
88

99
class Httpsqs_client {
10-
int i = 0;
11-
String SERVER, PORT, CHARSET;
10+
private String server, port, charset;
1211

1312
public Httpsqs_client(String server, String port, String charset) {
14-
SERVER = server;
15-
PORT = port;
16-
CHARSET = charset;
13+
this.server = server;
14+
this.port = port;
15+
this.charset = charset;
1716
}
1817

1918
private String doprocess(String urlstr) {
@@ -40,47 +39,47 @@ private String doprocess(String urlstr) {
4039
}
4140

4241
public String maxqueue(String queue_name, String num) {
43-
String urlstr = "http://" + SERVER + ":" + PORT + "/?name=" + queue_name + "&opt=maxqueue&num=" + num;
42+
String urlstr = "http://" + this.server + ":" + this.port + "/?name=" + queue_name + "&opt=maxqueue&num=" + num;
4443
String result = null;
4544

4645
result = this.doprocess(urlstr);
4746
return result;
4847
}
4948

5049
public String reset(String queue_name) {
51-
String urlstr = "http://" + SERVER + ":" + PORT + "/?name=" + queue_name + "&opt=reset";
50+
String urlstr = "http://" + this.server + ":" + this.port + "/?name=" + queue_name + "&opt=reset";
5251
String result = null;
5352

5453
result = this.doprocess(urlstr);
5554
return result;
5655
}
5756

5857
public String view(String queue_name, String pos) {
59-
String urlstr = "http://" + SERVER + ":" + PORT + "/?charset=" + CHARSET + "&name=" + queue_name + "&opt=view&pos=" + pos;
58+
String urlstr = "http://" + this.server + ":" + this.port + "/?charset=" + this.charset + "&name=" + queue_name + "&opt=view&pos=" + pos;
6059
String result = null;
6160

6261
result = this.doprocess(urlstr);
6362
return result;
6463
}
6564

6665
public String status(String queue_name) {
67-
String urlstr = "http://" + SERVER + ":" + PORT + "/?name=" + queue_name + "&opt=status";
66+
String urlstr = "http://" + this.server + ":" + this.port + "/?name=" + queue_name + "&opt=status";
6867
String result = null;
6968

7069
result = this.doprocess(urlstr);
7170
return result;
7271
}
7372

7473
public String get(String queue_name) {
75-
String urlstr = "http://" + SERVER + ":" + PORT + "/?charset=" + CHARSET + "&name=" + queue_name + "&opt=get";
74+
String urlstr = "http://" + this.server + ":" + this.port + "/?charset=" + this.charset + "&name=" + queue_name + "&opt=get";
7675
String result = null;
7776

7877
result = this.doprocess(urlstr);
7978
return result;
8079
}
8180

8281
public String put(String queue_name, String data) {
83-
String urlstr = "http://" + SERVER + ":" + PORT + "/?name=" + queue_name + "&opt=put";
82+
String urlstr = "http://" + this.server + ":" + this.port + "/?name=" + queue_name + "&opt=put";
8483
URL url = null;
8584
try {
8685
url = new URL(urlstr);

0 commit comments

Comments
 (0)