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 theLcePresenter
withConnectDetailsView
as its view. Presenters are used to call the API using theConnection
,Members
, andProfile
and 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 void
acceptConnection()
API call to accept a connectionvoid
acceptConnection(ConnectionsParams connectionsParams, ConnectionsFields connectionsFields)
API call to accept a connectionprotected Listener<SuccessResponse>
getAcceptConnectionListener()
Create a listener forConnectionsAPI
protected Listener<SuccessResponse>
getConnectionRequestListener()
Create a listener forConnectionsAPI
protected ConnectionsAPI
getConnectionsAPI()
Get current instance ofConnectionsAPI
Details
getDetails()
protected ListenerModel<BaseModel<Details>,Details>
getMemberReceivedListener()
Create a listener forMembersAPI
protected MembersAPI
getMembersAPI()
Get current instance ofMembersAPI
protected ProfileAPI
getProfileAPI()
Get current instance ofProfileAPI
protected Listener<Profile>
getProfileReceivedListener()
Create a listener forProfileAPI
protected SummaryAPI
getSummaryAPI()
Get current instance ofSummaryAPI
protected ListenerModel<BaseModel<Summary>,Summary>
getSummaryReceivedListener()
Create a listener forSummaryAPI
void
loadData()
Load initial view data.protected void
loadProfile()
Call to the API for the Profile of the userprotected void
loadSummary()
Call to the API that loads the summaryprotected void
onAcceptRequestFailed(java.lang.String error)
Called after a failed accept connection requestprotected void
onAcceptRequestSuccess(SuccessResponse data)
Called after a succesful accept connection requestprotected void
onConnectPermissionReceivedFailed(java.lang.String error)
Called after a failed summary requestprotected void
onConnectPermissionReceivedSuccess(Summary data)
Called after a successful summary requestprotected void
onMemberDownloadFailed(java.lang.String error)
Called after a failed member requestprotected void
onMemberDownloadSuccess(Details details)
Called after a succesful member requestprotected void
onProfileDownloadFailed(java.lang.String error)
Called after a failed profile requestprotected void
onProfileDownloadSuccess(Profile profile)
Called after a successful profile requestprotected void
onRequestConnectionFailed(java.lang.String error)
Called after a failed connection requestprotected void
onRequestConnectionSuccess(SuccessResponse data)
Called after a succesful connection requestvoid
requestConnection(java.lang.String message)
API call for requesting a membervoid
requestConnection(java.lang.String message, ConnectionsParams connectionsParams, ConnectionsFields connectionsFields)
API call for requesting a memberprotected void
setConnectionDetails(java.lang.String connectionStatus, java.lang.String personalNote)
Set the connection details based on current connection status receivedprotected void
setInterests(Details details)
Set the current interests for the current membervoid
setSaveMemberId(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
-MembersParams
used 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 ofMembersParams
to useprofileParams
- instance ofProfileParams
to usesummaryParams
- instance ofSummaryParams
to use
-
-
Method Detail
-
getMemberReceivedListener
protected ListenerModel<BaseModel<Details>,Details> getMemberReceivedListener()
Create a listener forMembersAPI
- Returns:
- listener to handle
MembersAPI
requests
-
getProfileReceivedListener
protected Listener<Profile> getProfileReceivedListener()
Create a listener forProfileAPI
- Returns:
- listener to handle
ProfileAPI
requests
-
getConnectionRequestListener
protected Listener<SuccessResponse> getConnectionRequestListener()
Create a listener forConnectionsAPI
- Returns:
- listener to handle
ConnectionsAPI
requests
-
getAcceptConnectionListener
protected Listener<SuccessResponse> getAcceptConnectionListener()
Create a listener forConnectionsAPI
- Returns:
- listener to handle
ConnectionsAPI
requests
-
getSummaryReceivedListener
protected ListenerModel<BaseModel<Summary>,Summary> getSummaryReceivedListener()
Create a listener forSummaryAPI
- Returns:
- listener to handle
SummaryAPI
requests
-
getMembersAPI
protected MembersAPI getMembersAPI()
Get current instance ofMembersAPI
- Returns:
MembersAPI
used on this presenter
-
getProfileAPI
protected ProfileAPI getProfileAPI()
Get current instance ofProfileAPI
- Returns:
ProfileAPI
used on this presenter
-
getConnectionsAPI
protected ConnectionsAPI getConnectionsAPI()
Get current instance ofConnectionsAPI
- Returns:
ConnectionsAPI
used on this presenter
-
getSummaryAPI
protected SummaryAPI getSummaryAPI()
Get current instance ofSummaryAPI
- Returns:
SummaryAPI
used on this presenter
-
loadData
public void loadData()
Description copied from class:LcePresenter
Load initial view data.- Specified by:
loadData
in 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
-ConnectionsParams
to useconnectionsFields
-ConnectionsFields
to 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
-ConnectionsParams
to useconnectionsFields
-ConnectionsFields
to 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
-
-