Class ConnectionService
java.lang.Object
callofproject.dev.community.service.ConnectionService
- All Implemented Interfaces:
IConnectionService
- Author:
- Nuri Can ÖZTÜRK The type Connection service. This class is responsible for handling connection requests, answers, removals, blocks, unblocks, and getting connections, connection requests, and blocked connections.
-
Constructor Summary
ConstructorsConstructorDescriptionConnectionService(ConnectionServiceCallback connectionServiceCallback, KafkaProducer kafkaProducer) Constructor -
Method Summary
Modifier and TypeMethodDescriptioncallofproject.dev.data.common.clas.ResponseMessage<Object>answerConnectionRequest(UUID userId, UUID friendId, boolean answer) Answer connection requestcallofproject.dev.data.common.clas.ResponseMessage<Object>blockConnection(UUID userId, UUID friendId) Block connectioncallofproject.dev.data.common.clas.MultipleResponseMessagePageable<Object>getBlockedConnectionsByUserId(UUID userId) Get blocked connections by user idcallofproject.dev.data.common.clas.MultipleResponseMessagePageable<Object>getConnectionRequestsByUserId(UUID userId) Get connection requests by user idcallofproject.dev.data.common.clas.MultipleResponseMessagePageable<Object>getConnectionsByUserId(UUID userId) Get user by id if existcallofproject.dev.data.common.clas.ResponseMessage<Object>removeConnection(UUID userId, UUID friendId) Remove connectioncallofproject.dev.data.common.clas.ResponseMessage<Object>sendConnectionRequest(UUID userId, UUID friendId) Send connection request to a usercallofproject.dev.data.common.clas.ResponseMessage<Object>unblockConnection(UUID userId, UUID friendId) Unblock connection
-
Constructor Details
-
ConnectionService
public ConnectionService(ConnectionServiceCallback connectionServiceCallback, KafkaProducer kafkaProducer) Constructor- Parameters:
connectionServiceCallback- the connection service callbackkafkaProducer- the kafka producer
-
-
Method Details
-
sendConnectionRequest
public callofproject.dev.data.common.clas.ResponseMessage<Object> sendConnectionRequest(UUID userId, UUID friendId) Send connection request to a user- Specified by:
sendConnectionRequestin interfaceIConnectionService- Parameters:
userId- the user idfriendId- the friend id- Returns:
- the response message
-
answerConnectionRequest
public callofproject.dev.data.common.clas.ResponseMessage<Object> answerConnectionRequest(UUID userId, UUID friendId, boolean answer) Answer connection request- Specified by:
answerConnectionRequestin interfaceIConnectionService- Parameters:
userId- the user idfriendId- the friend idanswer- the answer- Returns:
- the response message
-
removeConnection
public callofproject.dev.data.common.clas.ResponseMessage<Object> removeConnection(UUID userId, UUID friendId) Remove connection- Specified by:
removeConnectionin interfaceIConnectionService- Parameters:
userId- the user idfriendId- the friend id- Returns:
- the response message
-
getConnectionsByUserId
public callofproject.dev.data.common.clas.MultipleResponseMessagePageable<Object> getConnectionsByUserId(UUID userId) Get user by id if exist- Specified by:
getConnectionsByUserIdin interfaceIConnectionService- Parameters:
userId- the user id- Returns:
- the user
-
blockConnection
public callofproject.dev.data.common.clas.ResponseMessage<Object> blockConnection(UUID userId, UUID friendId) Block connection- Specified by:
blockConnectionin interfaceIConnectionService- Parameters:
userId- the user idfriendId- the friend id- Returns:
- the response message
-
unblockConnection
public callofproject.dev.data.common.clas.ResponseMessage<Object> unblockConnection(UUID userId, UUID friendId) Unblock connection- Specified by:
unblockConnectionin interfaceIConnectionService- Parameters:
userId- the user idfriendId- the friend id- Returns:
- the response message
-
getConnectionRequestsByUserId
public callofproject.dev.data.common.clas.MultipleResponseMessagePageable<Object> getConnectionRequestsByUserId(UUID userId) Get connection requests by user id- Specified by:
getConnectionRequestsByUserIdin interfaceIConnectionService- Parameters:
userId- the user id- Returns:
- the response message
-
getBlockedConnectionsByUserId
public callofproject.dev.data.common.clas.MultipleResponseMessagePageable<Object> getBlockedConnectionsByUserId(UUID userId) Get blocked connections by user id- Specified by:
getBlockedConnectionsByUserIdin interfaceIConnectionService- Parameters:
userId- the user id- Returns:
- the response message
-