OobsSession

OobsSession — Manager of the connection to the backends.

Synopsis




enum                OobsResult;
                    OobsPlatform;
                    OobsSession;
OobsSession*        oobs_session_get                    (void);
OobsResult          oobs_session_commit                 (OobsSession *session);
OobsResult          oobs_session_get_supported_platforms
                                                        (OobsSession *session,
                                                         GList **platforms);
OobsResult          oobs_session_get_platform           (OobsSession *session,
                                                         gchar **platform);
OobsResult          oobs_session_set_platform           (OobsSession *session,
                                                         const gchar *platform);
gboolean            oobs_session_get_connected          (OobsSession *session);
void                oobs_session_process_requests       (OobsSession *session);

Object Hierarchy


  GObject
   +----OobsSession

Properties


  "platform"                 gchararray            : Read / Write

Description

OobsSession is a singleton object, defines and abstracts the connection to system-tools-backends.

Details

enum OobsResult

typedef enum {
  OOBS_RESULT_OK,
  OOBS_RESULT_ACCESS_DENIED,
  OOBS_RESULT_NO_PLATFORM,
  OOBS_RESULT_MALFORMED_DATA,
  OOBS_RESULT_ERROR
} OobsResult;

Defines the result of an operation.

OOBS_RESULT_OK Success.
OOBS_RESULT_ACCESS_DENIED Access to the backends denied, either by policies of for being unable to get enough privileges
OOBS_RESULT_NO_PLATFORM No detected platform, see oobs_session_set_platform().
OOBS_RESULT_MALFORMED_DATA Tried to send some kind of malformed data to the backends
OOBS_RESULT_ERROR Unmanaged error.

OobsPlatform

typedef struct {
  const gchar *id;
  const gchar *name;
  const gchar *version;
  const gchar *codename;
} OobsPlatform;

Represents a platform where system-tools-backends may run.

const gchar *id; Unique string representing the platform, see oobs_session_set_platform().
const gchar *name; Name of the platform.
const gchar *version; Platform version (or NULL).
const gchar *codename; Codename for the platform and version (or NULL).

OobsSession

typedef struct _OobsSession OobsSession;


oobs_session_get ()

OobsSession*        oobs_session_get                    (void);

Returns the OobsSession singleton, which represents the session with the system tools backends.

Returns : the singleton OobSession object.

oobs_session_commit ()

OobsResult          oobs_session_commit                 (OobsSession *session);

Commits inmediately all the changes to the configuration objects that have been requested through this OobsSession. Note that it will stop if it finds any error.

session : an OobsSession
Returns : An OobsResult representing the error.

oobs_session_get_supported_platforms ()

OobsResult          oobs_session_get_supported_platforms
                                                        (OobsSession *session,
                                                         GList **platforms);

Retrieves the list of supported platforms, this is only necessary when + oobs_session_get_platform() has returned OOBS_RESULT_NO_PLATFORM. To specify a platform, you must use oobs_session_set_platform(), being the platform string in that function the platform->id value inside the OobsPlatform struct.

session : An OobsSession.
platforms : return location for the list of platforms. It's a GList of OobsPlatform structs. You must free this list with g_list_free().
Returns : An OobsResult representing the error.

oobs_session_get_platform ()

OobsResult          oobs_session_get_platform           (OobsSession *session,
                                                         gchar **platform);

Retrieves the platform your system has been identified with, or NULL in case your platform is not recognized or other error happens.

session : An OobsSession.
platform : location to store the current platform, or NULL. This string is of internal use, and must not be freed or modified.
Returns : An OobsResult representing the error.

oobs_session_set_platform ()

OobsResult          oobs_session_set_platform           (OobsSession *session,
                                                         const gchar *platform);

Identifies your platform as the one set in platform. This is only necessary if your platform could not be guessed (and thus oobs_session_get_platform() would return OOBS_RESULT_NO_PLATFORM in this case).

session : An OobsSession.
platform : A string defining the platform. see oobs_session_get_platforms_list() to know where to get this string.
Returns : An OobsResult representing the error.

oobs_session_get_connected ()

gboolean            oobs_session_get_connected          (OobsSession *session);

Returns whether the connection with the backends is established.

session : An OobsSession
Returns : TRUE if there's connection with the backends.

oobs_session_process_requests ()

void                oobs_session_process_requests       (OobsSession *session);

Blocks until all pending asynchronous requests have been processed.

session : An OobsSession

Property Details

The "platform" property

  "platform"                 gchararray            : Read / Write

Name of the platform the session is running on.

Default value: NULL

See Also

OobsObject