-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathSender.java
More file actions
57 lines (44 loc) · 1.33 KB
/
Copy pathSender.java
File metadata and controls
57 lines (44 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package pl.smsapi.sender;
import java.util.ArrayList;
import pl.smsapi.message.Account;
import pl.smsapi.message.Message;
import pl.smsapi.message.MessageInterface;
import pl.smsapi.message.Result;
public abstract class Sender {
private String protocol = "https";
private String hostForHttps = "ssl.smsapi.pl";
private String hostForHttp = "api.smsapi.pl";
protected String path;
protected MessageInterface message;
protected ArrayList<Result> results = new ArrayList<Result>();
//----abstract method--------------
public abstract boolean send();
//---end--abstract method---------
public final String getProtocol() {
return protocol;
}
public final ArrayList<Result> getResults() {
return results;
}
public final String getHost() {
return protocol.equals("http") == true ? hostForHttp : hostForHttps;
}
public final void setHostForHttp(String hostUrl) {
this.hostForHttp = hostUrl;
}
public final void setHostForHttps(String hostUrl) {
this.hostForHttps = hostUrl;
}
public final Message getMessage() {
return (Message) message;
}
public final void setMessage(MessageInterface message) {
this.message = message;
}
abstract public void setMethod(Object method);
public final void setProtocol(String protocol) {
if (protocol.equals("http") || protocol.equals("https")) {
this.protocol = protocol;
}
}
}