1 5 package org.exoplatform.services.communication.sms.provider.prodat; 6 7 import org.exoplatform.services.communication.sms.provider.Operator; 8 import org.exoplatform.services.communication.sms.provider.SmsMethod; 9 10 11 15 public class ProdatOperatorImpl implements Operator { 16 17 private SmsMethod _method = SmsMethod.HTTP_CLIENT; 18 private String _socket_host = "217.149.126.50"; 19 private String _http_host = "217.149.126.53"; 20 private String _socket_port = "1111"; 21 private String _http_port = "80"; 22 private String _username; 23 private String _password; 24 25 public ProdatOperatorImpl() { 26 } 27 28 29 30 33 public SmsMethod getMethod() { 34 return _method; 35 } 36 37 38 41 public void setMethod(SmsMethod method) { 42 _method = method; 43 } 44 45 48 public String getHost() { 49 return (_method.equals(SmsMethod.SOCKET_CLIENT) ? _socket_host : _http_host); 50 } 51 52 55 public void setHost(String host) { 56 if (_method.equals(SmsMethod.SOCKET_CLIENT)) { 57 _socket_host = host; 58 } else if (_method.equals(SmsMethod.HTTP_CLIENT)) { 59 _http_host = host; 60 } 61 } 62 63 66 public String getPort() { 67 return (_method.equals(SmsMethod.SOCKET_CLIENT) ? _socket_port : _http_port); 68 } 69 70 73 public void setPort(String port) { 74 if (_method.equals(SmsMethod.SOCKET_CLIENT)) { 75 _socket_port = port; 76 } else if (_method.equals(SmsMethod.HTTP_CLIENT)) { 77 _http_port = port; 78 } 79 } 80 81 84 public String getUsername() { 85 return _username; 86 } 87 88 91 public void setUsername(String username) { 92 _username = username; 93 } 94 95 98 public String getPassword() { 99 return _password; 100 } 101 102 105 public void setPassword(String password) { 106 _password = password; 107 } 108 109 } 110 111 112 | Popular Tags |