Class POBNetworkHandler
-
- All Implemented Interfaces:
public class POBNetworkHandlerClass to make a network call using Volley API. Note: Caching is disabled by default for all the network requests.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfacePOBNetworkHandler.POBNetworkListenerCallback interface for delivering parsed responses.
public interfacePOBNetworkHandler.POBNetworkResultListenerInterface definition to get Network Result notification
public interfacePOBNetworkHandler.POBImageNetworkListenerpublic interfacePOBNetworkHandler.POBNetworkRedirectListenerCallback interface for delivering redirection event of network API.
-
Constructor Summary
Constructors Constructor Description POBNetworkHandler()Constructor Creates the Network handler instance. POBNetworkHandler(POBRequestQueue requestQueue)Constructor Creates the Network handler instance with provided request queue
-
Method Summary
-
-
Constructor Detail
-
POBNetworkHandler
POBNetworkHandler()
Constructor Creates the Network handler instance.
-
POBNetworkHandler
POBNetworkHandler(POBRequestQueue requestQueue)
Constructor Creates the Network handler instance with provided request queue- Parameters:
requestQueue- request queue
-
-
Method Detail
-
sendRequest
void sendRequest(@NonNull() String url, @Nullable() String tag, POBNetworkHandler.POBNetworkListener<String> listener, @Nullable() POBNetworkHandler.POBNetworkRedirectListener redirectListener)
Send the network request using the string URL.
- Parameters:
url- String url for making network caltag- Request tag, it will be used in case of cancelling requestlistener- Notifies the success and failure eventsredirectListener- Notifies the redirect event i.
-
sendRequest
void sendRequest(String url, String tag, POBNetworkHandler.POBNetworkListener<String> listener)
Send the network request using the string URL.
- Parameters:
url- String url for making network calltag- request tag, it will be used in case of cancelling requestlistener- Notifies the success and failure events
-
sendRequest
void sendRequest(POBHttpRequest request, POBNetworkHandler.POBNetworkListener<String> listener)
Send the network request using PubMatic's HTTP request object.
- Parameters:
request- PubMatic's HTTP request object for making network calllistener- Notifies the success and failure events
-
sendJSONRequest
void sendJSONRequest(POBHttpRequest request, @Nullable() POBNetworkHandler.POBNetworkListener<JSONObject> listener)
Send the network request using PubMatic's HTTP request object. Call this method only when JSON response is expected.
- Parameters:
request- PubMatic's HTTP request object for making network calllistener- Notifies the success and failure events
-
sendJSONRequest
void sendJSONRequest(@NonNull() POBHttpRequest request, @Nullable() POBNetworkHandler.POBNetworkListener<JSONObject> listener, @Nullable() POBNetworkHandler.POBNetworkResultListener resultListener)
Send the network request using PubMatic's HTTP request object. Call this method only when JSON response is expected.
- Parameters:
request- PubMatic's HTTP request object for making network calllistener- Notifies the success and failure eventsresultListener- Notifies the network result before success or failure
-
sendRequest
void sendRequest(@Nullable() POBHttpRequest request, @Nullable() POBNetworkHandler.POBNetworkListener<String> listener, @Nullable() POBNetworkHandler.POBNetworkRedirectListener redirectListener)
Send the network request using PubMatic's HTTP request object.
- Parameters:
request- PubMatic's HTTP request object for making network calllistener- Notifies the success and failure eventsredirectListener- Notifies the redirect event i.
-
sendRequest
void sendRequest(@Nullable() POBHttpRequest request, @Nullable() POBNetworkHandler.POBNetworkListener<String> listener, @Nullable() POBNetworkHandler.POBNetworkRedirectListener redirectListener, @Nullable() POBNetworkHandler.POBNetworkResultListener networkResultListener)
Send the network request using PubMatic's HTTP request object.
- Parameters:
request- PubMatic's HTTP request object for making network calllistener- Notifies the success and failure eventsredirectListener- Notifies the redirect event i.
-
sendImageRequest
void sendImageRequest(@Nullable() POBImageRequest request, @Nullable() POBNetworkHandler.POBImageNetworkListener<String> listener)
-
cancelRequest
void cancelRequest(@NonNull() String tag)
Cancels all the request which are associated with given tag
- Parameters:
tag- String tag to cancel all associated requests
-
-
-
-