KickJava   Java API By Example, From Geeks To Geeks.

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


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  * Corresponds to the <Get> tag in the SyncML represent DTD
24  *
25  * @author Stefano Fornari @ Funambol
26  *
27  * @version $Id: Get.java,v 1.4 2005/03/02 20:57:37 harrie Exp $
28  */

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

40     /** For serialization purposes */
41     protected Get() {}
42
43     /**
44      * Creates a new Get object with the given command identifier,
45      * noResponse, language, credential, meta and an array of item
46      *
47      * @param cmdID the command identifier - NOT NULL
48      * @param noResp true if no response is required
49      * @param lang the preferred language for results data
50      * @param cred the authentication credential
51      * @param meta the meta information
52      * @param items the array of item - NOT NULL
53      *
54      */

55     public Get(final CmdID cmdID,
56                final boolean noResp,
57                final String JavaDoc lang,
58                final Cred cred,
59                final Meta meta,
60                final Item[] items) {
61         super(cmdID, meta, items);
62
63         setCred(cred);
64         
65         this.noResp = (noResp) ? new Boolean JavaDoc(noResp) : null;
66         this.lang = lang;
67     }
68     
69    // ----------------------------------------------------------- Public methods
70

71     /**
72      * Gets the command name property
73      *
74      * @return the command name property
75      */

76     public String JavaDoc getName() {
77         return Get.COMMAND_NAME;
78     }
79     
80     /**
81      * Returns the preferred language
82      *
83      * @return the preferred language
84      *
85      */

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

95     public void setLang(String JavaDoc lang) {
96         this.lang = lang;
97     }
98 }
Popular Tags