Commit | Line | Data |
---|---|---|
a046fa49 NR |
1 | package be.nikiroo.jvcard.remote; |
2 | ||
e4444b0b NR |
3 | /** |
4 | * This enum list all the possible {@link Command}s you can send to a jVCard | |
5 | * remote servrer. | |
6 | * | |
7 | * @author niki | |
8 | * | |
9 | */ | |
845fb1d7 | 10 | public enum Command { |
e4444b0b NR |
11 | /** |
12 | * Protocol version. | |
13 | * | |
14 | * @return the version of the protocol used by this server | |
15 | */ | |
845fb1d7 | 16 | VERSION, |
e4444b0b NR |
17 | /** |
18 | * Server time. | |
19 | * | |
20 | * @return the TIME of the remote server with the format yyyy-MM-dd HH:mm:ss | |
21 | */ | |
845fb1d7 | 22 | TIME, |
e4444b0b NR |
23 | /** |
24 | * STOP the client communication (the server will now close the | |
25 | * communication) | |
26 | */ | |
845fb1d7 | 27 | STOP, |
a046fa49 | 28 | /** |
e4444b0b NR |
29 | * LIST the cards available on this server. |
30 | * | |
31 | * @param parameter | |
32 | * (optional) a search term that, if given, must be in the name | |
33 | * of the card for it to be returned (case insensitive) | |
34 | * | |
35 | * @return a LIST of all the cards on the remote server that contain the | |
36 | * search term, or all cards if no search term given | |
37 | * | |
38 | * @note The cards are listed each on their own line, preceded by their last | |
39 | * modified time and a space character (" ") | |
40 | * <p> | |
41 | * Example: <tt> | |
42 | * <p> | |
43 | * 2016-03-19 11:13:23 Family.vcf | |
44 | * <p> | |
45 | * 2016-03-19 11:13:23 CoWorkers.vcf | |
a046fa49 | 46 | */ |
845fb1d7 | 47 | LIST_CARD, |
e4444b0b NR |
48 | /** |
49 | * Internationalised help message. | |
50 | * | |
51 | * @return some HELP about the protocol for interactive access | |
52 | */ | |
845fb1d7 | 53 | HELP, |
e4444b0b NR |
54 | /** |
55 | * SELECT a resource (a card) to work on (you can issue *_CARD commands when | |
56 | * in SELECT mode), or leave SELECT mode if already enabled. | |
57 | * | |
58 | * @param parameter | |
59 | * the resource name (the card name) to work on to enter SELECT | |
60 | * mode, or nothing to leave it | |
61 | * | |
62 | * @return the last modified date of the selected card | |
63 | */ | |
845fb1d7 | 64 | SELECT, |
e4444b0b NR |
65 | /** |
66 | * GET a remote card and return it as VCF data. | |
67 | * | |
68 | * @return VCF data | |
69 | */ | |
845fb1d7 | 70 | GET_CARD, |
a046fa49 | 71 | /** |
e4444b0b NR |
72 | * Enter into PUT_CARD mode for the selected card (you can issue *_CONTACT |
73 | * commands when in PUT_CARD mode), or leave PUT_CARD mode if already | |
74 | * enabled. | |
75 | * | |
76 | * @requires SELECT mode must be enabled before | |
a046fa49 | 77 | */ |
845fb1d7 | 78 | PUT_CARD, |
e4444b0b NR |
79 | /** |
80 | * POST a new card to the remote server as the selected resource. | |
81 | * | |
82 | * @input will wait for the card content as VCF data | |
83 | * | |
84 | * @requires SELECT mode must be enabled before | |
85 | */ | |
845fb1d7 | 86 | POST_CARD, |
e4444b0b NR |
87 | /** |
88 | * DELETE the selected contact from the remote server. | |
89 | * | |
90 | * @requires SELECT mode must be enabled before | |
91 | */ | |
845fb1d7 | 92 | DELETE_CARD, |
e4444b0b NR |
93 | /** |
94 | * HASH the selected contact and return the hash, or return empty if not | |
95 | * found. | |
96 | * | |
97 | * @param parameter | |
98 | * the UID of the contact to hash | |
99 | * | |
100 | * @return the hash, or an empty message if not found | |
101 | * | |
102 | * @requires PUT_CARD mode must be enabled before | |
103 | */ | |
845fb1d7 | 104 | HASH_CONTACT, |
e4444b0b NR |
105 | /** |
106 | * LIST the contacts available in the selected card. | |
107 | * | |
108 | * @param parameter | |
109 | * (optional) a search term that, if given, must be present in | |
110 | * the N or FN property of the contact for the contact to be | |
111 | * returned (case insensitive) | |
112 | * | |
113 | * @return a LIST of all the contacts in the selected card that contain the | |
114 | * search term, or all contacts if no search term given | |
115 | * | |
116 | * @requires PUT_CARD mode must be enabled before | |
117 | * | |
118 | * @note The contacts are listed each on their own line, preceded by their | |
119 | * hashes and a space character (" ") | |
120 | * <p> | |
121 | * Example: <tt> | |
122 | * <p> | |
123 | * 5d1db4f26410eae670852b53e6ea80be 6pXXHy8T3b | |
124 | * <p> | |
125 | * 477eef8e57a12dffeeb4063d5a138c9a FoYJUyDOwM | |
126 | */ | |
845fb1d7 | 127 | LIST_CONTACT, |
e4444b0b NR |
128 | /** |
129 | * GET a remote contact if found. | |
130 | * | |
131 | * @param parameter | |
132 | * the UID of the contact to return | |
133 | * | |
134 | * @return the contact as VCF data or an empty message if the UID was not | |
135 | * found | |
136 | * | |
137 | * @requires PUT_CARD mode must be enabled before | |
138 | * | |
139 | */ | |
845fb1d7 | 140 | GET_CONTACT, |
a046fa49 | 141 | /** |
e4444b0b NR |
142 | * Select the given contact by UID and enter into PUT_CONTACT mode (you can |
143 | * issue *_DATA commands when in PUT_CONTACT mode), or leave PUT_CONTACT | |
144 | * mode if already enabled. | |
145 | * | |
146 | * @param parameter | |
147 | * the UID of the contact to select to enter PUT_CONTACT mode, or | |
148 | * nothing to leave it | |
149 | * | |
150 | * @requires PUT_CARD mode must be enabled before | |
a046fa49 | 151 | */ |
845fb1d7 | 152 | PUT_CONTACT, |
e4444b0b NR |
153 | /** |
154 | * POST a new contact to the remote server in the selected card. | |
155 | * | |
156 | * @input will wait for the contact VCF data | |
157 | * | |
158 | * @requires PUT_CARD mode must be enabled before | |
159 | */ | |
845fb1d7 | 160 | POST_CONTACT, |
e4444b0b NR |
161 | /** |
162 | * DELETE an existing contact from the remote server. | |
163 | * | |
164 | * @param parameter | |
165 | * the UID of the contact to delete | |
166 | * | |
167 | * @requires PUT_CARD mode must be enabled before | |
168 | */ | |
845fb1d7 | 169 | DELETE_CONTACT, |
e4444b0b NR |
170 | /** |
171 | * HASH the data(s) with the given name. | |
172 | * | |
173 | * @param parameter | |
174 | * the name of the data(s) you want | |
175 | * | |
176 | * @return the hashes of all the datas that correspond to the given name | |
177 | * | |
178 | * @requires PUT_CONTACT mode must be enabled before | |
179 | */ | |
845fb1d7 | 180 | HASH_DATA, |
e4444b0b NR |
181 | /** |
182 | * LIST the datas available in the selected contact. | |
183 | * | |
184 | * @param parameter | |
185 | * (optional) a search term that, if given, must be present in | |
186 | * the name of the data for it to be returned (case insensitive) | |
187 | * | |
188 | * @return a LIST of all the datas in the selected contact that contain the | |
189 | * search term, or all datas if no search term given | |
190 | * | |
191 | * @requires PUT_CONTACT mode must be enabled before | |
192 | * | |
193 | * @note The datas' names are listed each on their own line, preceded by | |
194 | * their hashes and a space character (" ") | |
195 | * <p> | |
196 | * Example: <tt> | |
197 | * <p> | |
198 | * 5d1db4f26410eae670852b53e6ea80be FN | |
199 | * <p> | |
200 | * 477eef8e57a12dffeeb4063d5a138c9a TEL | |
201 | */ | |
845fb1d7 | 202 | LIST_DATA, |
e4444b0b NR |
203 | /** |
204 | * GET one or more remote data(s) by name. | |
205 | * | |
206 | * @param parameter | |
207 | * the name of the data(s) to return | |
208 | * | |
209 | * @return the datas as VCF data or an empty message if no data were found | |
210 | * with that name | |
211 | * | |
212 | * @requires PUT_CONTACT mode must be enabled before | |
213 | * | |
214 | */ | |
845fb1d7 | 215 | GET_DATA, |
e4444b0b NR |
216 | /** |
217 | * POST a new data to the remote server in the selected contact. | |
218 | * | |
219 | * @input will wait for the data VCF data | |
220 | * | |
221 | * @requires PUT_CONTACT mode must be enabled before | |
222 | */ | |
845fb1d7 | 223 | POST_DATA, |
e4444b0b NR |
224 | /** |
225 | * DELETE an existing data from the remote server. | |
226 | * | |
227 | * @param parameter | |
228 | * the hash of the data to delete | |
229 | * | |
230 | * @requires PUT_CONTACT mode must be enabled before | |
231 | */ | |
845fb1d7 NR |
232 | DELETE_DATA, |
233 | } |