| 1 | /** |
| 2 | * jVCard remote uses a simple plain text protocol to |
| 3 | * transfer/retrieve/delete information from/to the server. |
| 4 | * |
| 5 | * <p> |
| 6 | * |
| 7 | * The protocol is based around <b>lines</b> of text and <b>blocks</b> of |
| 8 | * <b>lines</b>. The client sends <b>commands</b> while the server only |
| 9 | * answers with text data. |
| 10 | * |
| 11 | * <p> |
| 12 | * |
| 13 | * Some definitions: |
| 14 | * <ul> |
| 15 | * <li>A <b>line</b> is the text between two new-line characters (\n). |
| 16 | * <li>A <b>block</b> is all the <b>lines</b> between two end-of-block |
| 17 | * <b>lines</b>. |
| 18 | * <li>An end-of-block <b>line</b> is a special <b>line</b> |
| 19 | * containing only a dot (.). |
| 20 | * <li>A <b>command</b> is <b>block</b> whose first <b>line</b> |
| 21 | * contains the command in upper case text and an optional text |
| 22 | * argument, optionally followed by a second <b>block</b> of "input" data |
| 23 | * </ul> |
| 24 | * |
| 25 | * <p> |
| 26 | * |
| 27 | * Upon connection, the first thing that happen is that the server sends |
| 28 | * a VERSION <b>command</b> (a <b>block</b> whose first <b>line</b> is |
| 29 | * <b><tt>VERSION 1</tt></b>, possibly followed by some help text |
| 30 | * <b>lines</b>). |
| 31 | * |
| 32 | * <p> |
| 33 | * |
| 34 | * The client <b>MUST</b> answer with another VERSION <b>command</b>. |
| 35 | * |
| 36 | * <p> |
| 37 | * |
| 38 | * From that time on, the client is allowed to send <b>commands</b> |
| 39 | * as described by {@link be.nikiroo.jvcard.remote.Command}. |
| 40 | * If the client doesn't follow the rules in |
| 41 | * {@link be.nikiroo.jvcard.remote.Command}, the server will close |
| 42 | * the connection. |
| 43 | * |
| 44 | * @author niki |
| 45 | */ |
| 46 | package be.nikiroo.jvcard.remote; |