public class HttpConnection extends AbstractConnection
It is possible to enable the "naive mode" to allow a connection over SSL using a certificate with a wildcard.
Modifier and Type | Field and Description |
---|---|
static int |
HTTP_TOO_MANY_REQUESTS
HTTP code `429 Too Many Requests`, which is not included in HttpURLConnection.
|
SENTRY_PROTOCOL_VERSION
Constructor and Description |
---|
HttpConnection(URL sentryUrl,
String publicKey,
String secretKey,
Proxy proxy,
EventSampler eventSampler)
Creates an HTTP connection to a Sentry server.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected void |
doSend(Event event)
Sends an event to the Sentry server.
|
protected HttpURLConnection |
getConnection()
Opens a connection to the Sentry API allowing to send new events.
|
static URL |
getSentryApiUrl(URI sentryUri,
String projectId)
Automatically determines the URL to the HTTP API of Sentry.
|
void |
setBypassSecurity(boolean bypassSecurity) |
void |
setMarshaller(Marshaller marshaller) |
void |
setTimeout(int timeout) |
addEventSendCallback, getAuthHeader, send
public static final int HTTP_TOO_MANY_REQUESTS
public HttpConnection(URL sentryUrl, String publicKey, String secretKey, Proxy proxy, EventSampler eventSampler)
sentryUrl
- URL to the Sentry API.publicKey
- public key of the current project.secretKey
- private key of the current project.proxy
- address of HTTP proxy or null if using direct connections.eventSampler
- EventSampler instance to use, or null to not sample events.public static URL getSentryApiUrl(URI sentryUri, String projectId)
sentryUri
- URI of the Sentry server.projectId
- unique identifier of the current project.protected HttpURLConnection getConnection()
protected void doSend(Event event) throws ConnectionException
AbstractConnection
doSend
in class AbstractConnection
event
- captured event to add in Sentry.ConnectionException
- whenever a temporary exception due to the connection happened.public void setTimeout(int timeout)
public void setMarshaller(Marshaller marshaller)
public void setBypassSecurity(boolean bypassSecurity)
public void close() throws IOException
IOException
Copyright © 2012–2018. All rights reserved.