KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > sync4j > framework > core > Put


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
20 package sync4j.framework.core;
21
22 /**
23  *
24  * This class represents the <Put> tag as defined by the SyncML
25  * representation specifications.
26  *
27  * @author Stefano Fornari @ Funambol
28  *
29  * @version $Id: Put.java,v 1.3 2005/03/02 20:57:37 harrie Exp $
30  */

31 public final class Put
32 extends ItemizedCommand
33 implements java.io.Serializable JavaDoc {
34     
35     // --------------------------------------------------------------- Constants
36
public static String JavaDoc COMMAND_NAME = "Put";
37     
38     // ------------------------------------------------------------ Private data
39
private String JavaDoc lang;
40     
41     // ------------------------------------------------------------ Constructors
42

43     /**
44      * For serialization purposes
45      */

46     protected Put() {}
47     
48     /**
49      * Creates a new Put object given its elements.
50      *
51      * @param cmdID the command identifier - NOT NULL
52      * @param noResp is <NoResponse/> required?
53      * @param lang Preferred language
54      * @param cred authentication credentials
55      * @param meta meta information
56      * @param items Item elements - NOT NULL
57      *
58      * @throws IllegalArgumentException if any NOT NULL parameter is null
59      */

60     public Put(
61         final CmdID cmdID ,
62         final boolean noResp,
63         final String JavaDoc lang ,
64         final Cred cred ,
65         final Meta meta ,
66         final Item[] items ) {
67         super(cmdID, meta, items);
68              
69         setCred(cred);
70         this.noResp = (noResp) ? new Boolean JavaDoc(noResp) : null;
71         this.lang = lang;
72     }
73     
74
75     
76    // ----------------------------------------------------------- Public methods
77

78     /**
79      * Returns the preferred language
80      *
81      * @return the preferred language
82      *
83      */

84     public String JavaDoc getLang() {
85         return lang;
86     }
87     
88     /**
89      * Sets the preferred language
90      *
91      * @param lang new preferred language
92      */

93     public void setLang(String JavaDoc lang) {
94         this.lang = lang;
95     }
96     
97     /**
98      * Returns the command name
99      *
100      * @return the command name
101      */

102     public String JavaDoc getName() {
103         return Put.COMMAND_NAME;
104     }
105 }
106
Popular Tags