forked from square/okhttp
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Strawman interface for EventListener
Related to the discussion in square#270, this a class that could be used to add Zipkin or other traces to OkHttp requests
- Loading branch information
Michael Benedict
committed
Feb 1, 2017
1 parent
71729c3
commit 1464a47
Showing
1 changed file
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/* | ||
* Copyright (C) 2017 Square, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package okhttp3; | ||
|
||
import java.io.IOException; | ||
|
||
/** | ||
* Observes, modifies, and potentially short-circuits requests going out and the corresponding | ||
* responses coming back in. Typically interceptors add, remove, or transform headers on the request | ||
* or response. | ||
*/ | ||
public class EventListener { | ||
public static final EventListener NULL_EVENT_LISTENER = new EventListener() { | ||
}; | ||
|
||
void requestEnqueued(Call call) { | ||
} | ||
|
||
void dnsStart(Call call, String domainName) { | ||
} | ||
|
||
void dnsEnd(Call call, String domainName, List<InetAddress> inetAddressList, Throwable throwable) { | ||
} | ||
|
||
void connectStart(Call call, InetAddress address, int port) { | ||
} | ||
|
||
void secureConnectStart(Call call) { | ||
} | ||
|
||
void secureConnectEnd(Call call, String cipherSuite, String protocol, Throwable throwable) { | ||
} | ||
|
||
void connectEnd(Call call, InetAddress address, int port, String protocol, Throwable throwable) { | ||
} | ||
|
||
void requestHeadersStart(Call call) { | ||
} | ||
|
||
void requestHeadersEnd(Call call, Throwable throwable) { | ||
} | ||
|
||
void requestBodyStart(Call call) { | ||
} | ||
|
||
void requestBodyEnd(Call call, Throwable throwable) { | ||
} | ||
|
||
void responseHeadersStart(Call call) { | ||
} | ||
|
||
void responseHeadersEnd(Call call, Throwable throwable) { | ||
} | ||
|
||
void responseBodyStart(Call call) { | ||
} | ||
|
||
void responseBodyEnd(Call call, Throwable throwable) { | ||
} | ||
} |