-
public abstract class BranchRemoteInterfaceAbstract class for Branch remote interface. This class provides the abstraction layer for network operations between Branch SDK and remote Branch servers. Extend this class for creating custom network interface. Class provide abstract method for implementing RESTful requests to Branch server see doRestfulGetdoRestfulPostio.branch.referral.network.BranchRemoteInterface.BranchResponseBranchRemoteException
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classBranchRemoteInterface.BranchResponseClass for providing result of RESTful operation against Branch Remote server
public classBranchRemoteInterface.BranchRemoteExceptionException thrown when there is an error while doing a restful operation with Branch Remote serversee doRestfulGet and doRestfulPost
-
Field Summary
Fields Modifier and Type Field Description public final static StringRETRY_NUMBER
-
Method Summary
Modifier and Type Method Description abstract BranchRemoteInterface.BranchResponsedoRestfulGet(String url)Abstract method to implement the network layer to do a RESTful GET to Branch servers.This method is called whenever Branch SDK want to make a GET request to Branch servers.Please note that this methods always called on the background thread and no need for thread switching for the network operations. abstract BranchRemoteInterface.BranchResponsedoRestfulPost(String url, JSONObject payload)Abstract method to implement the network layer to do a RESTful GET to Branch servers.This method is called whenever Branch SDK want to make a GET request to Branch servers.Please note that this methods always called on the background thread and no need for thread switching to execute network operations. final ServerResponsemake_restful_get(String url, JSONObject params, String tag, String branchKey)Method for handling the RESTful POST operations to Branch Servers. final ServerResponsemake_restful_post(JSONObject body, String url, String tag, String branchKey)Method for handling the RESTful POST operations to Branch Servers. -
-
Method Detail
-
doRestfulGet
abstract BranchRemoteInterface.BranchResponse doRestfulGet(String url)
Abstract method to implement the network layer to do a RESTful GET to Branch servers.This method is called whenever Branch SDK want to make a GET request to Branch servers.Please note that this methods always called on the background thread and no need for thread switching for the network operations.
- Parameters:
url- The url end point
-
doRestfulPost
abstract BranchRemoteInterface.BranchResponse doRestfulPost(String url, JSONObject payload)
Abstract method to implement the network layer to do a RESTful GET to Branch servers.This method is called whenever Branch SDK want to make a GET request to Branch servers.Please note that this methods always called on the background thread and no need for thread switching to execute network operations.
- Parameters:
url- The url end pointpayload- The JSon object payload for the post request
-
make_restful_get
final ServerResponse make_restful_get(String url, JSONObject params, String tag, String branchKey)
Method for handling the RESTful POST operations to Branch Servers. Internally calls abstract method doRestfulGet
- Parameters:
url- The url end pointparams- with parameters to the GET calltag- String Tag for identifying the request for analytical or debugging purposebranchKey- String Branch key
-
make_restful_post
final ServerResponse make_restful_post(JSONObject body, String url, String tag, String branchKey)
Method for handling the RESTful POST operations to Branch Servers. Internally calls abstract method doRestfulPost
- Parameters:
body- with parameters to the POST callurl- The url end pointtag- String Tag for identifying the request for analytical or debugging purposebranchKey- String Branch key
-
-
-
-