jetbrains.buildServer.serverSide
Interface PersonalBuildManager


public interface PersonalBuildManager

Provides information about personal builds.


Method Summary
 SQueuedBuild addRemoteRunToQueue(BuildType buildType, BuildAgent agent, long changeListId, java.lang.String comment)
          Schedules configuration to run specified personal changes on specified agent.
 SQueuedBuild addRemoteRunToQueue(BuildType buildType, long changeListId, java.lang.String comment)
          Schedules configuration to run specified personal changes.
 java.util.List<BuildPromotion> findBuildPromotionsByChangesId(long id)
          Finds personal build promotions by change id.
 java.util.List<BuildPromotion> findBuildPromotionsByUserId(long userId)
          Finds personal build promotions by user id.
 byte[] getContent(VcsModification modification, VcsChangeInfo change)
          Returns sent content of the specified file.
 byte[] getCurrentRepositoryContentForPersonallyChangedFile(VcsModification modification, java.lang.String fileName, SBuildType buildType)
          Returns last vcs repository content of the file specified.
 SVcsModification getModification(long changesId)
          Returns SVcsModification object for the personal modification with the given id.
 java.util.List<SVcsModification> getModifications(long userId)
          Returns collection of SVcsModification modifications ran by the given user.
 PersonalChangeInfo getPersonalChangeInfo(long id)
          returns information about personal change by the change id (the same as modification id)
 java.lang.String getPersonalChangeRelativeFilePath(java.lang.String original, long startedBuildId)
          Returns relative personal change path mapped when personal patch was built to send it to an agent.
 boolean isApplicable(long personalChangeId, java.util.List<VcsRootInstanceEntry> vcsRootEntries)
          Returns true if personal change files can be applied to VCS roots of the specified build configuration.
 boolean isApplicable(SBuildType buildType, java.util.Collection<java.lang.String> personalChangeFilePaths, boolean searchThroughDependencies)
          Returns true if personal change files can be applied to VCS roots of the specified build configuration.
 boolean isApplicable(VcsRootInstanceEntry vcsRootEntry, java.util.Collection<java.lang.String> personalChangeFilePaths)
          Returns true if personal change files can be applied to specified VCS root entry.
 boolean isRelated(VcsRootInstanceEntry vcsRootEntry, java.util.Collection<java.lang.String> filePaths)
          Returns true if files are related to specified VCS root entry.
 long publishChangeList(PersonalChangeInfo changeInfo, java.io.InputStream input)
          Publishes personal changes.
 void schedulePersonalChangeForDeletion(long changeId, User user)
          Schedules personal change for deletion.
 void setPersonalChangeStatus(long changeId, Status status)
          Changes personal change commit status (if the change was committed successfully).
 

Method Detail

getModifications

java.util.List<SVcsModification> getModifications(long userId)
Returns collection of SVcsModification modifications ran by the given user.

Parameters:
userId - specified user.
Returns:
all personal changes run by the user, resent first
Since:
5.0

getModification

@Nullable
SVcsModification getModification(long changesId)
Returns SVcsModification object for the personal modification with the given id.

Parameters:
changesId - personal change id.
Returns:
modification object for the personal change.

addRemoteRunToQueue

@Nullable
SQueuedBuild addRemoteRunToQueue(@NotNull
                                          BuildType buildType,
                                          long changeListId,
                                          java.lang.String comment)
Schedules configuration to run specified personal changes.

Parameters:
buildType - specified build configuration.
changeListId - specified personal change id.
comment - user comment.
Returns:
temporary created configuration id.

addRemoteRunToQueue

@Nullable
SQueuedBuild addRemoteRunToQueue(@NotNull
                                          BuildType buildType,
                                          @NotNull
                                          BuildAgent agent,
                                          long changeListId,
                                          java.lang.String comment)
Schedules configuration to run specified personal changes on specified agent.

Parameters:
buildType - specified build configuration.
agent - specified agent.
changeListId - specified personal change id.
comment - user comment.
Returns:
temporary created configuration id.

publishChangeList

long publishChangeList(PersonalChangeInfo changeInfo,
                       java.io.InputStream input)
                       throws java.io.IOException
Publishes personal changes.

Parameters:
changeInfo - personal changes information object.
input - input stream containing personal changes.
Returns:
newly created personal change id.
Throws:
java.io.IOException - exception if the publishing process failes.

findBuildPromotionsByChangesId

@NotNull
java.util.List<BuildPromotion> findBuildPromotionsByChangesId(long id)
Finds personal build promotions by change id.

Parameters:
id - specified change id.
Returns:
list of all personal build promotions.
Since:
7.1

findBuildPromotionsByUserId

@NotNull
java.util.List<BuildPromotion> findBuildPromotionsByUserId(long userId)
Finds personal build promotions by user id.

Parameters:
id - specified user id.
Returns:
list of all personal build promotions owned by specified user.
Since:
7.1

setPersonalChangeStatus

void setPersonalChangeStatus(long changeId,
                             Status status)
Changes personal change commit status (if the change was committed successfully).

Parameters:
changeId - specified change id.
status - commit status.

getPersonalChangeInfo

@Nullable
PersonalChangeInfo getPersonalChangeInfo(long id)
returns information about personal change by the change id (the same as modification id)

Parameters:
id - personal change id
Returns:
data object containing information about personal change

schedulePersonalChangeForDeletion

void schedulePersonalChangeForDeletion(long changeId,
                                       User user)
Schedules personal change for deletion. If some build is in queue or finished it will be deleted immediatelly. If build is being ran it cancel request will be sent to the agent. Change will be marked as scheduled for deletion and will be excluded from user changes.

Parameters:
changeId - specified change id.
user - specified user. Only user who ran the change can delete it.

getContent

byte[] getContent(VcsModification modification,
                  VcsChangeInfo change)
                  throws VcsException
Returns sent content of the specified file.

Parameters:
modification - specified personal modification.
change - specified file change.
Returns:
file content.
Throws:
VcsException - throws exception if file content cannot be read.

getCurrentRepositoryContentForPersonallyChangedFile

byte[] getCurrentRepositoryContentForPersonallyChangedFile(VcsModification modification,
                                                           java.lang.String fileName,
                                                           SBuildType buildType)
                                                           throws VcsException
Returns last vcs repository content of the file specified.

Parameters:
modification - specified modification.
fileName - specified file relative name.
buildType - specified configuration.
Returns:
file content from the repository.
Throws:
VcsException - throws exception if content cannot be loaded from the repository.

getPersonalChangeRelativeFilePath

java.lang.String getPersonalChangeRelativeFilePath(java.lang.String original,
                                                   long startedBuildId)
Returns relative personal change path mapped when personal patch was built to send it to an agent.

Parameters:
original - - original change full file path.
startedBuildId - - build id when change was used.
Returns:
relative personal change path built for the specified build, null is change was not built yet.

isApplicable

boolean isApplicable(long personalChangeId,
                     @NotNull
                     java.util.List<VcsRootInstanceEntry> vcsRootEntries)
Returns true if personal change files can be applied to VCS roots of the specified build configuration.

Parameters:
personalChangeId - personal change id
vcsRootEntries - vcs root entries
Returns:
see above

isApplicable

boolean isApplicable(@NotNull
                     SBuildType buildType,
                     @NotNull
                     java.util.Collection<java.lang.String> personalChangeFilePaths,
                     boolean searchThroughDependencies)
Returns true if personal change files can be applied to VCS roots of the specified build configuration.

Parameters:
buildType - build configuration
personalChangeFilePaths - paths from the personal change
searchThroughDependencies - whether to search through build configuration dependencies or not
Returns:
see above

isApplicable

boolean isApplicable(@NotNull
                     VcsRootInstanceEntry vcsRootEntry,
                     @NotNull
                     java.util.Collection<java.lang.String> personalChangeFilePaths)
Returns true if personal change files can be applied to specified VCS root entry.

Parameters:
vcsRootEntry - VCS root entry
personalChangeFilePaths - paths to check
Returns:
see above
Since:
6.5

isRelated

boolean isRelated(@NotNull
                  VcsRootInstanceEntry vcsRootEntry,
                  @NotNull
                  java.util.Collection<java.lang.String> filePaths)
Returns true if files are related to specified VCS root entry. By another words returns true if files are applicable to specified VCS root entry or would be applicable if VCS root entry is less specific (has path "a/b" instead of "a/b/c").

Parameters:
vcsRootEntry - VCS root entry
filePaths - paths to check
Returns:
see above
Since:
7.0