public abstract class AbstractConnection extends Object implements Connection
Provide the basic tools to submit events to the server (authentication header, dsn).
To avoid spamming the network if and when Sentry is down, automatically lock the connection each time a
ConnectionException
is caught.
Modifier and Type | Field and Description |
---|---|
static String |
SENTRY_PROTOCOL_VERSION
Current Sentry protocol version.
|
Modifier | Constructor and Description |
---|---|
protected |
AbstractConnection(String publicKey,
String secretKey)
Creates a connection based on the public and secret keys.
|
Modifier and Type | Method and Description |
---|---|
void |
addEventSendCallback(EventSendCallback eventSendCallback)
Add a callback that is called when an exception occurs while attempting to
send events to the Sentry server.
|
protected abstract void |
doSend(Event event)
Sends an event to the Sentry server.
|
protected String |
getAuthHeader()
Creates an authentication header for the Sentry protocol.
|
void |
send(Event event)
Sends an event to the Sentry server.
|
public static final String SENTRY_PROTOCOL_VERSION
protected String getAuthHeader()
public final void send(Event event) throws ConnectionException
Connection
send
in interface Connection
event
- captured event to add in Sentry.ConnectionException
- Thrown when an Event send fails.protected abstract void doSend(Event event) throws ConnectionException
event
- captured event to add in Sentry.ConnectionException
- whenever a temporary exception due to the connection happened.public void addEventSendCallback(EventSendCallback eventSendCallback)
addEventSendCallback
in interface Connection
eventSendCallback
- callback instanceCopyright © 2012–2017. All rights reserved.