KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > sync4j > server > engine > Sync4jSource


1 /**
2  * Copyright (C) 2003-2005 Funambol
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  */

18
19 package sync4j.server.engine;
20
21 import org.apache.commons.lang.builder.ToStringBuilder;
22
23 /**
24  * This class represent an addressable SyncML source registered to Sync4j.
25  * It is not intended to store specific SyncSource information.
26  *
27  * @author Stefano Fornari @ Funambol
28  *
29  * @version $Id: Sync4jSource.java,v 1.1 2005/05/16 17:32:56 nichele Exp $
30  */

31 public class Sync4jSource {
32     
33     private String JavaDoc uri; // the source uri
34
private String JavaDoc config; // the source configuration file
35
private String JavaDoc sourceTypeId; // the source type id
36
private String JavaDoc sourceName; //the source name
37

38     /** Creates a new instance of Sync4jSyncSource */
39     public Sync4jSource() {
40         this(null, null, null, null);
41     }
42     
43     public Sync4jSource(String JavaDoc uri, String JavaDoc config) {
44         this.uri = uri ;
45         this.config = config;
46     }
47
48     public Sync4jSource(String JavaDoc uri, String JavaDoc config, String JavaDoc sourceTypeId, String JavaDoc sourceName) {
49         this.uri = uri ;
50         this.config = config;
51         this.sourceTypeId = sourceTypeId;
52         this.sourceName = sourceName;
53     }
54     
55     /** Getter for property uri.
56      * @return Value of property uri.
57      *
58      */

59     public String JavaDoc getUri() {
60         return uri;
61     }
62     
63     /** Setter for property uri.
64      * @param name New value of property uri.
65      *
66      */

67     public void setUri(String JavaDoc uri) {
68         this.uri = uri;
69     }
70     
71     /** Getter for property config.
72      * @return Value of property config.
73      *
74      */

75     public String JavaDoc getConfig() {
76         return config;
77     }
78     
79     /** Setter for property config.
80      * @param config New value of property config.
81      *
82      */

83     public void setConfig(String JavaDoc config) {
84         this.config = config;
85     }
86     
87     /** Getter for property sourceTypeId.
88      * @return Value of property sourceTypeId.
89      *
90      */

91     public String JavaDoc getSourceTypeId() {
92         return sourceTypeId;
93     }
94     
95     /** Setter for property sourceTypeId.
96      * @param config New value of property sourceTypeId.
97      *
98      */

99     public void setSourceTypeId(String JavaDoc sourceTypeId) {
100         this.sourceTypeId = sourceTypeId;
101     }
102     
103     /** Getter for property sourceName.
104      * @return Value of property sourceName.
105      *
106      */

107     public String JavaDoc getSourceName() {
108         return sourceName;
109     }
110     
111     /** Setter for property sourceName.
112      * @param config New value of property sourceName.
113      *
114      */

115     public void setSourceName(String JavaDoc sourceName) {
116         this.sourceName = sourceName;
117     }
118         
119     public String JavaDoc toString() {
120         ToStringBuilder sb = new ToStringBuilder(this);
121
122          sb.append("uri", uri );
123          sb.append("config", config);
124          sb.append("sourceTypeId", sourceTypeId);
125          sb.append("sourceName", sourceName);
126
127          return sb.toString();
128     }
129     
130 }
Popular Tags