Interface SocialGraph


  • @ProviderType
    public interface SocialGraph
    SocialGraph encapsulates 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. The SocialGraph is bound to a resource resolver and can be adapted from one.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      GraphNode getNode​(java.lang.String id)
      Returns the node for the given id.
      void refresh​(boolean keepChanges)
      If keepChanges is false, this method discards all pending changes currently recorded in this social graph and reverts all items to reflect the current saved state.
      void save()
      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 null of the social object with id does 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)
        If keepChanges is false, this method discards all pending changes currently recorded in this social graph and reverts all items to reflect the current saved state.

        If keepChanges is 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.