jetbrains.buildServer.web.util
Class BuildLookupService

java.lang.Object
  extended by jetbrains.buildServer.web.util.BuildLookupService

public class BuildLookupService
extends java.lang.Object

Author:
Kir

Field Summary
static java.lang.String LAST_FINISHED_FINDER
          Last finished build finder name
static java.lang.String LAST_PINNED_FINDER
          Last pinned build finder name
 
Constructor Summary
BuildLookupService(SBuildServer server, RevisionRuleBuildFinders buildFinders)
           
 
Method Summary
 SBuild findBuild(javax.servlet.http.HttpServletRequest request)
          Finds build information for given request, using parameters buildTypeId, buildId, buildNumber.
 SBuild getBuild(SBuildType buildType, RevisionRule rule, javax.servlet.http.HttpServletRequest request)
          Get a build from given RevisionRule
 BuildFinder getFinder(java.lang.String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LAST_FINISHED_FINDER

@NonNls
public static final java.lang.String LAST_FINISHED_FINDER
Last finished build finder name

See Also:
Constant Field Values

LAST_PINNED_FINDER

@NonNls
public static final java.lang.String LAST_PINNED_FINDER
Last pinned build finder name

See Also:
Constant Field Values
Constructor Detail

BuildLookupService

public BuildLookupService(@NotNull
                          SBuildServer server,
                          @NotNull
                          RevisionRuleBuildFinders buildFinders)
Method Detail

getBuild

@Nullable
public SBuild getBuild(@NotNull
                                SBuildType buildType,
                                RevisionRule rule,
                                javax.servlet.http.HttpServletRequest request)
Get a build from given RevisionRule

Parameters:
buildType - build configuration to find build in
rule - corresponding revision rule
request -
Returns:
found build according to the revision rule

getFinder

public BuildFinder getFinder(java.lang.String name)

findBuild

@NotNull
public SBuild findBuild(javax.servlet.http.HttpServletRequest request)
                 throws BuildNotFoundException,
                        BuildTypeNotFoundException
Finds build information for given request, using parameters buildTypeId, buildId, buildNumber. Supported URL formats allow to specify parameters via PATH_INFO and as simple GET parameters. buildId or buildNumber are required fields. Supports:
 page.html/buildTypeId/bt453/buildId/(lastFinished|lastSuccessful|lastPinned)
 page.html/buildTypeId/bt453/buildNumber/345.32
 page.html/buildId/345

 page.html?buildTypeId=bt453&buildId=(lastFinished|lastSuccessful|lastPinned)
 page.html?buildId=345

Parameters:
request - http request
Returns:
found build according to incoming parameters
Throws:
BuildNotFoundException - Was able to find build type, but cannot find corresponding build
BuildTypeNotFoundException - Unable to find neither build nor build type
See Also:
#findBuild(String, String, String,javax.servlet.http.HttpServletRequest)