Interface RelationshipManager
public interface RelationshipManager
Controls connections between identities.
This includes:
- Getting relationship between 2 identities.
- Interacting between identities: inviting, confirming, denying and ignoring.
- Getting a list access which contains connections, incoming and outgoing.
-
Method Summary
Modifier and TypeMethodDescriptionvoidConfirms to connect to an identity who sent invitation.voidconfirm(Relationship relationship) Deprecated.Deprecated.Useinvite(Identity, Identity)instead.voiddelete(Relationship existingRelationship) Deletes an existing relationship.voidDenies to connect to an identity who sent invitation.voiddeny(Relationship relationship) Deprecated.Usedeny(Identity, Identity)instead.findRelationships(Identity ownerIdentity, Relationship.Type relationshipType) Deprecated.UsegetIncoming(Identity)orgetOutgoing(Identity)instead.Deprecated.Should useget(Identity, Identity)instead.Gets a relationship by its Id.Gets a relationship between 2 identities.Deprecated.UsegetAllWithListAccess(Identity)instead.Deprecated.UsegetAllWithListAccess(Identity)instead.getAll(Identity identity, Relationship.Type type, List<Identity> identities) Deprecated.UsegetAllWithListAccess(Identity)instead.getAllRelationships(Identity identity) Deprecated.UsegetAllWithListAccess(Identity)instead.org.exoplatform.commons.utils.ListAccess<Identity>getAllWithListAccess(Identity existingIdentity) Gets a list access which contains all identities who were connected, were invited or invited a provided identity.getConfirmed(Identity identity) Deprecated.UsegetConnections(Identity)instead.getConfirmed(Identity identity, List<Identity> identities) Deprecated.UsegetConnections(Identity)instead.org.exoplatform.commons.utils.ListAccess<Identity>getConnections(Identity existingIdentity) Gets a list access which contains all identities who are connected to a provided identity.org.exoplatform.commons.utils.ListAccess<Identity>getConnectionsByFilter(Identity existingIdentity, ProfileFilter profileFilter) Gets a list access which contains all identities who are connected to a provided identity and filtered by a profile filter.default intgetConnectionsInCommonCount(Identity identity1, Identity identity2) getConnectionStatus(Identity fromIdentity, Identity toIdentity) Deprecated.UsegetStatus(Identity, Identity)instead.getContacts(Identity identity) Deprecated.UsegetConnections(Identity)instead.getContacts(Identity currIdentity, List<Identity> identities) Deprecated.UsegetConnections(Identity)instead.Deprecated.UsegetAllWithListAccess(Identity)instead.getIncoming(Identity receiver) Deprecated.UsegetIncomingWithListAccess(Identity)instead.getIncoming(Identity receiver, List<Identity> identities) Deprecated.UsegetIncomingWithListAccess(Identity)instead.org.exoplatform.commons.utils.ListAccess<Identity>getIncomingByFilter(Identity existingIdentity, ProfileFilter profileFilter) Deprecated.org.exoplatform.commons.utils.ListAccess<Identity>getIncomingWithListAccess(Identity existingIdentity) Gets a list access which contains all identities who invited to connect to a provided 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 returnedorg.exoplatform.commons.utils.ListAccess<Identity>getOutgoing(Identity existingIdentity) Gets a list access which contains all identities who were invited to connect by a provided identity.org.exoplatform.commons.utils.ListAccess<Identity>getOutgoingByFilter(Identity existingIdentity, ProfileFilter profileFilter) Deprecated.getPending(Identity sender) Deprecated.UsegetIncoming(Identity)instead.getPending(Identity sender, List<Identity> identities) Deprecated.UsegetIncomingWithListAccess(Identity)instead.getPendingRelationships(Identity identity) Deprecated.UsegetIncoming(Identity)instead.getPendingRelationships(Identity identity, boolean toConfirm) Deprecated.When toConfirm=true, usegetIncoming(Identity)instead.getPendingRelationships(Identity currIdentity, List<Identity> identities, boolean toConfirm) Deprecated.When toConfirm=true, usegetIncoming(Identity)instead.getRelationship(Identity sender, Identity receiver) Deprecated.Useget(Identity, Identity)instead.Deprecated.Useget(String)instead.Deprecated.UsegetAllWithListAccess(Identity)with identity instead.getRelationshipsByStatus(Identity identity, Relationship.Type type, int offset, int limit) Gets a list which contains all relationships by status.intgetRelationshipsCountByStatus(Identity identity, Relationship.Type type) Gets number of relationships by status.getRelationshipStatus(Relationship rel, Identity id) Deprecated.Now we don't use this method to get relationship we get status of relationship object and depend on sender and receiver, we can define pending relationship or incoming relationship.Gets the relationship status between 2 identities.getSuggestions(Identity identity, int offset, int limit) Deprecated.getSuggestions(Identity identity, int maxConnections, int maxConnectionsToLoad, int maxSuggestions) Gets suggestions having common users with the provided identity.voidIgnores to connect to an identity who sent invitation.voidignore(Relationship relationship) Deprecated.Useignore(Identity, Identity)instead.Deprecated.UseinviteToConnect(Identity, Identity)instead.inviteToConnect(Identity invitingIdentity, Identity invitedIdentity) Invites one identity to connect to the other.voidremove(Relationship relationship) Deprecated.Usedelete(Relationship)instead.voidsave(Relationship relationship) Deprecated.Use actions (inviteToConnect, confirm) instead.voidsaveRelationship(Relationship relationship) Deprecated.Useupdate(Relationship)instead.voidupdate(Relationship existingRelationship) Updates an existing relationship.
-
Method Details
-
get
Gets a relationship by its Id.- Parameters:
relationshipId- Id of the relationship.- Returns:
- The existing relationship or null.
- Since:
- 1.2.0-GA
- eXo level API
- Platform
-
get
Gets a relationship between 2 identities.- Parameters:
identity1- The identity 1.identity2- The identity 2.- Returns:
- The relationship between 2 identities.
- Since:
- 1.2.0-GA
- eXo level API
- Platform
-
update
Updates an existing relationship.- Parameters:
existingRelationship- The existing relationship to be updated.- Since:
- 1.2.0-GA
- eXo level API
- Platform
-
delete
Deletes an existing relationship.- Parameters:
existingRelationship- The existing relationship to be deleted.- Since:
- 1.2.0-GA
- eXo level API
- Platform
-
inviteToConnect
Invites one identity to connect to the other. The first argument must be the sender identity. The second argument must be the identity who is invited to connect.
One identity is not allowed to invite himself to connect.- Parameters:
invitingIdentity- The sender identity.invitedIdentity- The identity who is invited.- Since:
- 1.2.0-GA
- eXo level API
- Platform
-
confirm
Confirms to connect to an identity who sent invitation.- Parameters:
invitedIdentity- The identity who gets invitation.invitingIdentity- The identity who invites another.- Since:
- 1.2.0-GA
- eXo level API
- Platform
-
deny
Denies to connect to an identity who sent invitation.- Parameters:
invitedIdentity- The identity who gets invitation.invitingIdentity- The identity who invites another.- Since:
- 1.2.0-GA
- eXo level API
- Platform
-
ignore
Ignores to connect to an identity who sent invitation. Once being ignored, the inviting identity cannot invite any more.- Parameters:
invitedIdentity- The identity who gets invitation.invitingIdentity- The identity who invites another.- Since:
- 1.2.0-GA
- eXo level API
- Platform
-
getConnections
Gets a list access which contains all identities who are connected to a provided identity.- Parameters:
existingIdentity- The existing provided identity.- Returns:
- The list access.
- Since:
- 1.2.0-GA
- eXo level API
- Platform
-
getIncomingWithListAccess
org.exoplatform.commons.utils.ListAccess<Identity> getIncomingWithListAccess(Identity existingIdentity) Gets a list access which contains all identities who invited to connect to a provided identity.- Parameters:
existingIdentity- The existing provided identity.- Returns:
- The list access.
- Since:
- 1.2.0-GA
- eXo level API
- Platform
-
getOutgoing
Gets a list access which contains all identities who were invited to connect by a provided identity.- Parameters:
existingIdentity- The existing provided identity.- Returns:
- The list access.
- Since:
- 1.2.0-GA
- eXo level API
- Platform
-
getAllWithListAccess
Gets a list access which contains all identities who were connected, were invited or invited a provided identity.- Parameters:
existingIdentity- The existing provided identity.- Returns:
- The list access.
- Since:
- 1.2.0-GA
- eXo level API
- Platform
-
getStatus
Gets the relationship status between 2 identities.- Parameters:
identity1- The identity 1.identity2- The identity 2.- Returns:
- The relationship type.
- Since:
- 1.2.0-GA
- eXo level API
- Platform
-
invite
@Deprecated Relationship invite(Identity sender, Identity receiver) throws RelationshipStorageException Deprecated.UseinviteToConnect(Identity, Identity)instead. Will be removed by 4.0.x.Creates a connection invitation between 2 identities.- Parameters:
sender- The inviter.receiver- The invitee.- Returns:
- The PENDING relation.
- Throws:
RelationshipStorageException- eXo level API
- Provisional
-
getRelationshipById
Deprecated.Useget(String)instead. Will be removed by 4.0.x.Gets a relationship by a given Id.- Parameters:
id- The given Id.- Returns:
- The relationship.
- Throws:
RelationshipStorageException- the exception- eXo level API
- Provisional
-
save
Deprecated.Use actions (inviteToConnect, confirm) instead. Will be removed by 4.0.x.Saves a relationship.- Parameters:
relationship- The relationship to be saved.- Throws:
RelationshipStorageException- the exception- eXo level API
- Provisional
-
confirm
Deprecated.Useconfirm(Identity, Identity)instead. Will be removed by 4.0.x.Marks a relationship as "confirmed".- Parameters:
relationship- The relationship to be marked as "confirmed".- Throws:
RelationshipStorageException- the exception- eXo level API
- Provisional
-
deny
Deprecated.Usedeny(Identity, Identity)instead. Will be removed by 4.0.x.Denies a relationship.- Parameters:
relationship- The relationship to be denied.- Throws:
RelationshipStorageException- eXo level API
- Provisional
-
remove
Deprecated.Usedelete(Relationship)instead. Will be removed by 4.0.x.Removes a relationship.- Parameters:
relationship- The relationship to be removed.- Throws:
RelationshipStorageException- the exception- eXo level API
- Provisional
-
ignore
Deprecated.Useignore(Identity, Identity)instead. Will be removed by 4.0.x.Marks a relationship as "ignored".- Parameters:
relationship- The relationship to be marked as "ignored".- Throws:
RelationshipStorageException- the exception- eXo level API
- Provisional
-
getPendingRelationships
@Deprecated List<Relationship> getPendingRelationships(Identity identity) throws RelationshipStorageException Deprecated.UsegetIncoming(Identity)instead. Will be removed by 4.0.x.Returns all pending relationships: sent.- Parameters:
identity- The identity.- Returns:
- The pending relationships.
- Throws:
RelationshipStorageException- the exception- eXo level API
- Provisional
-
getPendingRelationships
@Deprecated List<Relationship> getPendingRelationships(Identity identity, boolean toConfirm) throws RelationshipStorageException Deprecated.When toConfirm=true, usegetIncoming(Identity)instead. When toConfirm=false, usegetOutgoing(Identity)instead. Will be removed by 4.0.x.Gets a list of pending relationships that were received but not confirmed or were sent but not confirmed.- Parameters:
identity- The identity.toConfirm- If "true", it returns a list of pending relationships received but not confirmed. If "false", it returns a list of pending relationships sent but not confirmed.- Returns:
- The list of pending relationships.
- Throws:
RelationshipStorageException- the exception- eXo level API
- Provisional
-
getPendingRelationships
@Deprecated List<Relationship> getPendingRelationships(Identity currIdentity, List<Identity> identities, boolean toConfirm) throws RelationshipStorageException Deprecated.When toConfirm=true, usegetIncoming(Identity)instead. When toConfirm=false usegetOutgoing(Identity)instead. Will be removed by 4.0.x.Gets a list of pending relationships that were received but not confirmed or were sent but not confirmed.- Parameters:
currIdentity- The current identity.identities- The identities.toConfirm- If "true", it returns a list of pending relationships received but not confirmed. If "false", it returns a list of pending relationships sent but not confirmed.- Returns:
- The list of pending relationships.
- Throws:
RelationshipStorageException- the exception- eXo level API
- Provisional
-
getContacts
@Deprecated List<Relationship> getContacts(Identity currIdentity, List<Identity> identities) throws RelationshipStorageException Deprecated.UsegetConnections(Identity)instead. Will be removed by 4.0.x.Gets contacts matching with the current identity.- Parameters:
currIdentity- The current identity.identities- The identities.- Returns:
- The contacts.
- Throws:
RelationshipStorageException- the exception- eXo level API
- Provisional
-
getContacts
Deprecated.UsegetConnections(Identity)instead. Will be removed by 4.0.x.Gets contacts of an identity.- Parameters:
identity- The identity.- Returns:
- The contacts.
- Throws:
RelationshipStorageException- the exception- eXo level API
- Provisional
-
getAllRelationships
@Deprecated List<Relationship> getAllRelationships(Identity identity) throws RelationshipStorageException Deprecated.UsegetAllWithListAccess(Identity)instead. Will be removed by 4.0.x.Returns all relationships associated with a given identity.- Parameters:
identity- The identity.- Returns:
- The relationships.
- Throws:
RelationshipStorageException- the exception- eXo level API
- Provisional
-
getRelationshipsByIdentityId
@Deprecated List<Relationship> getRelationshipsByIdentityId(String id) throws RelationshipStorageException Deprecated.UsegetAllWithListAccess(Identity)with identity instead. Will be removed by 4.0.x.Returns all relationships associated with a given identityId.- Parameters:
id- Id of the identity.- Returns:
- The relationships.
- Throws:
RelationshipStorageException- the exception- eXo level API
- Provisional
-
getIdentities
Deprecated.UsegetAllWithListAccess(Identity)instead. Will be removed by 4.0.x.Returns all identities associated with a given identity.- Parameters:
id- The given identity.- Returns:
- The identities.
- Throws:
Exception- the exception- eXo level API
- Provisional
-
create
Deprecated.Useinvite(Identity, Identity)instead. Will be removed by 4.0.x.Creates a relationship.- Parameters:
sender- The sender.receiver- The receiver.- Returns:
- The relationship.
- eXo level API
- Provisional
-
saveRelationship
Deprecated.Useupdate(Relationship)instead. Will be removed by 4.0.x.Saves a relationship.- Parameters:
relationship- The relationship to be saved.- Throws:
RelationshipStorageException- the exception- eXo level API
- Provisional
-
findRoute
Deprecated.Should useget(Identity, Identity)instead. Will be removed by 4.0.x.Gets a relationship between 2 identities.- Parameters:
sender- The identity 1.receiver- The identity 2.- Returns:
- The relationship.
- Throws:
RelationshipStorageException- eXo level API
- Provisional
-
getRelationship
@Deprecated Relationship getRelationship(Identity sender, Identity receiver) throws RelationshipStorageException Deprecated.Useget(Identity, Identity)instead. Will be removed by 4.0.x.Gets a relationship between 2 identities.- Parameters:
sender- The identity 1.receiver- The identity 2.- Returns:
- The relationship.
- Throws:
RelationshipStorageException- the exception- eXo level API
- Provisional
-
findRelationships
@Deprecated List<Identity> findRelationships(Identity ownerIdentity, Relationship.Type relationshipType) throws RelationshipStorageException Deprecated.UsegetIncoming(Identity)orgetOutgoing(Identity)instead. Will be removed by 4.0.x.Finds all identities having relationshipType with the ownerIdentity.- Parameters:
ownerIdentity- The owner identity.relationshipType- The relationship type.- Returns:
- The identities.
- Throws:
RelationshipStorageException- Since:
- 1.2.0-Beta1
- eXo level API
- Provisional
-
getRelationshipStatus
Deprecated.Now we don't use this method to get relationship we get status of relationship object and depend on sender and receiver, we can define pending relationship or incoming relationship. But we still keep this method for build, callgetStatus(Identity, Identity). This method will be removed by 4.0.x.Gets the relationship status.- Parameters:
rel- The relationship.id- The identity.- Returns:
- The relationship status.
- eXo level API
- Provisional
-
getConnectionStatus
@Deprecated Relationship.Type getConnectionStatus(Identity fromIdentity, Identity toIdentity) throws Exception Deprecated.UsegetStatus(Identity, Identity)instead. Will be removed by 4.0.x.Gets the connection status between 2 identities.- Parameters:
fromIdentity- The identity 1.toIdentity- The identity 2.- Returns:
- The connection status.
- Throws:
Exception- Since:
- 1.1.1
- eXo level API
- Provisional
-
getPending
Deprecated.UsegetIncoming(Identity)instead. Will be removed by 4.0.x.Gets all pending relationships of a sender.- Parameters:
sender- The sender.- Returns:
- The pending relationships.
- Throws:
RelationshipStorageException- the exception- Since:
- 1.2.0-Beta1
- eXo level API
- Provisional
-
getPending
@Deprecated List<Relationship> getPending(Identity sender, List<Identity> identities) throws RelationshipStorageException Deprecated.UsegetIncomingWithListAccess(Identity)instead. Will be removed by 4.0.x.Gets pending relationships of a sender that match with identities.- Parameters:
sender- The sender.identities- The identities.- Returns:
- The pending relationships.
- Throws:
RelationshipStorageException- the exception- Since:
- 1.2.0-Beta1
- eXo level API
- Provisional
-
getIncoming
Deprecated.UsegetIncomingWithListAccess(Identity)instead. Will be removed by 4.0.x.Gets relationships of a receiver that are waiting for validation.- Parameters:
receiver- Identity of the receiver.- Returns:
- The relationships.
- Throws:
RelationshipStorageException- Since:
- 1.2.0-Beta1
- eXo level API
- Provisional
-
getIncoming
@Deprecated List<Relationship> getIncoming(Identity receiver, List<Identity> identities) throws RelationshipStorageException Deprecated.UsegetIncomingWithListAccess(Identity)instead. Will be removed by 4.0.x.Gets relationships of a receiver that are waiting for validation and match with identities.- Parameters:
receiver- Identity of the receiver.identities- The identities.- Returns:
- The list of relationships.
- Throws:
RelationshipStorageException- the exception- Since:
- 1.2.0-Beta1
- eXo level API
- Provisional
-
getConfirmed
Deprecated.UsegetConnections(Identity)instead. Will be removed by 4.0.x.Gets relationships confirmed by an identity.- Parameters:
identity- The identity.- Returns:
- The confirmed relationships.
- Throws:
RelationshipStorageException- the exception- Since:
- 1.2.0-Beta1
- eXo level API
- Provisional
-
getConfirmed
@Deprecated List<Relationship> getConfirmed(Identity identity, List<Identity> identities) throws RelationshipStorageException Deprecated.UsegetConnections(Identity)instead. Will be removed by 4.0.x.Gets relationships confirmed by an identity that match with identities.- Parameters:
identity- The identity.identities- The identities.- Returns:
- The confirmed relationships.
- Throws:
RelationshipStorageException- the exception- Since:
- 1.2.0-Beta1
- eXo level API
- Provisional
-
getAll
Deprecated.UsegetAllWithListAccess(Identity)instead. Will be removed by 4.0.x.Gets all relationships of a given identity with other identity.- Parameters:
identity- The identity.- Returns:
- The relationships.
- Throws:
RelationshipStorageException- the exception- Since:
- 1.2.0-Beta1
- eXo level API
- Provisional
-
getAll
@Deprecated List<Relationship> getAll(Identity identity, List<Identity> identities) throws RelationshipStorageException Deprecated.UsegetAllWithListAccess(Identity)instead. Will be removed by 4.0.x.Gets all relationships of a given identity.- Parameters:
identity- The identity.identities- The identities.- Returns:
- The relationships.
- Throws:
RelationshipStorageException- the exception- Since:
- 1.2.0-Beta1
- eXo level API
- Provisional
-
getAll
@Deprecated List<Relationship> getAll(Identity identity, Relationship.Type type, List<Identity> identities) throws RelationshipStorageException Deprecated.UsegetAllWithListAccess(Identity)instead. Will be removed by 4.0.x.Gets all relationships of a given identity.- Parameters:
identity- The identity.type- The status.identities- The identities.- Returns:
- The relationships.
- Throws:
RelationshipStorageException- the exception- Since:
- 1.2.0-Beta1
- eXo level API
- Provisional
-
getConnectionsByFilter
org.exoplatform.commons.utils.ListAccess<Identity> getConnectionsByFilter(Identity existingIdentity, ProfileFilter profileFilter) Gets a list access which contains all identities who are connected to a provided identity and filtered by a profile filter.- Parameters:
existingIdentity- The provided identity.profileFilter- The provided profile filter.- Returns:
- The list access.
- Since:
- 1.2.3
- eXo level API
- Platform
-
getIncomingByFilter
@Deprecated org.exoplatform.commons.utils.ListAccess<Identity> getIncomingByFilter(Identity existingIdentity, ProfileFilter profileFilter) Deprecated.Gets a list access which contains all identities who invited to connect to a provided identity and filtered by a profile filter.- Parameters:
existingIdentity- The provided identity.profileFilter- The provided profile filter.- Returns:
- The list access.
- Since:
- 1.2.3
- eXo level API
- Platform
-
getOutgoingByFilter
@Deprecated org.exoplatform.commons.utils.ListAccess<Identity> getOutgoingByFilter(Identity existingIdentity, ProfileFilter profileFilter) Deprecated.Gets a list access which contains all identities who were invited by a provided identity to connect and filtered by a profile filter.- Parameters:
existingIdentity- The provided identity.profileFilter- The provided profile filter.- Returns:
- The list access.
- Since:
- 1.2.3
- eXo level API
- Platform
-
getSuggestions
Map<Identity,Integer> getSuggestions(Identity identity, int maxConnections, int maxConnectionsToLoad, int maxSuggestions) Gets suggestions having common users with the provided identity.- 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- Returns:
- The suggestions.
- Since:
- 4.0.6
- eXo level API
- Experimental
-
getSuggestions
Deprecated.Gets suggestions having common users with the provided identity.- Parameters:
identity- The provided identity.offset- The starting point from which suggestions are got.limit- The limitation of suggestions.- Returns:
- The suggestions.
- Since:
- 4.0.2
- eXo level API
- Experimental
-
getLastConnections
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:
-
getRelationshipsByStatus
List<Relationship> getRelationshipsByStatus(Identity identity, Relationship.Type type, int offset, int limit) Gets a list which contains all relationships by status.- Parameters:
identity- The provided identity.type- type of the relationship : ALL, PENDING or CONFIRMED.offset- The starting point.limit- The limitation.- Returns:
- The list of relationships.
-
getRelationshipsCountByStatus
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.
-
getConnectionsInCommonCount
-
confirm(Identity, Identity)instead.