Class ConnectionService

java.lang.Object
callofproject.dev.community.service.ConnectionService
All Implemented Interfaces:
IConnectionService

@Component @Lazy public class ConnectionService extends Object implements 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 Details

    • ConnectionService

      public ConnectionService(ConnectionServiceCallback connectionServiceCallback, KafkaProducer kafkaProducer)
      Constructor
      Parameters:
      connectionServiceCallback - the connection service callback
      kafkaProducer - 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:
      sendConnectionRequest in interface IConnectionService
      Parameters:
      userId - the user id
      friendId - 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:
      answerConnectionRequest in interface IConnectionService
      Parameters:
      userId - the user id
      friendId - the friend id
      answer - the answer
      Returns:
      the response message
    • removeConnection

      public callofproject.dev.data.common.clas.ResponseMessage<Object> removeConnection(UUID userId, UUID friendId)
      Remove connection
      Specified by:
      removeConnection in interface IConnectionService
      Parameters:
      userId - the user id
      friendId - 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:
      getConnectionsByUserId in interface IConnectionService
      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:
      blockConnection in interface IConnectionService
      Parameters:
      userId - the user id
      friendId - 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:
      unblockConnection in interface IConnectionService
      Parameters:
      userId - the user id
      friendId - 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:
      getConnectionRequestsByUserId in interface IConnectionService
      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:
      getBlockedConnectionsByUserId in interface IConnectionService
      Parameters:
      userId - the user id
      Returns:
      the response message