KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > sync4j > framework > server > Sync4jSourceType


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.framework.server;
20
21 import java.io.Serializable JavaDoc;
22 import org.apache.commons.lang.builder.ToStringBuilder;
23
24 import sync4j.framework.engine.source.SyncSource;
25 import sync4j.framework.engine.source.SyncSourceException;
26
27 /**
28  * This class represents a Sync4j source type with a list of SyncSource
29  * with the same type.
30  *
31  * @author Luigia Fassina @ Funambol
32  *
33  * @version $Id: Sync4jSourceType.java,v 1.6 2005/03/02 20:57:38 harrie Exp $
34  *
35  */

36 public class Sync4jSourceType implements Serializable JavaDoc {
37
38     private String JavaDoc sourceTypeId;
39     private String JavaDoc description;
40     private String JavaDoc config;
41     private String JavaDoc adminClass;
42     private SyncSource[] syncSource;
43     private SyncSourceException[] syncSourceFailed;
44
45     /** Creates a new instance of SyncSourceType */
46     public Sync4jSourceType() {
47         this(null, null, null,null);
48     }
49
50     public Sync4jSourceType(String JavaDoc sourceTypeId,
51                             String JavaDoc description ,
52                             String JavaDoc config ,
53                             String JavaDoc adminClass ) {
54         this.sourceTypeId = sourceTypeId;
55         this.description = description;
56         this.config = config;
57         this.adminClass = adminClass;
58     }
59
60     /** Getter for property sourceTypeId.
61      * @return Value of property sourceTypeId.
62      *
63      */

64     public String JavaDoc getSourceTypeId() {
65         return sourceTypeId;
66     }
67
68     /** Setter for property sourceTypeId.
69      * @param sourceTypeId New value of property sourceTypeId.
70      *
71      */

72     public void setSourceTypeId(String JavaDoc sourceTypeId) {
73         this.sourceTypeId = sourceTypeId;
74     }
75
76     /** Getter for property description.
77      * @return Value of property description.
78      *
79      */

80     public String JavaDoc getDescription() {
81         return description;
82     }
83
84     /** Setter for property description.
85      * @param description New value of property description.
86      *
87      */

88     public void setDescription(String JavaDoc description) {
89         this.description = description;
90     }
91
92     /** Getter for property config.
93      * @return Value of property config.
94      *
95      */

96     public String JavaDoc getConfig() {
97         return config;
98     }
99
100     /** Setter for property config.
101      * @param config New value of property config.
102      *
103      */

104     public void setConfig(String JavaDoc config) {
105         this.config = config;
106     }
107
108     /** Getter for property adminClass.
109      * @return Value of property adminClass.
110      *
111      */

112     public String JavaDoc getAdminClass() {
113         return adminClass;
114     }
115
116     /** Setter for property adminClass.
117      * @param adminClass New value of property adminClass.
118      *
119      */

120     public void setAdminClass(String JavaDoc adminClass) {
121         this.adminClass = adminClass;
122     }
123
124     /**
125      * Set an array of instances of SyncSource
126      */

127     public void setSyncSources(SyncSource[] syncSource) {
128         this.syncSource = syncSource;
129     }
130     public SyncSource[] getSyncSources() {
131         return this.syncSource;
132     }
133
134     /**
135      * Set an array of SyncSourceException with the uri of SyncSource with
136      * creations failed
137      */

138     public void setSyncSourcesFailed(SyncSourceException[] syncSourceFailed) {
139         this.syncSourceFailed = syncSourceFailed;
140     }
141     public SyncSourceException[] getSyncSourcesFailed() {
142         return this.syncSourceFailed;
143     }
144     
145     public String JavaDoc toString() {
146         ToStringBuilder sb = new ToStringBuilder(this);
147
148          sb.append("sourceTypeId", sourceTypeId);
149          sb.append("description" , description);
150          sb.append("config" , config);
151          sb.append("adminClass" , adminClass);
152
153          return sb.toString();
154     }
155
156 }
157
Popular Tags