Ok, tried to incorporate the comments you guys gave. I chatted with Patrick and we came to the conclusion that we should be able to get rid of the synthesis signal altogether by having to signals (Status and Progress) ... I'm going to look through the sync-ui code for any gotchas but I think this is true, and have updated the API proposal.

I'm still not too fond of the current GetReports idea (using hash keys like "source-addressbook-sent") but I've tried and can't come up with a proposal that would have the same features and a sane API. It'll do.


Changes:
 * Sync() now has the forgotten "mode" variable for sources
 * renamed SessionReady to SessionCreated, because that's what it is.
   Moved session.Close() to server.CloseSession() so it can be called
   before the session is actually created.
 * progress signal reworked: signal "Status" is for sync and source
   status changes and "Progress" includes the whole known progress state
   for the sync. There are matching Get-functions for both.
 * config functions now have a BOOLEAN variable "template"
   for accessing templates. Note that the functions in the session
   interface refer to the server specified in StartSession, so creating
   a config from template looks like this:
      server.GetConfigs(true)
      // pick a template here ...
      config = Server.GetConfig("chosen_template", true)
      // modify configuration here ...
      session = server.StartSession ("my_config")
      // wait for SessionCreated here...
      session.SetConfig(false, config)
      session.Close()
   Sound sensible? One could also start the session earlier if that
   makes more sense in the client.

 - Jussi

---

org.syncevolution.Server

  GetConfigs
    in BOOLEAN template
    out ARRAY of STRING server


  GetConfig
    in STRING server
    in BOOLEAN template
    out DICT (STRING source, DICT (STRING key, STRING value))

      [NOTE: outer dictionary contains a dictionary for every source and
       one dictionary for server config]


  GetReports
    in STRING server
    in UINT32 start
    in UINT32 count
    out ARRAY of DICT (STRING key, STRING value)

      [NOTE: returns a maximum of 'count' reports (dictionaries),
       starting from index 'start' (going from latest to oldest)]


  StartSession
    in STRING server
    out OBJECT_PATH session
  CloseSession
    in OBJECT_PATH session
  GetSessions
    out ARRAY of STRUCT (OBJECT_PATH path, BOOLEAN created)
  signal SessionCreated
    out OBJECT_PATH path
  signal SessionEnd
    out OBJECT_PATH path

    [NOTE: StartSession returns immediately, but the session object only
     exists when SessionCreated is signalled.]


org.syncevolution.Session

  Sync
    STRING mode
    in ARRAY of STRUCT (STRING sources, STRING mode)

    [NOTE: valid values for mode are same as in syncevolution config.
     If array is non-empty, only the sources included will be synced.
     If mode is empty the value from configuration will be used]

  Abort
  Suspend

  signal Status
    out STRING status
    out INT32 error
    out ARRAY of STRUCT (STRING source, STRING status, INT32 error)
  GetStatus
    out STRING status
    out INT32 error
    out ARRAY of STRUCT (STRING source, STRING status, INT32 error)

    [NOTE: valid values for status:
     "idle","running", "aborting", "suspending", "failed", "done"]

  signal Progress
    out INT32 progress
    out ARRAY of STRUCT (STRING source, STRING mode,
                         INT32 prepare_current, INT32 prepare_total,
                         INT32 receive_current, INT32 receive_total,
                         INT32 send_current, INT32 send_total)
  GetProgress
    out INT32 progress
    out ARRAY of STRUCT (STRING source, STRING mode,
                         INT32 prepare_current, INT32 prepare_total,
                         INT32 receive_current, INT32 receive_total,
                         INT32 send_current, INT32 send_total)



  GetConfig
    in BOOLEAN template
    out DICT (STRING source, DICT (STRING key, STRING value))
  SetConfig
    in BOOLEAN template
    in DICT (STRING source, DICT (STRING key, STRING value))
  UpdateConfig
    in BOOLEAN template
    in DICT (STRING source, DICT (STRING key, STRING value))

      [NOTE: outer dictionary contains a dictionary for every source and
       one dictionary for server config]


  GetReports
    in UINT32 start
    in UINT32 count
    out ARRAY of DICT (STRING key, STRING value)

      [NOTE: returns a maximum of 'count' reports (dictionaries),
       starting from index 'start' (going from latest to oldest)]
_______________________________________________
SyncEvolution mailing list
[email protected]
http://lists.syncevolution.org/listinfo/syncevolution

Reply via email to