Interface ConnectionDAO

All Superinterfaces:
org.exoplatform.commons.api.persistence.GenericDAO<ConnectionEntity,Long>
All Known Implementing Classes:
ConnectionDAOImpl

public interface ConnectionDAO extends org.exoplatform.commons.api.persistence.GenericDAO<ConnectionEntity,Long>
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    count(org.exoplatform.social.core.identity.model.Identity identity, org.exoplatform.social.core.relationship.model.Relationship.Type status)
    Has the connections
    getConnection(Long sender, Long receiver)
     
    getConnection(org.exoplatform.social.core.identity.model.Identity identity1, org.exoplatform.social.core.identity.model.Identity identity2)
    Get connection of 2 users
    getConnectionIds(long identityId, org.exoplatform.social.core.relationship.model.Relationship.Type status)
    Return list of identities with whom the passed identity in parameter has a confirmed relationship
    getConnections(org.exoplatform.social.core.identity.model.Identity sender, org.exoplatform.social.core.identity.model.Identity receiver, org.exoplatform.social.core.relationship.model.Relationship.Type status)
     
    getConnections(org.exoplatform.social.core.identity.model.Identity identity, org.exoplatform.social.core.relationship.model.Relationship.Type type, long offset, long limit, org.exoplatform.social.core.search.Sorting sorting)
     
    getConnectionsByFilter(org.exoplatform.social.core.identity.model.Identity existingIdentity, org.exoplatform.social.core.profile.ProfileFilter profileFilter, org.exoplatform.social.core.relationship.model.Relationship.Type type, long offset, long limit)
     
    int
    getConnectionsByFilterCount(org.exoplatform.social.core.identity.model.Identity identity, org.exoplatform.social.core.profile.ProfileFilter profileFilter, org.exoplatform.social.core.relationship.model.Relationship.Type type)
     
    int
    getConnectionsCount(org.exoplatform.social.core.identity.model.Identity identity, org.exoplatform.social.core.relationship.model.Relationship.Type type)
     
    int
     
    getLastConnections(org.exoplatform.social.core.identity.model.Identity identity, int limit)
     
    getReceiverIds(long receiverId, org.exoplatform.social.core.relationship.model.Relationship.Type status, int offset, int limit)
     
    getSenderIds(long receiverId, org.exoplatform.social.core.relationship.model.Relationship.Type status, int offset, int limit)
     

    Methods inherited from interface org.exoplatform.commons.api.persistence.GenericDAO

    count, create, createAll, delete, deleteAll, deleteAll, find, findAll, update, updateAll
  • Method Details

    • count

      long count(org.exoplatform.social.core.identity.model.Identity identity, org.exoplatform.social.core.relationship.model.Relationship.Type status)
      Has the connections
      Parameters:
      identity - the Identity
      status - the status of connection
      Returns:
      number of connection
    • getConnection

      ConnectionEntity getConnection(org.exoplatform.social.core.identity.model.Identity identity1, org.exoplatform.social.core.identity.model.Identity identity2)
      Get connection of 2 users
      Parameters:
      identity1 - The first Identity
      identity2 - the second Identity
      Returns:
      the connection entity
    • getConnection

      ConnectionEntity getConnection(Long sender, Long receiver)
      Parameters:
      sender - the id of sender Identity
      receiver - the id of receiver Identity
      Returns:
      the connection entity
    • getConnections

      List<ConnectionEntity> getConnections(org.exoplatform.social.core.identity.model.Identity identity, org.exoplatform.social.core.relationship.model.Relationship.Type type, long offset, long limit, org.exoplatform.social.core.search.Sorting sorting)
      Parameters:
      identity - the Identity
      type - type of connection
      offset - the start index
      limit - the max items to load
      sorting - sortby field name and sort direction
      Returns:
      list of connection entities
    • getConnections

      List<ConnectionEntity> getConnections(org.exoplatform.social.core.identity.model.Identity sender, org.exoplatform.social.core.identity.model.Identity receiver, org.exoplatform.social.core.relationship.model.Relationship.Type status)
      Parameters:
      sender - the sender Identity
      receiver - the receiver Identity
      status - the connection status
      Returns:
      list of connection entities
    • getConnectionsCount

      int getConnectionsCount(org.exoplatform.social.core.identity.model.Identity identity, org.exoplatform.social.core.relationship.model.Relationship.Type type)
      Parameters:
      identity - the Identity
      type - the connection type
      Returns:
      number of connections
    • getLastConnections

      List<ConnectionEntity> getLastConnections(org.exoplatform.social.core.identity.model.Identity identity, int limit)
      Parameters:
      identity - the Identity
      limit - max item to load
      Returns:
      list of connection entities
    • getConnectionsByFilter

      List<ConnectionEntity> getConnectionsByFilter(org.exoplatform.social.core.identity.model.Identity existingIdentity, org.exoplatform.social.core.profile.ProfileFilter profileFilter, org.exoplatform.social.core.relationship.model.Relationship.Type type, long offset, long limit)
      Parameters:
      existingIdentity - the Identity
      profileFilter - the ProfileFilter
      type - connection type
      offset - the start index
      limit - max items to load
      Returns:
      list of connection entities
    • getConnectionsByFilterCount

      int getConnectionsByFilterCount(org.exoplatform.social.core.identity.model.Identity identity, org.exoplatform.social.core.profile.ProfileFilter profileFilter, org.exoplatform.social.core.relationship.model.Relationship.Type type)
      Parameters:
      identity - the Identity
      profileFilter - the profile filter
      type - connection type
      Returns:
      number of connections
    • getSenderIds

      List<Long> getSenderIds(long receiverId, org.exoplatform.social.core.relationship.model.Relationship.Type status, int offset, int limit)
    • getReceiverIds

      List<Long> getReceiverIds(long receiverId, org.exoplatform.social.core.relationship.model.Relationship.Type status, int offset, int limit)
    • getConnectionsInCommonCount

      int getConnectionsInCommonCount(String id, String id2)
      Parameters:
      id -
      id2 -
      Returns:
      connections in common count between two users
    • getConnectionIds

      Set<Long> getConnectionIds(long identityId, org.exoplatform.social.core.relationship.model.Relationship.Type status)
      Return list of identities with whom the passed identity in parameter has a confirmed relationship
      Parameters:
      identityId -
      status -
      Returns:
      Set of Identity ids