Service
Object Hierarchy:
Description:
[
CCode ( type_id =
"camel_service_get_type ()" ) ]
public abstract class Service :
Object,
Initable
Base class for mail access and sending services.
Service is an abstract base class that is the common parent of
Store (mail storage and retrieval) and
Transport (mail sending). It defines the common operations associated with a
configured mail service.
Service instances are always created and managed by Session via
camel_session_get_service. The session uses the GType stored in the Provider
descriptor to instantiate the correct subclass.
Service manages the connection lifecycle: -
connect establishes a connection to the remote resource. - disconnect
tears it down. - Connection and authentication settings are conveyed via a URL (the URI passed
when the service was first requested).
Authentication is handled asynchronously through the session's authenticate
mechanism, which can prompt the user for credentials as needed.
The connection state is exposed as a ServiceConnectionStatus and signals
are emitted when it changes.
Content:
Properties:
Creation methods:
Methods:
- public async AuthenticationResult authenticate (string? mechanism, int io_priority, Cancellable? cancellable = null) throws Error
Asynchronously attempts to authenticate
this using mechanism and, if necessary, this's
password property.
- public virtual AuthenticationResult authenticate_sync (string? mechanism, Cancellable? cancellable = null) throws Error
Attempts to authenticate this using
mechanism and, if necessary, this's
password property.
- public async bool connect (int io_priority, Cancellable? cancellable = null) throws Error
Asynchronously connects this to a
remote server using the information in its settings instance.
- public virtual bool connect_sync (Cancellable? cancellable = null) throws Error
Connects this to a remote server
using the information in its settings instance.
- public async bool disconnect (bool clean, int io_priority, Cancellable? cancellable = null) throws Error
If a disconnect operation is already in progress when this function is
called, its results will be reflected in this disconnect operation.
- public virtual bool disconnect_sync (bool clean, Cancellable? cancellable = null) throws Error
Disconnect from the service.
- public string? dup_display_name ()
- public string dup_password ()
- public ServiceConnectionStatus get_connection_status ()
Returns the connection status for this
.
- public unowned string? get_display_name ()
Returns the display name for this,
or null if this has not been given a display name.
- public virtual string get_name (bool brief)
This gets the name of the service in a "friendly" (suitable for humans
) form.
- public unowned string get_password ()
Returns the password for this.
- public Provider get_provider ()
Gets the Provider
associated with the service.
- public unowned string get_uid ()
Gets the unique identifier string associated with the service.
- public unowned string get_user_cache_dir ()
Returns the base directory under which to store cache data for
this.
- public unowned string get_user_data_dir ()
Returns the base directory under which to store user-specific data for
this.
- public async List<unowned ServiceAuthType?> query_auth_types (int io_priority, Cancellable? cancellable = null) throws Error
Asynchronously obtains a list of authentication types supported by
this.
- public virtual List<unowned ServiceAuthType?> query_auth_types_sync (Cancellable? cancellable = null) throws Error
Obtains a list of authentication types supported by
this.
- public void queue_task (Task task, TaskThreadFunc task_func)
Adds task to a queue of waiting tasks with the same
source object.
- public ProxyResolver? ref_proxy_resolver ()
- public Session ref_session ()
Returns the Session
associated with the service.
- public Settings ref_settings ()
Returns the Settings
instance associated with the service.
- public void set_display_name (string? display_name)
Assigns a UTF-8 display name to this
.
- public void set_password (string password)
Sets the password for this.
- public void set_proxy_resolver (ProxyResolver? proxy_resolver)
- public void set_settings (Settings? settings)
Associates a new Settings
instance with the service.
Inherited Members:
All known members inherited from class GLib.Object
All known members inherited from interface GLib.Initable