Tracker.EndpointHttp

g GObject.GInterface GObject.GInterface Gio.Initable Gio.Initable GObject.GInterface->Gio.Initable GObject.Object GObject.Object Tracker.Endpoint Tracker.Endpoint GObject.Object->Tracker.Endpoint Tracker.EndpointHttp Tracker.EndpointHttp Gio.Initable->Tracker.EndpointHttp Tracker.Endpoint->Tracker.EndpointHttp

Subclasses:

None

Methods

Inherited:

Tracker.Endpoint (7), GObject.Object (37), Gio.Initable (2)

Structs:

GObject.ObjectClass (5)

class

new (sparql_connection, port, certificate, cancellable)

Virtual Methods

Inherited:

GObject.Object (7), Gio.Initable (1)

Properties

Inherited:

Tracker.Endpoint (4)

Name

Type

Flags

Short Description

http-certificate

Gio.TlsCertificate

r/w/co

HTTP certificate

http-port

int

r/w/co

HTTP Port

Signals

Inherited:

GObject.Object (1)

Name

Short Description

block-remote-address

Allows control over the connections stablished.

Fields

Inherited:

GObject.Object (1)

Class Details

class Tracker.EndpointHttp(**kwargs)
Bases:

Tracker.Endpoint, Gio.Initable

Abstract:

No

TrackerEndpointHttp makes the RDF data in a [class`SparqlConnection`] accessible to other hosts via HTTP.

This object is a [class`Endpoint`] subclass that exports a [class`SparqlConnection`] so its RDF data is accessible via HTTP requests on the given port. This endpoint implementation is compliant with the SPARQL protocol specifications and may interoperate with other implementations.

```c // This host has “example.local” hostname endpoint = Tracker.EndpointHttp.new (sparql_connection, 8080, tls_certificate, None, &error);

// From another host connection = Tracker.SparqlConnection.remote_new (“http://example.local:8080/sparql”); ```

Access to HTTP endpoints may be managed via the [signal`EndpointHttp`:py:func:::block-remote-address<Tracker.EndpointHttp.signals.block_remote_address>] signal, the boolean return value expressing whether the connection is blocked or not. Inspection of the requester address is left up to the user. The default value allows all requests independently of their provenance, users are encouraged to add a handler.

If the provided [class`Gio`.TlsCertificate] is None, the endpoint will allow plain HTTP connections. Users are encouraged to provide a certificate in order to use HTTPS.

As a security measure, and in compliance specifications, the HTTP endpoint does not handle database updates or modifications in any way. The database content is considered to be entirely managed by the process that creates the HTTP endpoint and owns the [class`SparqlConnection`].

A TrackerEndpointHttp may be created on a different thread/main context from the one that created [class`SparqlConnection`].

New in version 3.1.

classmethod new(sparql_connection, port, certificate, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

a TrackerEndpointHttp object.

Return type:

Tracker.EndpointHttp

Sets up a Tracker endpoint to listen via HTTP, in the given port. If certificate is not None, HTTPS may be used to connect to the endpoint.

New in version 3.1.

Signal Details

Tracker.EndpointHttp.signals.block_remote_address(endpoint_http, address)
Signal Name:

block-remote-address

Flags:

Parameters:
Return type:

bool

Allows control over the connections stablished. The given address is that of the requesting peer.

Returning False in this handler allows the connection, returning True blocks it. The default with no signal handlers connected is False.

Property Details

Tracker.EndpointHttp.props.http_certificate
Name:

http-certificate

Type:

Gio.TlsCertificate

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

[class`Gio`.TlsCertificate] to encrypt the communication.

Tracker.EndpointHttp.props.http_port
Name:

http-port

Type:

int

Default Value:

8080

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

HTTP port used to listen requests.