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 Summary
Fields Modifier and Type Field Description static CommitInfo
EMPTY
Empty commit information object.static CommitInfo
EMPTY_EXTERNAL
Empty commit information object to be used for external changes.static String
OAK_UNKNOWN
-
Constructor Summary
Constructors Constructor Description CommitInfo(@NotNull String sessionId, @Nullable String userId)
Creates a commit info for the given session and user.CommitInfo(@NotNull String sessionId, @Nullable String userId, Map<String,Object> info)
Creates a commit info for the given session and user and info map.CommitInfo(@NotNull String sessionId, @Nullable String userId, Map<String,Object> info, boolean external)
Creates a commit info for the given session and user and info map.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object object)
long
getDate()
Map<String,Object>
getInfo()
Return the info mapString
getPath()
/** Returns the base path of this commit.@NotNull String
getSessionId()
@NotNull String
getUserId()
int
hashCode()
boolean
isExternal()
Return a flag indicating whether this is commit info is for an external changeString
toString()
-
-
-
Field Detail
-
OAK_UNKNOWN
public static final String OAK_UNKNOWN
- See Also:
- Constant Field Values
-
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 Detail
-
CommitInfo
public CommitInfo(@NotNull @NotNull String sessionId, @Nullable @Nullable String userId)
Creates a commit info for the given session and user.- Parameters:
sessionId
- session identifieruserId
- 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 identifieruserId
- 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 identifieruserId
- The user id.info
- info mapexternal
- indicates if the commit info is from external change
-
-
Method Detail
-
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
-
-