Tracker.EndpointHttp¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
Virtual Methods¶
- Inherited:
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/co |
HTTP certificate |
||
r/w/co |
HTTP Port |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Allows control over the connections stablished. |
Fields¶
- Inherited:
Class Details¶
- class Tracker.EndpointHttp(**kwargs)¶
- Bases:
- 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:
sparql_connection (
Tracker.SparqlConnection
) – The [class`SparqlConnection`] being made publicport (
int
) – HTTP port to handle incoming requestscertificate (
Gio.TlsCertificate
orNone
) – Optional [type`Gio`.TlsCertificate] to use for encriptioncancellable (
Gio.Cancellable
orNone
) – Optional [type`Gio`.Cancellable]
- Raises:
- Returns:
a
TrackerEndpointHttp
object.- Return type:
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:
endpoint_http (
Tracker.EndpointHttp
) – The object which received the signaladdress (
Gio.SocketAddress
) – The socket address of the remote connection
- Return type:
Allows control over the connections stablished. The given address is that of the requesting peer.
Returning
False
in this handler allows the connection, returningTrue
blocks it. The default with no signal handlers connected isFalse
.
Property Details¶
- Tracker.EndpointHttp.props.http_certificate¶
- Name:
http-certificate
- Type:
- Default Value:
- Flags:
[class`Gio`.TlsCertificate] to encrypt the communication.
- Tracker.EndpointHttp.props.http_port¶
- Name:
http-port
- Type:
- Default Value:
8080
- Flags:
HTTP port used to listen requests.