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 StringasString(RepositoryState repositoryState, int limit)booleanequals(Object o)Map<String,Long>getBranchCreateTimestamps()Map<String,String>getBranchRevisions()DategetCreateTimestamp()StringgetDefaultBranchName()StringgetDefaultBranchRevision()StringgetLastUpdatedBy()DategetLoadFromPersistentStorageTimestamp()inthashCode()booleanisEmpty()voidsetBranchCreateTimestamp(String name, long createTimeMillis)Sets time when the specified branch has been created in VCS repositoryvoidsetBranchRevision(String name, String revision)Sets revision of specified branchvoidsetLastUpdatedBy(String lastUpdatedBy)voidsetLoadFromStorageTimestamp(Date loadFromStorageTimestamp)StringtoString()
-
-
-
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:
getBranchRevisionsin 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:RepositoryStateSets revision of specified branch- Specified by:
setBranchRevisionin interfaceRepositoryState- Parameters:
name- branch namerevision- branch revision
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfaceVcsRepositoryState- Returns:
- true if this RepositoryState doesn't contain any information, i.e. it is Null object
-
getDefaultBranchName
@NotNull public String getDefaultBranchName()
- Specified by:
getDefaultBranchNamein interfaceVcsRepositoryState- Returns:
- The branch which is considered default for the moment of changes collecting
-
getDefaultBranchRevision
@Nullable public String getDefaultBranchRevision()
- Specified by:
getDefaultBranchRevisionin interfaceVcsRepositoryState- Returns:
- revision for the #getDefaultBranchName branch
-
getCreateTimestamp
@NotNull public Date getCreateTimestamp()
- Specified by:
getCreateTimestampin interfaceRepositoryState- Returns:
- timestamp when this state was created.
-
setBranchCreateTimestamp
public void setBranchCreateTimestamp(@NotNull String name, long createTimeMillis)Description copied from interface:RepositoryStateSets time when the specified branch has been created in VCS repository- Specified by:
setBranchCreateTimestampin interfaceRepositoryState- Parameters:
name- branch namecreateTimeMillis- time when branch was created
-
getLoadFromPersistentStorageTimestamp
@Nullable public Date getLoadFromPersistentStorageTimestamp()
- Specified by:
getLoadFromPersistentStorageTimestampin 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:
getBranchCreateTimestampsin interfaceRepositoryState- Returns:
- map of branch name to the branch create time in milliseconds
-
getLastUpdatedBy
@NotNull public String getLastUpdatedBy()
- Specified by:
getLastUpdatedByin 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)
-
-