KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > services > communication > sms > provider > prodat > ProdatOperatorImpl


1 /**
2  * Copyright 2001-2004 The eXo platform SARL All rights reserved.
3  * Please look at license.txt in info directory for more license detail.
4  **/

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 /**
12  * @author Ove Ranheim (oranheim@yahoo.no)
13  * @since Jun 17, 2004 9:10:35 PM
14  */

15 public class ProdatOperatorImpl implements Operator {
16
17     private SmsMethod _method = SmsMethod.HTTP_CLIENT;
18     private String JavaDoc _socket_host = "217.149.126.50";
19     private String JavaDoc _http_host = "217.149.126.53";
20     private String JavaDoc _socket_port = "1111";
21     private String JavaDoc _http_port = "80";
22     private String JavaDoc _username;
23     private String JavaDoc _password;
24     
25     public ProdatOperatorImpl() {
26     }
27     
28     
29
30     /*
31      * @see org.exoplatform.services.communication.sms.provider.Operator#getMethod()
32      */

33     public SmsMethod getMethod() {
34         return _method;
35     }
36
37
38     /*
39      * @see org.exoplatform.services.communication.sms.provider.Operator#setMethod(org.exoplatform.services.communication.sms.provider.SmsMethod)
40      */

41     public void setMethod(SmsMethod method) {
42         _method = method;
43     }
44
45     /*
46      * @see org.exoplatform.services.communication.sms.provider.Operator#getIP()
47      */

48     public String JavaDoc getHost() {
49         return (_method.equals(SmsMethod.SOCKET_CLIENT) ? _socket_host : _http_host);
50     }
51
52     /*
53      * @see org.exoplatform.services.communication.sms.provider.Operator#setIP(java.lang.String)
54      */

55     public void setHost(String JavaDoc 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     /*
64      * @see org.exoplatform.services.communication.sms.provider.Operator#getPort()
65      */

66     public String JavaDoc getPort() {
67         return (_method.equals(SmsMethod.SOCKET_CLIENT) ? _socket_port : _http_port);
68     }
69
70     /*
71      * @see org.exoplatform.services.communication.sms.provider.Operator#setPort(java.lang.String)
72      */

73     public void setPort(String JavaDoc 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     /*
82      * @see org.exoplatform.services.communication.sms.provider.Operator#getUsername()
83      */

84     public String JavaDoc getUsername() {
85         return _username;
86     }
87
88     /*
89      * @see org.exoplatform.services.communication.sms.provider.Operator#setUsername(java.lang.String)
90      */

91     public void setUsername(String JavaDoc username) {
92         _username = username;
93     }
94
95     /*
96      * @see org.exoplatform.services.communication.sms.provider.Operator#getPassword()
97      */

98     public String JavaDoc getPassword() {
99         return _password;
100     }
101
102     /*
103      * @see org.exoplatform.services.communication.sms.provider.Operator#setPassword(java.lang.String)
104      */

105     public void setPassword(String JavaDoc password) {
106         _password = password;
107     }
108
109 }
110
111
112
Popular Tags