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/06 14:40] 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") => "OKFAILEDWRONG_ID_TYPEUNKNOWN_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") => "pa_id op_id"|"FAILED" ===+=== ("GET", "location") => "OK, FAILED, UNKNOW_ID"|"pa_id, op_id" ===
 Get list of IDs (Genuine IDs) mapped to location. Get list of IDs (Genuine IDs) mapped to location.
  
-=== ("CLEAR", "location") => "OK"|"FAILED" ===+=== ("CLEAR", "location") => "OKFAILED" ===
 Clear all IDs (Genuine IDs) on location. Clear all IDs (Genuine IDs) on location.
  
-=== ("MAP", "id1 id2  ttl") => "OK"|"FAILED WRONG_ID_TYPE" ===+=== ("MAP", "id1 id2  ttl") => "OKFAILEDWRONG_ID_TYPE" ===
 Map Pseudo ID to Genuine ID with ttl. Note! One of the IDs must be a Pseudo ID. Map Pseudo ID to Genuine ID with ttl. Note! One of the IDs must be a Pseudo ID.
  
-=== ("UNMAP", "id" ) => "OK"|"FAILED WRONG_ID_TYPE" ===+=== ("UNMAP", "id" ) => "OKFAILEDWRONG_ID_TYPE" ===
 Unmap Pseudo ID from a genuine ID. Unmap Pseudo ID from a genuine ID.
  
-=== ("LOOKUP", "id") => "OK|FAILED WRONG_ID_TYPE" === +=== ("LOOKUP", "id") => "OKFAILEDWRONG_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"=> "GENUINE PSEUDO"|"FAILED WRONG_ID_TYPE" === +==== Current Version ====
-Get type of ID.+
pentominos/pidiod.1241613607.txt.gz · Last modified: 2009/05/06 14:40 by jsc