Class CommitInfo

java.lang.Object
org.apache.jackrabbit.oak.spi.commit.CommitInfo

public final class CommitInfo extends Object
Commit info instances associate some meta data with a commit.
  • Field Details

    • OAK_UNKNOWN

      public static final String OAK_UNKNOWN
      See Also:
    • EMPTY

      public static final CommitInfo EMPTY
      Empty commit information object. Used as a dummy object when no metadata is known (or needed) about a commit.
    • EMPTY_EXTERNAL

      public static final CommitInfo EMPTY_EXTERNAL
      Empty commit information object to be used for external changes. Used as a dummy object when no metadata is known (or needed) about a commit.
  • Constructor Details

    • CommitInfo

      public CommitInfo(@NotNull @NotNull String sessionId, @Nullable @Nullable String userId)
      Creates a commit info for the given session and user.
      Parameters:
      sessionId - session identifier
      userId - The user id.
    • CommitInfo

      public CommitInfo(@NotNull @NotNull String sessionId, @Nullable @Nullable String userId, Map<String,Object> info)
      Creates a commit info for the given session and user and info map.
      Parameters:
      sessionId - session identifier
      userId - The user id.
      info - info map
    • CommitInfo

      public CommitInfo(@NotNull @NotNull String sessionId, @Nullable @Nullable String userId, Map<String,Object> info, boolean external)
      Creates a commit info for the given session and user and info map.
      Parameters:
      sessionId - session identifier
      userId - The user id.
      info - info map
      external - indicates if the commit info is from external change
  • Method Details

    • getSessionId

      @NotNull public @NotNull String getSessionId()
      Returns:
      id of the committing session
    • getUserId

      @NotNull public @NotNull String getUserId()
      Returns:
      user id of the committing user
    • getDate

      public long getDate()
      Returns:
      time stamp
    • isExternal

      public boolean isExternal()
      Return a flag indicating whether this is commit info is for an external change
      Returns:
      true if commit info is for an external change
    • getPath

      public String getPath()
      /** Returns the base path of this commit. All changes within this commit are expected to be located within the returned path. By default this is the root path, but a particular commit can declare a more specific base path to indicate that only changes within that subtree should be considered. Note that this value is purely informational and its interpretation depends on the kinds of commit hooks and observers present on the system.
      Returns:
      base path of this commit
    • getInfo

      public Map<String,Object> getInfo()
      Return the info map
      Returns:
      info map
    • equals

      public boolean equals(Object object)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object