User Tools

Site Tools


pentominos:pidiod

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
pentominos:pidiod [2009/05/14 12:12] jscpentominos:pidiod [2010/04/27 12:03] (current) jsc
Line 35: Line 35:
 ==== Database maintenance ==== ==== Database maintenance ====
  
-Data maintenance are done every time a table is written too or read from.  +Data maintenance is done every time a table is written too or read from. 
  
 ==== Protocol ==== ==== Protocol ====
  
-Format is as follow: ("<FUNCTION>", "<PARAMETERS...>" => "<SUCCESS>"|"<ERROR"):+Format is as follow: ("<FUNCTION>", "<PARAMETERS...>" => "<SUCCESS>, <ERROR" | "<fields>"):
  
 Example: Example:
 <code> <code>
 Send: Send:
- ("PUT", "id1 id2 location ttl" "OK") => "OK"|"FAILED" : "PUT\r\n"  + ("PUT", "id1 id2 location ttl" "OK") => "OK"|"FAILED" : "PUT\n"  
-                                                    "id1: <an id>\r\n" +                                                    "id1: <id>\n" 
-                                                    "id2: <another id>\r\n" +                                                    "id2: <another id>\n" 
-                                                    "location: <location>\r\n" +                                                    "location: <location>\n" 
-                                                    "ttl: <ttl>\r\n" +                                                    "ttl: <ttl>\n" 
-                                                    "\r\n"+                                                    "\n"
 Answer (on success): Answer (on success):
-                                                    "OK\r\n"+                                                    "status: OK\n" 
 +                                                    "msg: <STATUS MSG>\n" 
 +                                                    "\n"
 </code> </code>
  
-Ie. every line terminated by "\r\n" and each parameter takes an argument and has its own line. The request is terminated by "\r\n". NOTE! Similar to input parameters an answer can to be a list.+Ie. every line terminated by "\n" and each parameter takes an argument and has its own line. The request is terminated by "\n". NOTE! Similar to input parameters an answer can to be a list.
  
 === ("PUT", "id1 id2 location ttl") => "OK, FAILED, WRONG_ID_TYPE, UNKNOWN_ID" === === ("PUT", "id1 id2 location ttl") => "OK, FAILED, WRONG_ID_TYPE, UNKNOWN_ID" ===
-Put IDs (Genuine or Pseudo) on location with ttl. The server detects type of IDs.+Put IDs (Genuine or Pseudo) on location with ttl.
  
-=== ("GET", "location") => "OK, FAILED"|"pa_id op_id" ===+=== ("GET", "location") => "OK, FAILED, UNKNOW_ID"|"pa_idop_id" ===
 Get list of IDs (Genuine IDs) mapped to location. Get list of IDs (Genuine IDs) mapped to location.
  
Line 72: Line 73:
 Unmap Pseudo ID from a genuine ID. Unmap Pseudo ID from a genuine ID.
  
-=== ("LOOKUP", "id") => "OK, FAILED, WRONG_ID_TYPE" === +=== ("LOOKUP", "id") => "OK, FAILED, WRONG_ID_TYPE"|"type={ps_id, ge_id}, id" === 
-Lookup of ID mapped to id.+Lookup of ID mapped to id and its type (of the mapped to id). 
 + 
 + 
 +===== TODO ===== 
 + 
 +==== Next Version ==== 
 +  * {{:check.png}} Use microhttpd. 
 +  * {{:check.png}} Rewrite database comm. 
 +  * {{:uncheck.png}} Refactorize reply.cc 
 +  * {{:uncheck.png}} Testing...
  
-=== ("TYPE", "id"=> "OK, FAILED, WRONG_ID_TYPE"|"type" === +==== Current Version ====
-Get type of ID.+
pentominos/pidiod.1242295926.txt.gz · Last modified: 2009/05/14 12:12 by jsc