Class ConnectDetailsPresenter<T extends ConnectDetailsView>
- java.lang.Object
-
- com.cheetahdigital.uikit.architecture.mvp.MvpNullObjectBasePresenter<V>
-
- com.cheetahdigital.uikit.architecture.mvp.Presenter<V>
-
- com.cheetahdigital.uikit.architecture.lce.LcePresenter<T>
-
- com.cheetahdigital.members.ui.connect.ConnectDetailsPresenter<T>
-
- All Implemented Interfaces:
MvpPresenter<T>
public class ConnectDetailsPresenter<T extends ConnectDetailsView> extends LcePresenter<T>
This extends theLcePresenterwithConnectDetailsViewas its view. Presenters are used to call the API using theConnection,Members, andProfileand also the presenter notifies its view if needed.
-
-
Constructor Summary
Constructors Constructor Description ConnectDetailsPresenter(java.lang.String memberId)Constructor for the PresenterConnectDetailsPresenter(java.lang.String memberId, MembersParams membersParams)Constructor for the PresenterConnectDetailsPresenter(java.lang.String memberId, MembersParams membersParams, ProfileParams profileParams, SummaryParams summaryParams)Create a presenter with the givenMembersParams
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidacceptConnection()API call to accept a connectionvoidacceptConnection(ConnectionsParams connectionsParams, ConnectionsFields connectionsFields)API call to accept a connectionprotected Listener<SuccessResponse>getAcceptConnectionListener()Create a listener forConnectionsAPIprotected Listener<SuccessResponse>getConnectionRequestListener()Create a listener forConnectionsAPIprotected ConnectionsAPIgetConnectionsAPI()Get current instance ofConnectionsAPIDetailsgetDetails()protected ListenerModel<BaseModel<Details>,Details>getMemberReceivedListener()Create a listener forMembersAPIprotected MembersAPIgetMembersAPI()Get current instance ofMembersAPIprotected ProfileAPIgetProfileAPI()Get current instance ofProfileAPIprotected Listener<Profile>getProfileReceivedListener()Create a listener forProfileAPIprotected SummaryAPIgetSummaryAPI()Get current instance ofSummaryAPIprotected ListenerModel<BaseModel<Summary>,Summary>getSummaryReceivedListener()Create a listener forSummaryAPIvoidloadData()Load initial view data.protected voidloadProfile()Call to the API for the Profile of the userprotected voidloadSummary()Call to the API that loads the summaryprotected voidonAcceptRequestFailed(java.lang.String error)Called after a failed accept connection requestprotected voidonAcceptRequestSuccess(SuccessResponse data)Called after a succesful accept connection requestprotected voidonConnectPermissionReceivedFailed(java.lang.String error)Called after a failed summary requestprotected voidonConnectPermissionReceivedSuccess(Summary data)Called after a successful summary requestprotected voidonMemberDownloadFailed(java.lang.String error)Called after a failed member requestprotected voidonMemberDownloadSuccess(Details details)Called after a succesful member requestprotected voidonProfileDownloadFailed(java.lang.String error)Called after a failed profile requestprotected voidonProfileDownloadSuccess(Profile profile)Called after a successful profile requestprotected voidonRequestConnectionFailed(java.lang.String error)Called after a failed connection requestprotected voidonRequestConnectionSuccess(SuccessResponse data)Called after a succesful connection requestvoidrequestConnection(java.lang.String message)API call for requesting a membervoidrequestConnection(java.lang.String message, ConnectionsParams connectionsParams, ConnectionsFields connectionsFields)API call for requesting a memberprotected voidsetConnectionDetails(java.lang.String connectionStatus, java.lang.String personalNote)Set the connection details based on current connection status receivedprotected voidsetInterests(Details details)Set the current interests for the current membervoidsetSaveMemberId(java.lang.String savedMemberId)Set the current saved member id.-
Methods inherited from class com.cheetahdigital.uikit.architecture.lce.LcePresenter
onLoadFailed, onLoadSuccess
-
Methods inherited from class com.cheetahdigital.uikit.architecture.mvp.MvpNullObjectBasePresenter
attachView, detachView, getView
-
-
-
-
Constructor Detail
-
ConnectDetailsPresenter
public ConnectDetailsPresenter(java.lang.String memberId)
Constructor for the Presenter- Parameters:
memberId- string id of the member will be used for the API call to the member details
-
ConnectDetailsPresenter
public ConnectDetailsPresenter(java.lang.String memberId, MembersParams membersParams)Constructor for the Presenter- Parameters:
memberId- id of the membermembersParams-MembersParamsused forMembersAPI
-
ConnectDetailsPresenter
public ConnectDetailsPresenter(java.lang.String memberId, MembersParams membersParams, ProfileParams profileParams, SummaryParams summaryParams)Create a presenter with the givenMembersParams- Parameters:
memberId- id of the membermembersParams- instance ofMembersParamsto useprofileParams- instance ofProfileParamsto usesummaryParams- instance ofSummaryParamsto use
-
-
Method Detail
-
getMemberReceivedListener
protected ListenerModel<BaseModel<Details>,Details> getMemberReceivedListener()
Create a listener forMembersAPI- Returns:
- listener to handle
MembersAPIrequests
-
getProfileReceivedListener
protected Listener<Profile> getProfileReceivedListener()
Create a listener forProfileAPI- Returns:
- listener to handle
ProfileAPIrequests
-
getConnectionRequestListener
protected Listener<SuccessResponse> getConnectionRequestListener()
Create a listener forConnectionsAPI- Returns:
- listener to handle
ConnectionsAPIrequests
-
getAcceptConnectionListener
protected Listener<SuccessResponse> getAcceptConnectionListener()
Create a listener forConnectionsAPI- Returns:
- listener to handle
ConnectionsAPIrequests
-
getSummaryReceivedListener
protected ListenerModel<BaseModel<Summary>,Summary> getSummaryReceivedListener()
Create a listener forSummaryAPI- Returns:
- listener to handle
SummaryAPIrequests
-
getMembersAPI
protected MembersAPI getMembersAPI()
Get current instance ofMembersAPI- Returns:
MembersAPIused on this presenter
-
getProfileAPI
protected ProfileAPI getProfileAPI()
Get current instance ofProfileAPI- Returns:
ProfileAPIused on this presenter
-
getConnectionsAPI
protected ConnectionsAPI getConnectionsAPI()
Get current instance ofConnectionsAPI- Returns:
ConnectionsAPIused on this presenter
-
getSummaryAPI
protected SummaryAPI getSummaryAPI()
Get current instance ofSummaryAPI- Returns:
SummaryAPIused on this presenter
-
loadData
public void loadData()
Description copied from class:LcePresenterLoad initial view data.- Specified by:
loadDatain classLcePresenter<T extends ConnectDetailsView>
-
setSaveMemberId
public void setSaveMemberId(java.lang.String savedMemberId)
Set the current saved member id. This used to compare what to set in connection details- Parameters:
savedMemberId- id of the member to save
-
requestConnection
public void requestConnection(java.lang.String message)
API call for requesting a member- Parameters:
message- the message to be sent to this member on connection request
-
requestConnection
public void requestConnection(java.lang.String message, ConnectionsParams connectionsParams, ConnectionsFields connectionsFields)API call for requesting a member- Parameters:
message- the message to be sent to this member on connection requestconnectionsParams-ConnectionsParamsto useconnectionsFields-ConnectionsFieldsto use
-
onRequestConnectionSuccess
protected void onRequestConnectionSuccess(SuccessResponse data)
Called after a succesful connection request- Parameters:
data- received response
-
onRequestConnectionFailed
protected void onRequestConnectionFailed(java.lang.String error)
Called after a failed connection request- Parameters:
error- message containing the error details
-
acceptConnection
public void acceptConnection()
API call to accept a connection
-
acceptConnection
public void acceptConnection(ConnectionsParams connectionsParams, ConnectionsFields connectionsFields)
API call to accept a connection- Parameters:
connectionsParams-ConnectionsParamsto useconnectionsFields-ConnectionsFieldsto use
-
onAcceptRequestSuccess
protected void onAcceptRequestSuccess(SuccessResponse data)
Called after a succesful accept connection request- Parameters:
data- received response
-
onAcceptRequestFailed
protected void onAcceptRequestFailed(java.lang.String error)
Called after a failed accept connection request- Parameters:
error- message containing the error details
-
loadSummary
protected void loadSummary()
Call to the API that loads the summary
-
loadProfile
protected void loadProfile()
Call to the API for the Profile of the user
-
onMemberDownloadSuccess
protected void onMemberDownloadSuccess(Details details)
Called after a succesful member request- Parameters:
details- received response
-
onMemberDownloadFailed
protected void onMemberDownloadFailed(java.lang.String error)
Called after a failed member request- Parameters:
error- message containing the error details
-
onConnectPermissionReceivedSuccess
protected void onConnectPermissionReceivedSuccess(Summary data)
Called after a successful summary request- Parameters:
data- received response
-
onConnectPermissionReceivedFailed
protected void onConnectPermissionReceivedFailed(java.lang.String error)
Called after a failed summary request- Parameters:
error- message containing the error details
-
onProfileDownloadSuccess
protected void onProfileDownloadSuccess(Profile profile)
Called after a successful profile request- Parameters:
profile- received response
-
onProfileDownloadFailed
protected void onProfileDownloadFailed(java.lang.String error)
Called after a failed profile request- Parameters:
error- message containing the error details
-
setConnectionDetails
protected void setConnectionDetails(java.lang.String connectionStatus, java.lang.String personalNote)Set the connection details based on current connection status received- Parameters:
connectionStatus- status that is compared withpersonalNote- personal note to display
-
-