Package jetbrains.buildServer.vcs
Class RepositoryStateImpl
- java.lang.Object
-
- jetbrains.buildServer.vcs.RepositoryStateImpl
-
- All Implemented Interfaces:
RepositoryState
,VcsDataObject
,VcsRepositoryState
public class RepositoryStateImpl extends Object implements RepositoryState
- Author:
- dmitry.neverov
-
-
Constructor Summary
Constructors Constructor Description RepositoryStateImpl(String defaultBranchName)
RepositoryStateImpl(String defaultBranchName, Date createTimestamp)
RepositoryStateImpl(Map<String,String> branches, String defaultBranchName, Date createTimestamp)
RepositoryStateImpl(RepositoryStateImpl other)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static String
asString(RepositoryState repositoryState, int limit)
boolean
equals(Object o)
Map<String,Long>
getBranchCreateTimestamps()
Map<String,String>
getBranchRevisions()
Date
getCreateTimestamp()
String
getDefaultBranchName()
String
getDefaultBranchRevision()
String
getLastUpdatedBy()
Date
getLoadFromPersistentStorageTimestamp()
int
hashCode()
boolean
isEmpty()
void
setBranchCreateTimestamp(String name, long createTimeMillis)
Sets time when the specified branch has been created in VCS repositoryvoid
setBranchRevision(String name, String revision)
Sets revision of specified branchvoid
setLastUpdatedBy(String lastUpdatedBy)
void
setLoadFromStorageTimestamp(Date loadFromStorageTimestamp)
String
toString()
-
-
-
Constructor Detail
-
RepositoryStateImpl
public RepositoryStateImpl(@NotNull String defaultBranchName)
-
RepositoryStateImpl
public RepositoryStateImpl(@NotNull String defaultBranchName, @NotNull Date createTimestamp)
-
RepositoryStateImpl
public RepositoryStateImpl(@NotNull RepositoryStateImpl other)
-
-
Method Detail
-
getBranchRevisions
@NotNull public Map<String,String> getBranchRevisions()
- Specified by:
getBranchRevisions
in interfaceVcsRepositoryState
- Returns:
- VCS branch to Revision state for the repository. If the map is empty, the operation for collection of repositoryState wasn't performed as expensive
-
setBranchRevision
public void setBranchRevision(@NotNull String name, @NotNull String revision)
Description copied from interface:RepositoryState
Sets revision of specified branch- Specified by:
setBranchRevision
in interfaceRepositoryState
- Parameters:
name
- branch namerevision
- branch revision
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfaceVcsRepositoryState
- Returns:
- true if this RepositoryState doesn't contain any information, i.e. it is Null object
-
getDefaultBranchName
@NotNull public String getDefaultBranchName()
- Specified by:
getDefaultBranchName
in interfaceVcsRepositoryState
- Returns:
- The branch which is considered default for the moment of changes collecting
-
getDefaultBranchRevision
@Nullable public String getDefaultBranchRevision()
- Specified by:
getDefaultBranchRevision
in interfaceVcsRepositoryState
- Returns:
- revision for the #getDefaultBranchName branch
-
getCreateTimestamp
@NotNull public Date getCreateTimestamp()
- Specified by:
getCreateTimestamp
in interfaceRepositoryState
- Returns:
- timestamp when this state was created.
-
setBranchCreateTimestamp
public void setBranchCreateTimestamp(@NotNull String name, long createTimeMillis)
Description copied from interface:RepositoryState
Sets time when the specified branch has been created in VCS repository- Specified by:
setBranchCreateTimestamp
in interfaceRepositoryState
- Parameters:
name
- branch namecreateTimeMillis
- time when branch was created
-
getLoadFromPersistentStorageTimestamp
@Nullable public Date getLoadFromPersistentStorageTimestamp()
- Specified by:
getLoadFromPersistentStorageTimestamp
in interfaceRepositoryState
- Returns:
- timestamp when this repository state has been loaded from the persistent storage or null if it has not been persisted yet
-
setLoadFromStorageTimestamp
public void setLoadFromStorageTimestamp(@Nullable Date loadFromStorageTimestamp)
-
getBranchCreateTimestamps
@NotNull public Map<String,Long> getBranchCreateTimestamps()
- Specified by:
getBranchCreateTimestamps
in interfaceRepositoryState
- Returns:
- map of branch name to the branch create time in milliseconds
-
getLastUpdatedBy
@NotNull public String getLastUpdatedBy()
- Specified by:
getLastUpdatedBy
in interfaceRepositoryState
- Returns:
- id of the node which was the last who updated this state
-
setLastUpdatedBy
public void setLastUpdatedBy(@NotNull String lastUpdatedBy)
-
asString
@NotNull public static String asString(@NotNull RepositoryState repositoryState, int limit)
-
-