Presence Service D-Bus API: Difference between revisions

From OLPC
Jump to navigation Jump to search
(Start PS DBus API page)
 
(Fill out bits of the PS API)
Line 1: Line 1:
=PresenceService DBus API=
=PresenceService DBus API=
There are 4 conceptual "objects":
There are 4 conceptual "objects":
* PresenceService - manages and provides a query API for Buddy, Service, and Activity objects
* PresenceService
* Buddy - represents another laptop somewhere on the network that you can communicate with
* Buddy
* Service - represents some specific resource on the network, published by a buddy
* Service
* Activity - represents a logical collection of services, in which one or more buddies participate
* Activity

==PresenceService Object==
Signals (unfiltered, all events propogated):
* buddyAppeared (buddy object path)
* buddyDisappeared (buddy object path)
* serviceAppeared (service object path)
* serviceDisappeared (service object path)
* activityAppeared (activity object path)
* activityDisappeared (activity object path)

Methods:
* getAllServices()
** Gets all services the PS knows about
** Returns: array of service object paths
* getAllServicesOfType(type)
** Gets all services the PS knows about, filtered by a specific service type
** Returns: array of service object paths
* getAllActivities()
** Gets all activities the PS knows about
** Returns: array of activity object paths
* getActivity(id)
** Gets a specific activity
** Returns: activity object path
* getAllBuddies()
** Gets all buddies the PS knows about
** Returns: array of buddy object paths
* getBuddyByName(name)
** Gets a specific buddy, searching on the buddy's name
** Returns: the buddy object path of the requested buddy, or an error if the buddy does not exist
* getBuddyByAddress(address)
** Gets a specific buddy, searching on the buddy's IP address
** Returns: the buddy object path of the requested buddy, or an error if the buddy does not exist
* getOwner()
** Gets the owner buddy, representing the owner of this laptop
** Returns: the buddy object path of the owner (always present)

Revision as of 03:49, 14 July 2006

PresenceService DBus API

There are 4 conceptual "objects":

  • PresenceService - manages and provides a query API for Buddy, Service, and Activity objects
  • Buddy - represents another laptop somewhere on the network that you can communicate with
  • Service - represents some specific resource on the network, published by a buddy
  • Activity - represents a logical collection of services, in which one or more buddies participate

PresenceService Object

Signals (unfiltered, all events propogated):

  • buddyAppeared (buddy object path)
  • buddyDisappeared (buddy object path)
  • serviceAppeared (service object path)
  • serviceDisappeared (service object path)
  • activityAppeared (activity object path)
  • activityDisappeared (activity object path)

Methods:

  • getAllServices()
    • Gets all services the PS knows about
    • Returns: array of service object paths
  • getAllServicesOfType(type)
    • Gets all services the PS knows about, filtered by a specific service type
    • Returns: array of service object paths
  • getAllActivities()
    • Gets all activities the PS knows about
    • Returns: array of activity object paths
  • getActivity(id)
    • Gets a specific activity
    • Returns: activity object path
  • getAllBuddies()
    • Gets all buddies the PS knows about
    • Returns: array of buddy object paths
  • getBuddyByName(name)
    • Gets a specific buddy, searching on the buddy's name
    • Returns: the buddy object path of the requested buddy, or an error if the buddy does not exist
  • getBuddyByAddress(address)
    • Gets a specific buddy, searching on the buddy's IP address
    • Returns: the buddy object path of the requested buddy, or an error if the buddy does not exist
  • getOwner()
    • Gets the owner buddy, representing the owner of this laptop
    • Returns: the buddy object path of the owner (always present)