Package jetbrains.buildServer.vcs
Class SingleVersionRepositoryStateAdapter
- java.lang.Object
-
- jetbrains.buildServer.vcs.SingleVersionRepositoryStateAdapter
-
- All Implemented Interfaces:
RepositoryState
,VcsDataObject
,VcsRepositoryState
public class SingleVersionRepositoryStateAdapter extends Object implements RepositoryState
Presents single repository version as repository state- Author:
- dmitry.neverov
-
-
Field Summary
Fields Modifier and Type Field Description static String
SPECIAL_BRANCH_NAME
-
Constructor Summary
Constructors Constructor Description SingleVersionRepositoryStateAdapter(String repositoryRevision)
SingleVersionRepositoryStateAdapter(String repositoryRevision, Date timestamp)
SingleVersionRepositoryStateAdapter(SingleVersionRepositoryStateAdapter other)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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()
-
-
-
Field Detail
-
SPECIAL_BRANCH_NAME
public static final String SPECIAL_BRANCH_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SingleVersionRepositoryStateAdapter
public SingleVersionRepositoryStateAdapter(@Nullable String repositoryRevision)
-
SingleVersionRepositoryStateAdapter
public SingleVersionRepositoryStateAdapter(@Nullable String repositoryRevision, @NotNull Date timestamp)
-
SingleVersionRepositoryStateAdapter
public SingleVersionRepositoryStateAdapter(@NotNull SingleVersionRepositoryStateAdapter 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
-
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
-
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)
-
setLastUpdatedBy
public void setLastUpdatedBy(@NotNull String lastUpdatedBy)
-
-