Interface RelationshipStorage
-
public interface RelationshipStorage- Version:
- $Revision$
- Author:
- Alain Defrance
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description List<Identity>getConnections(Identity identity)Gets connections with the identity.List<Identity>getConnections(Identity identity, long offset, long limit)Gets connections with the identity.List<Identity>getConnectionsByFilter(Identity existingIdentity, ProfileFilter profileFilter, long offset, long limit)Gets the list access to get a list of identities who is connected with the provided identity and filtered by profile filter.intgetConnectionsCount(Identity identity)Gets count of connection with the identity.intgetConnectionsCountByFilter(Identity existingIdentity, ProfileFilter profileFilter)Gets the count of identities who is connected with the provided identity and filtered by profile filter.default intgetConnectionsInCommonCount(Identity identity1, Identity identity2)List<Identity>getIncomingByFilter(Identity existingIdentity, ProfileFilter profileFilter, long offset, long limit)Gets the list access to get a list of identities who invited to connect to the provided identity and filtered by profile filter.intgetIncomingCountByFilter(Identity existingIdentity, ProfileFilter profileFilter)Gets count of identities who invited to connect to the provided identity and filtered by profile filter.List<Identity>getIncomingRelationships(Identity receiver, long offset, long limit)Gets the list of relationship by identity matching with checking identity ids with offset, limit.intgetIncomingRelationshipsCount(Identity receiver)Gets the count of the list of relationship by identity matching with checking identity ids.List<Identity>getLastConnections(Identity identity, int limit)Get the list of identities who are most recently connected with given user the limit number of results must be greater than 0 or an empty list will be returnedList<Identity>getOutgoingByFilter(Identity existingIdentity, ProfileFilter profileFilter, long offset, long limit)Gets the list access to get a list of identities who was invited by the provided identity to connect and filtered by profile filter.intgetOutgoingCountByFilter(Identity existingIdentity, ProfileFilter profileFilter)Gets count of identities who was invited by the provided identity to connect and filtered by profile filter.List<Identity>getOutgoingRelationships(Identity sender, long offset, long limit)Gets the list of relationship by identity matching with checking identity ids with offset, limit.intgetOutgoingRelationshipsCount(Identity sender)Gets the count of the list of relationship by identity matching with checking identity ids.List<Relationship>getReceiverRelationships(Identity receiver, Relationship.Type type, List<Identity> listCheckIdentity)Gets the list of relationship by identity id matching with checking identity idsRelationshipgetRelationship(String uuid)Gets the relationship.RelationshipgetRelationship(Identity identity1, Identity identity2)Gets the relationship of 2 identities.List<Identity>getRelationships(Identity identity, long offset, long limit)Gets the list of relationship by identity matching with checking identity idsList<Relationship>getRelationships(Identity identity, Relationship.Type type, List<Identity> listCheckIdentity)Gets the list of relationship by identity matching with checking identity idsList<Relationship>getRelationshipsByStatus(Identity identity, Relationship.Type type, long offset, long limit)Gets a list of all relationships by status.intgetRelationshipsCount(Identity identity)Gets the count of identities by identity matching with checking identity ids.intgetRelationshipsCountByStatus(Identity identity, Relationship.Type type)Gets number of relationships by status.List<Relationship>getSenderRelationships(String senderId, Relationship.Type type, List<Identity> listCheckIdentity)Gets the list of relationship by identity id matching with checking identity idsList<Relationship>getSenderRelationships(Identity sender, Relationship.Type type, List<Identity> listCheckIdentity)Gets the list of relationship by identity id matching with checking identity idsMap<Identity,Integer>getSuggestions(Identity identity, int maxConnections, int maxConnectionsToLoad, int maxSuggestions)Gets suggestions having common users with the provided identity.booleanhasRelationship(Identity identity1, Identity identity2, String relationshipPath)Has relationship by relationship pathvoidremoveRelationship(Relationship relationship)Removes the relationship.RelationshipsaveRelationship(Relationship relationship)Saves relationship.
-
-
-
Method Detail
-
saveRelationship
Relationship saveRelationship(Relationship relationship) throws RelationshipStorageException
Saves relationship.- Parameters:
relationship- the relationship- Throws:
RelationshipStorageException
-
removeRelationship
void removeRelationship(Relationship relationship) throws RelationshipStorageException
Removes the relationship.- Parameters:
relationship- the relationship- Throws:
RelationshipStorageException
-
getRelationship
Relationship getRelationship(String uuid) throws RelationshipStorageException
Gets the relationship.- Parameters:
uuid- the uuid- Returns:
- the relationship
- Throws:
RelationshipStorageException
-
getSenderRelationships
List<Relationship> getSenderRelationships(Identity sender, Relationship.Type type, List<Identity> listCheckIdentity) throws RelationshipStorageException
Gets the list of relationship by identity id matching with checking identity ids- Parameters:
sender- the identitytype-listCheckIdentity- identity the checking identities- Returns:
- the relationship
- Throws:
RelationshipStorageException
-
getSenderRelationships
List<Relationship> getSenderRelationships(String senderId, Relationship.Type type, List<Identity> listCheckIdentity) throws RelationshipStorageException
Gets the list of relationship by identity id matching with checking identity ids- Parameters:
senderId- the identity idtype-listCheckIdentity- identity the checking identities- Returns:
- the relationship
- Throws:
RelationshipStorageException
-
getReceiverRelationships
List<Relationship> getReceiverRelationships(Identity receiver, Relationship.Type type, List<Identity> listCheckIdentity) throws RelationshipStorageException
Gets the list of relationship by identity id matching with checking identity ids- Parameters:
receiver- the identity idtype-listCheckIdentity- identityId the checking identity ids- Returns:
- the relationship
- Throws:
RelationshipStorageException
-
getRelationship
Relationship getRelationship(Identity identity1, Identity identity2) throws RelationshipStorageException
Gets the relationship of 2 identities.- Parameters:
identity1- the identity1identity2- the identity2- Returns:
- the relationship
- Throws:
RelationshipStorageException
-
hasRelationship
boolean hasRelationship(Identity identity1, Identity identity2, String relationshipPath) throws RelationshipStorageException
Has relationship by relationship path- Parameters:
identity1- the identity1identity2- the identity2relationshipPath- the relationship path- Returns:
- TRUE/FALSE
- Throws:
RelationshipStorageException
-
getRelationships
List<Relationship> getRelationships(Identity identity, Relationship.Type type, List<Identity> listCheckIdentity) throws RelationshipStorageException
Gets the list of relationship by identity matching with checking identity ids- Parameters:
identity- the identitytype-listCheckIdentity- identity the checking identities- Returns:
- the relationship
- Throws:
RelationshipStorageException
-
getRelationships
List<Identity> getRelationships(Identity identity, long offset, long limit) throws RelationshipStorageException
Gets the list of relationship by identity matching with checking identity ids- Parameters:
identity- the identity- Returns:
- the relationship
- Throws:
RelationshipStorageException
-
getIncomingRelationships
List<Identity> getIncomingRelationships(Identity receiver, long offset, long limit) throws RelationshipStorageException
Gets the list of relationship by identity matching with checking identity ids with offset, limit.- Parameters:
receiver- the identityoffset-limit-- Returns:
- the identities
- Throws:
RelationshipStorageException
-
getIncomingRelationshipsCount
int getIncomingRelationshipsCount(Identity receiver) throws RelationshipStorageException
Gets the count of the list of relationship by identity matching with checking identity ids.- Parameters:
receiver- the identity- Returns:
- the relationship number
- Throws:
RelationshipStorageException
-
getOutgoingRelationships
List<Identity> getOutgoingRelationships(Identity sender, long offset, long limit) throws RelationshipStorageException
Gets the list of relationship by identity matching with checking identity ids with offset, limit.- Parameters:
sender- the identityoffset-limit-- Returns:
- the identities
- Throws:
RelationshipStorageException
-
getOutgoingRelationshipsCount
int getOutgoingRelationshipsCount(Identity sender) throws RelationshipStorageException
Gets the count of the list of relationship by identity matching with checking identity ids.- Parameters:
sender- the identity- Returns:
- the relationship number
- Throws:
RelationshipStorageException
-
getRelationshipsCount
int getRelationshipsCount(Identity identity) throws RelationshipStorageException
Gets the count of identities by identity matching with checking identity ids.- Parameters:
identity- the identity id- Returns:
- the relationships number
- Throws:
RelationshipStorageException- Since:
- 1.2.0-Beta3
-
getConnections
List<Identity> getConnections(Identity identity, long offset, long limit) throws RelationshipStorageException
Gets connections with the identity.- Parameters:
identity-offset-limit-- Returns:
- number of connections belong to limitation of offset and limit.
- Throws:
RelationshipStorageException- Since:
- 1.2.0-GA
-
getConnections
List<Identity> getConnections(Identity identity) throws RelationshipStorageException
Gets connections with the identity.- Parameters:
identity-- Returns:
- number of connections belong to limitation of offset and limit.
- Throws:
RelationshipStorageException- Since:
- 1.2.0-GA
-
getConnectionsCount
int getConnectionsCount(Identity identity) throws RelationshipStorageException
Gets count of connection with the identity.- Parameters:
identity-- Returns:
- Throws:
RelationshipStorageException- Since:
- 1.2.0-GA
-
getConnectionsByFilter
List<Identity> getConnectionsByFilter(Identity existingIdentity, ProfileFilter profileFilter, long offset, long limit) throws RelationshipStorageException
Gets the list access to get a list of identities who is connected with the provided identity and filtered by profile filter.- Parameters:
existingIdentity- the provided identity.profileFilter- the provided profile filter.offset-limit-- Returns:
- the list of identity
- Throws:
RelationshipStorageException- Since:
- 1.2.3
-
getIncomingByFilter
List<Identity> getIncomingByFilter(Identity existingIdentity, ProfileFilter profileFilter, long offset, long limit) throws RelationshipStorageException
Gets the list access to get a list of identities who invited to connect to the provided identity and filtered by profile filter.- Parameters:
existingIdentity- the provided identityprofileFilter- the provided profile filteroffset-limit-- Returns:
- the list of identity
- Throws:
RelationshipStorageException- Since:
- 1.2.3
-
getOutgoingByFilter
List<Identity> getOutgoingByFilter(Identity existingIdentity, ProfileFilter profileFilter, long offset, long limit) throws RelationshipStorageException
Gets the list access to get a list of identities who was invited by the provided identity to connect and filtered by profile filter.- Parameters:
existingIdentity- the provided identityprofileFilter- the provided profile filteroffset-limit-- Returns:
- the list of identity
- Throws:
RelationshipStorageException- Since:
- 1.2.3
-
getConnectionsCountByFilter
int getConnectionsCountByFilter(Identity existingIdentity, ProfileFilter profileFilter) throws RelationshipStorageException
Gets the count of identities who is connected with the provided identity and filtered by profile filter.- Parameters:
existingIdentity-profileFilter-- Returns:
- count of identities
- Throws:
RelationshipStorageException- Since:
- 1.2.3
-
getIncomingCountByFilter
int getIncomingCountByFilter(Identity existingIdentity, ProfileFilter profileFilter) throws RelationshipStorageException
Gets count of identities who invited to connect to the provided identity and filtered by profile filter.- Parameters:
existingIdentity-profileFilter-- Returns:
- count of identities
- Throws:
RelationshipStorageException- Since:
- 1.2.3
-
getOutgoingCountByFilter
int getOutgoingCountByFilter(Identity existingIdentity, ProfileFilter profileFilter) throws RelationshipStorageException
Gets count of identities who was invited by the provided identity to connect and filtered by profile filter.- Parameters:
existingIdentity-profileFilter-- Returns:
- count of identities
- Throws:
RelationshipStorageException- Since:
- 1.2.3
-
getSuggestions
Map<Identity,Integer> getSuggestions(Identity identity, int maxConnections, int maxConnectionsToLoad, int maxSuggestions) throws RelationshipStorageException
Gets suggestions having common users with the provided identity. If the total amount of suggestions found doesn't match with the expected amount this method could return null even if some suggestions have been found, this is needed to be able to distinguish cases where we could not found enough suggestions because we did not treat all the sub connections from cases where on a given sample of sub connections we could not find what we expect- Parameters:
identity- The provided identity.maxConnections- Maximum of connections that we can treat per identity. If set to a value <= 0, the limit will be disabledmaxConnectionsToLoad- In case, the maxConnections are not enough to find enough suggestion, we load more connections at the first level. If maxConnectionsToLoad or maxConnections has been set to a value <= 0, the limit will be disabledmaxSuggestions- The total amount of expected suggestions. If set to a value <= 0, the limit will be disabled- Throws:
RelationshipStorageException- Since:
- 4.0.x
-
getLastConnections
List<Identity> getLastConnections(Identity identity, int limit) throws RelationshipStorageException
Get the list of identities who are most recently connected with given user the limit number of results must be greater than 0 or an empty list will be returned- Parameters:
identity-limit-- Returns:
- Throws:
RelationshipStorageException
-
getRelationshipsByStatus
List<Relationship> getRelationshipsByStatus(Identity identity, Relationship.Type type, long offset, long limit)
Gets a list of all relationships by status.- Parameters:
identity- The provided identity.type- type of the relationship : ALL, PENDING or CONFIRMED.offset-limit-- Returns:
- The list of relationships.
-
getRelationshipsCountByStatus
int getRelationshipsCountByStatus(Identity identity, Relationship.Type type)
Gets number of relationships by status.- Parameters:
identity- The provided identity.type- type of the relationship : ALL, PENDING or CONFIRMED.- Returns:
- The number of relationships.
-
-