Class CommitInfo
- java.lang.Object
-
- org.apache.jackrabbit.oak.spi.commit.CommitInfo
-
public final class CommitInfo extends java.lang.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 java.lang.String
OAK_UNKNOWN
-
Constructor Summary
Constructors Constructor Description CommitInfo(@NotNull java.lang.String sessionId, @Nullable java.lang.String userId)
Creates a commit info for the given session and user.CommitInfo(@NotNull java.lang.String sessionId, @Nullable java.lang.String userId, java.util.Map<java.lang.String,java.lang.Object> info)
Creates a commit info for the given session and user and info map.CommitInfo(@NotNull java.lang.String sessionId, @Nullable java.lang.String userId, java.util.Map<java.lang.String,java.lang.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(java.lang.Object object)
long
getDate()
java.util.Map<java.lang.String,java.lang.Object>
getInfo()
Return the info mapjava.lang.String
getPath()
/** Returns the base path of this commit.@NotNull java.lang.String
getSessionId()
@NotNull java.lang.String
getUserId()
int
hashCode()
boolean
isExternal()
Return a flag indicating whether this is commit info is for an external changejava.lang.String
toString()
-
-
-
Field Detail
-
OAK_UNKNOWN
public static final java.lang.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 java.lang.String sessionId, @Nullable @Nullable java.lang.String userId)
Creates a commit info for the given session and user.- Parameters:
sessionId
- session identifieruserId
- The user id.
-
CommitInfo
public CommitInfo(@NotNull @NotNull java.lang.String sessionId, @Nullable @Nullable java.lang.String userId, java.util.Map<java.lang.String,java.lang.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 java.lang.String sessionId, @Nullable @Nullable java.lang.String userId, java.util.Map<java.lang.String,java.lang.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 java.lang.String getSessionId()
- Returns:
- id of the committing session
-
getUserId
@NotNull public @NotNull java.lang.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 java.lang.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 java.util.Map<java.lang.String,java.lang.Object> getInfo()
Return the info map- Returns:
- info map
-
equals
public boolean equals(java.lang.Object object)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-