Package com.adobe.granite.socialgraph
Interface SocialGraph
-
@ProviderType public interface SocialGraphSocialGraphencapsulates an abstraction of a directed graph of node. A node in the graph is bound to a user and the edges between the graph are established by relationships. TheSocialGraphis bound to a resource resolver and can be adapted from one.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description GraphNodegetNode(java.lang.String id)Returns the node for the given id.voidrefresh(boolean keepChanges)IfkeepChangesisfalse, this method discards all pending changes currently recorded in this social graph and reverts all items to reflect the current saved state.voidsave()Saves the changes made to this social graph.
-
-
-
Method Detail
-
getNode
GraphNode getNode(java.lang.String id)
Returns the node for the given id. Note that this method always returns a GraphNode for a valid social object, even if the persistent object for the given id does not exist in the underlying system.- Parameters:
id- the id to retrieve the node for- Returns:
- the graph node or
nullof the social object withiddoes not exist. - Throws:
SocialGraphException- if an error during this operation occurs.
-
save
void save()
Saves the changes made to this social graph.- Throws:
SocialGraphException- if an error during this operation occurs.
-
refresh
void refresh(boolean keepChanges)
IfkeepChangesisfalse, this method discards all pending changes currently recorded in this social graph and reverts all items to reflect the current saved state.If
keepChangesis true then pending change are not discarded but items that do not have changes pending have their state refreshed to reflect the current saved state, thus revealing changes made by other sessions.- Parameters:
keepChanges- a boolean- Throws:
SocialGraphException- if an error during this operation occurs.
-
-